Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(components): use base tag href if defined for post-icon #4217

Open
wants to merge 1 commit into
base: release/v7
Choose a base branch
from

Conversation

leagrdv
Copy link
Contributor

@leagrdv leagrdv commented Dec 12, 2024

No description provided.

@leagrdv leagrdv requested a review from a team as a code owner December 12, 2024 09:28
@leagrdv leagrdv requested a review from alizedebray December 12, 2024 09:28
Copy link

changeset-bot bot commented Dec 12, 2024

🦋 Changeset detected

Latest commit: ac411e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@swisspost/design-system-components Patch
@swisspost/design-system-components-angular-workspace Patch
@swisspost/design-system-components-react Patch
@swisspost/design-system-documentation Patch
@swisspost/design-system-components-angular Patch
@swisspost/design-system-nextjs-integration Patch
@swisspost/design-system-styles Patch
@swisspost/design-system-tokens Patch
@swisspost/design-system-intranet-header Patch
@swisspost/design-system-icons Patch
@swisspost/design-system-migrations Patch
@swisspost/design-system-styles-primeng Patch
@swisspost/design-system-demo Patch
@swisspost/internet-header Patch
@swisspost/design-system-intranet-header-workspace Patch
@swisspost/design-system-styles-primeng-workspace Patch
@swisspost/design-system-intranet-header-showcase Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Dec 12, 2024

Related Previews

@@ -131,7 +131,8 @@ export class PostIcon {
.querySelector('meta[name="design-system-settings"][data-post-icon-base]')
?.getAttribute('data-post-icon-base') ?? null;

const fileBase = `${this.base ?? metaBase ?? CDN_URL}/`.replace(/\/\/$/, '/');
const baseHref = document.getElementsByTagName('base')[0]?.href;
const fileBase = `${this.base ?? metaBase ?? baseHref ?? CDN_URL}/`.replace(/\/\/$/, '/');
Copy link
Contributor

Choose a reason for hiding this comment

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

If you set a base tag, you expect the base URL to be use for all relative URLs in the code. Therefore the baseHref should not replace the icon base path but it should be added to the metaBase or to this.base if they are relative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants