Skip to content

Commit

Permalink
Merge branch 'main' into test/e2e-tests-parallel-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
m4olivei authored Nov 19, 2024
2 parents 670bad9 + ec54fbe commit d95c560
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const mastheadL1Data: MastheadL1 = {
submenu: {
columns: 2,
announcement:
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="#">inline link</a>',
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="https://example.com">inline link</a>',
footer: {
title: 'View all lorem ipsum (B)',
url: 'https://example.com',
Expand Down Expand Up @@ -145,7 +145,7 @@ const mastheadL1Data: MastheadL1 = {
submenu: {
columns: 3,
announcement:
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="#">inline link</a>',
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="htts://example.com">inline link</a>',
menuSections: [
{
span: 1,
Expand Down Expand Up @@ -236,7 +236,7 @@ const mastheadL1Data: MastheadL1 = {
submenu: {
columns: 3,
announcement:
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="#">inline link</a>',
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="htts://example.com">inline link</a>',
menuSections: [
{
span: 1,
Expand Down Expand Up @@ -407,7 +407,7 @@ const mastheadL1Data: MastheadL1 = {
submenu: {
columns: 2,
announcement:
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="#">inline link</a>',
'<strong>Lorem ipsum:</strong> Full announcement may be linked or only a portion as an <a href="htts://example.com">inline link</a>',
footer: {
title: 'View all lorem ipsum (E)',
url: 'https://example.com',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import StableSelectorMixin from '../../globals/mixins/stable-selector';
import { html, LitElement } from 'lit';
import { property, state } from 'lit/decorators.js';
import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element';
import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';
import ShoppingCart20 from '@carbon/web-components/es/icons/shopping--cart/20.js';
import styles from './masthead.scss';
import LocaleAPI from '@carbon/ibmdotcom-services/es/services/Locale/Locale.js';
Expand Down
16 changes: 13 additions & 3 deletions packages/web-components/src/components/masthead/masthead-l1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,9 +933,19 @@ class C4DMastheadL1 extends StableSelectorMixin(LitElement) {
}
// Fall back to automated selection based on URL.
else {
this.selectedElements = allLinks.filter(
(el) => el.href === currentUrlPath
);
this.selectedElements = allLinks.filter((el) => {
try {
const elURL = new URL(el.href);
const currURL = new URL(currentUrlPath || '');

// Compare url without query params.
return (
elURL.host === currURL.host && elURL.pathname === currURL.pathname
);
} catch (_error) {
return false;
}
});
}

if (this.selectedElements.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import CDSStructuredListCell from '@carbon/web-components/es/components/structured-list/structured-list-cell.js';
import { html } from 'lit';
import { property } from 'lit/decorators.js';
import { ifDefined } from 'lit/directives/if-defined';
import { ifDefined } from 'lit/directives/if-defined.js';
import Info16 from '@carbon/web-components/es/icons/information/16.js';
import Checkmark20 from '@carbon/web-components/es/icons/checkmark/20.js';
import Error20 from '@carbon/web-components/es/icons/error/20.js';
Expand Down
2 changes: 1 addition & 1 deletion packages/web-components/src/components/tile/tile-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { LitElement, html } from 'lit';
import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element';
import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';
import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
import styles from './tile.scss';

Expand Down
8 changes: 4 additions & 4 deletions packages/web-components/src/components/tile/tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
*/

import { LitElement, html } from 'lit';
import { property, state, query } from 'lit/decorators';
import { classMap } from 'lit/directives/class-map';
import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element';
import { property, state, query } from 'lit/decorators.js';
import { classMap } from 'lit/directives/class-map.js';
import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js';
import settings from '@carbon/ibmdotcom-utilities/es/utilities/settings/settings.js';
import { ifDefined } from 'lit/directives/if-defined';
import { ifDefined } from 'lit/directives/if-defined.js';
import CTAMixin from '../../component-mixins/cta/cta';
import VideoCTAMixin from '../../component-mixins/cta/video';
import { CTA_TYPE } from '../cta/defs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const ThrottledInputMixin = <T extends Constructor<HTMLElement>>(Base: T) => {
/**
* The throttle timeout to run query upon user input.
*/
inputTimeout = 200;
abstract inputTimeout: number;

connectedCallback() {
// TS seems to miss `HTMLElement.prototype.connectedCallback()` definition
Expand Down

0 comments on commit d95c560

Please sign in to comment.