scania-digital-design-system / tegel

Tegel Design System
https://tegel.scania.com
MIT License
19 stars 14 forks source link

Enable Shadow DOM for tds-header Component to Improve Slot Behavior and Encapsulation #831

Closed ckrook closed 1 week ago

ckrook commented 1 week ago

Describe pull-request

Enabled Shadow DOM for tds-header component to improve slot functionality and ensure encapsulation of styles and layout.

Issue Linking:

Choose one of the following options

How to test

I have created a beta release for this fix for core and all wrappers. Core: https://www.npmjs.com/package/@scania/tegel/v/1.18.0-tdsheaderitembeta.5.2 Angular-17: https://www.npmjs.com/package/@scania/tegel-angular-17/v/1.18.0-tdsheaderitembeta.5.2 Angular: https://www.npmjs.com/package/@scania/tegel-angular/v/1.18.0-tdsheaderitembeta.5.2 React: https://www.npmjs.com/package/@scania/tegel-react/v/1.18.0-tdsheaderitembeta.5.2

This can be tested by download the release to a demopage locally and add this item inside the header:

      <tds-header-item *ngIf="showOrders" slot="end" title="Orders">
        <a routerLink="/orders">Orders</a>
      </tds-header-item>

Also, have a button which makes it possible to toggle the 'showOrders'

<button (click)="toggleOrdersVisibility()">Toggle Orders Visibility</button>

Lastly, add the function which toggles the 'showOrders'

toggleOrdersVisibility() { this.showOrders = !this.showOrders; }

The above code is how I test it for Angular-17. It may look different for other wrappers.

Checklist before submission

Suggested test steps

Screenshots

Include before/after screenshots for UI changes.

Additional context

Add any other context or feedback requests about the pull-request here.

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

github-actions[bot] commented 1 week ago

Playwright test results

failed  1 failed
passed  389 passed
skipped  1 skipped

Details

stats  391 tests across 132 suites
duration  52.9 seconds
commit  46d7153

Failed tests src/components/header/test/default/header.e2e.ts › tds-header-default › launcher should open on click
Skipped tests src/components/table/table/test/expandable-row-autocollapse/expandable-row-autocollapse.e2e.ts › tds-table-expandable-row-autoCollapse › NEEDS FIXING: expanding one row collapses the others when autoCollapse is true
aws-amplify-eu-north-1[bot] commented 1 week ago

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-831.d3fazya28914g3.amplifyapp.com