Skip to content

fix: The server path is not appended to stylesheets before load in Backoffice#19192

Merged
iOvergaard merged 5 commits intorelease/15.4from
v15/bugfix/tiptap-stylesheet-rootpath
Apr 29, 2025
Merged

fix: The server path is not appended to stylesheets before load in Backoffice#19192
iOvergaard merged 5 commits intorelease/15.4from
v15/bugfix/tiptap-stylesheet-rootpath

Conversation

@iOvergaard
Copy link
Contributor

Changes

Fixes #19188

  • Updates the @tiptap dependencies in the package-lock.json file to a newer version (from 2.11.5 to 2.11.7).
  • Prepends the /css path to stylesheets before loading them in the Backoffice in Tiptap

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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}" />`,

@iOvergaard iOvergaard requested a review from Copilot April 29, 2025 12:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@iOvergaard
Copy link
Contributor Author

Absolutely, great catch, @AndyButland. I have moved the logic up so it only applies to the picked stylesheets and not "everything else".

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great - all working as expected now.

@iOvergaard iOvergaard enabled auto-merge (squash) April 29, 2025 13:05
@iOvergaard iOvergaard merged commit 6300ccc into release/15.4 Apr 29, 2025
22 of 23 checks passed
@iOvergaard iOvergaard deleted the v15/bugfix/tiptap-stylesheet-rootpath branch April 29, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants