fix: The server path is not appended to stylesheets before load in Backoffice#19192
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an issue where the server path is not prepended to stylesheets before being loaded in the Backoffice.
- Updates @tiptap dependencies
- Prepends the "/css" path to stylesheet URLs in the Backoffice
Files not reviewed (2)
- src/Umbraco.Web.UI.Client/package-lock.json: Language not supported
- src/Umbraco.Web.UI.Client/package.json: Language not supported
Comments suppressed due to low confidence (1)
src/Umbraco.Web.UI.Client/src/packages/tiptap/components/input-tiptap/input-tiptap.element.ts:193
- Consider verifying that the stylesheet paths in '#stylesheets' never already include the '/css' prefix to avoid accidentally double prefixing, which could break stylesheet loading.
html`<link rel="stylesheet" href="${STYLESHEET_ROOT_PATH}${stylesheet}" />`,
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issue #19188 by ensuring that stylesheet paths are correctly prefixed with "/css" before being loaded in the Backoffice. The key changes include:
- Updating the @tiptap dependencies from 2.11.5 to 2.11.7 in package-lock.json.
- Introducing a constant for the stylesheet root path.
- Modifying the rendering of stylesheet links to conditionally prepend "/css" to relative paths.
Files not reviewed (2)
- src/Umbraco.Web.UI.Client/package-lock.json: Language not supported
- src/Umbraco.Web.UI.Client/package.json: Language not supported
src/Umbraco.Web.UI.Client/src/packages/tiptap/components/input-tiptap/input-tiptap.element.ts
Outdated
Show resolved
Hide resolved
AndyButland
left a comment
There was a problem hiding this comment.
I've tested before and after this PR is applied and verified that the issue is resolved by this update.
However I'm seeing now a failed request for rte-content.css that I don't see when I have release/15.4 checked out and built.
With this PR applied we are getting the /css/ prepended on this path (defined on line 36), ending up with /css/umbraco/backoffice/css/rte-content.css.
Perhaps you need to amend the paths coming back from the server at the point they are received and added to this.#stylesheets?
|
Absolutely, great catch, @AndyButland. I have moved the logic up so it only applies to the picked stylesheets and not "everything else". |
AndyButland
left a comment
There was a problem hiding this comment.
Great - all working as expected now.
Changes
Fixes #19188
@tiptapdependencies in thepackage-lock.jsonfile to a newer version (from2.11.5to2.11.7)./csspath to stylesheets before loading them in the Backoffice in Tiptap