From 7ff7b505180bf61f48868ae3da083d0c53d945ee Mon Sep 17 00:00:00 2001 From: Benjamin <166110368+BenjaminPabst@users.noreply.github.com> Date: Tue, 20 Aug 2024 15:15:02 +0200 Subject: [PATCH 01/24] feat: allow disable of row selection (#406) feat: allow disable of row selection --- .../data-table/data-table.component.html | 5 +++- .../data-table/data-table.component.spec.ts | 25 +++++++++++++++++++ .../data-table/data-table.component.ts | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html index 29735f6b..f39cae63 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html @@ -188,7 +188,10 @@ - + diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.spec.ts b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.spec.ts index 88fc8b7d..e1808e7f 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.spec.ts +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.spec.ts @@ -367,6 +367,31 @@ describe('DataTableComponent', () => { expect(selectedCheckBoxes.length).toBe(1) expect(selectionChangedEvent).toEqual([mockData[0]]) }) + + it('should not change selection if selection disabled', async () => { + let selectionChangedEvent: Row[] | undefined + + component.selectionEnabledField = 'selectionEnabled' + + component.rows = mockData.map((m) => ({ + ...m, + selectionEnabled: false, + })) + + component.selectionChanged.subscribe((event) => (selectionChangedEvent = event)) + unselectedCheckBoxes = await dataTable.getHarnessesForCheckboxes('unchecked') + selectedCheckBoxes = await dataTable.getHarnessesForCheckboxes('checked') + expect(unselectedCheckBoxes.length).toBe(5) + expect(selectedCheckBoxes.length).toBe(0) + expect(selectionChangedEvent).toBeUndefined() + + const firstRowCheckBox = unselectedCheckBoxes[0] + await firstRowCheckBox.checkBox() + unselectedCheckBoxes = await dataTable.getHarnessesForCheckboxes('unchecked') + selectedCheckBoxes = await dataTable.getHarnessesForCheckboxes('checked') + expect(unselectedCheckBoxes.length).toBe(5) + expect(selectedCheckBoxes.length).toBe(0) + }) }) describe('Frozen action column', () => { diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts index b0472e0b..165aff96 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts @@ -116,6 +116,7 @@ export class DataTableComponent extends DataSortBase implements OnInit { @Input() viewActionEnabledField: string | undefined @Input() editActionVisibleField: string | undefined @Input() editActionEnabledField: string | undefined + @Input() selectionEnabledField: string | undefined @Input() paginator = true @Input() page = 0 @Input() From 8a37a1aa15daa320a39bf9d7e0bb7b7387324e7a Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Tue, 20 Aug 2024 13:22:23 +0000 Subject: [PATCH 02/24] chore(release): -v5.5.0 [skip ci] ## [5.5.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.4.0...v5.5.0) (2024-08-20) ### Features * allow disable of row selection ([#406](https://github.com/onecx/onecx-portal-ui-libs/issues/406)) ([7ff7b50](https://github.com/onecx/onecx-portal-ui-libs/commit/7ff7b505180bf61f48868ae3da083d0c53d945ee)) * remote component - slot - slot owner binding ([#352](https://github.com/onecx/onecx-portal-ui-libs/issues/352)) ([3e06fc2](https://github.com/onecx/onecx-portal-ui-libs/commit/3e06fc2235f2a8d6c072e57770dcb30c4babe814)) --- CHANGELOG.md | 7 +++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 14 files changed, 20 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13e2cad3..9404080f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [5.5.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.4.0...v5.5.0) (2024-08-20) + +### Features + +* allow disable of row selection ([#406](https://github.com/onecx/onecx-portal-ui-libs/issues/406)) ([7ff7b50](https://github.com/onecx/onecx-portal-ui-libs/commit/7ff7b505180bf61f48868ae3da083d0c53d945ee)) +* remote component - slot - slot owner binding ([#352](https://github.com/onecx/onecx-portal-ui-libs/issues/352)) ([3e06fc2](https://github.com/onecx/onecx-portal-ui-libs/commit/3e06fc2235f2a8d6c072e57770dcb30c4babe814)) + ## [5.4.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.3.2...v5.4.0) (2024-08-19) ### Features diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 5435466f..e8111735 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1" diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 6c9cc4e1..04d883b9 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 21d76f76..7a84676a 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", "@angular/common": "^18.0.5", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index cedd5b08..684a0946 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular/core": "^18.0.5", "@onecx/integration-interface": "~5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index 97883f3d..d88fbd54 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index dadd4081..60f075dd 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular/cdk": "^18.0.5", "primeng": "^17.18.6" diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index 155cd8ec..fa4b0523 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/platform-browser": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 28985963..3a00d04f 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index 2292d6c4..3c829475 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index f4fee2f9..4903db4a 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index 36bd0fbc..a93e6777 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "tslib": "^2.6.3" }, diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index 6b65507b..88d4967e 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.4.0", + "version": "5.5.0", "peerDependencies": { "rxjs": "7.8.1", "@angular/animations": "^18.0.5", diff --git a/package.json b/package.json index 84a15807..29e1b7ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.4.0", + "version": "5.5.0", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From 8aa60a0a94791764652b7d2b1957976e45813927 Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Wed, 21 Aug 2024 09:32:36 +0200 Subject: [PATCH 03/24] feat: add workspace displayname (#417) * fix: update angular versions * feat: add displayname for workspace --------- Co-authored-by: kim.tran Co-authored-by: Annika Nowak <139357202+anninowak@users.noreply.github.com> --- .../src/lib/topics/current-workspace/v1/workspace.model.ts | 1 + package-lock.json | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/integration-interface/src/lib/topics/current-workspace/v1/workspace.model.ts b/libs/integration-interface/src/lib/topics/current-workspace/v1/workspace.model.ts index b7ed22b5..da9c2c68 100644 --- a/libs/integration-interface/src/lib/topics/current-workspace/v1/workspace.model.ts +++ b/libs/integration-interface/src/lib/topics/current-workspace/v1/workspace.model.ts @@ -3,6 +3,7 @@ import {Route} from './route.model' export interface Workspace { id?: string + displayName?: string /** * @deprecated will be renamed to workspaceName */ diff --git a/package-lock.json b/package-lock.json index b67c65f2..a6c9f14a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.3.2", + "version": "5.5.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.3.2", + "version": "5.5.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -117,7 +117,7 @@ }, "libs/portal-layout-styles": { "name": "@onecx/portal-layout-styles", - "version": "5.3.2", + "version": "5.5.0", "peerDependencies": { "tslib": "^2.6.3" } From 3a016395e3335a9a850fcca8d197210014a883d1 Mon Sep 17 00:00:00 2001 From: Bastian Jakobi <55296998+bastianjakobi@users.noreply.github.com> Date: Thu, 22 Aug 2024 08:44:34 +0200 Subject: [PATCH 04/24] fix: prevent p-menu item text from wrapping (#415) --- .../components/page-header/page-header.component.stories.ts | 3 ++- .../src/styles/primeng/sass/theme/extensions/_menu.scss | 3 +++ .../primeng/sass/theme/extensions/_vendor_extensions.scss | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_menu.scss diff --git a/libs/angular-accelerator/src/lib/components/page-header/page-header.component.stories.ts b/libs/angular-accelerator/src/lib/components/page-header/page-header.component.stories.ts index 7384ce6f..50d7b0b5 100644 --- a/libs/angular-accelerator/src/lib/components/page-header/page-header.component.stories.ts +++ b/libs/angular-accelerator/src/lib/components/page-header/page-header.component.stories.ts @@ -76,11 +76,12 @@ const demoActions: Action[] = [ icon: PrimeIcons.TRASH, }, { - label: 'Some action', + label: 'Some action that has a long text', actionCallback: () => { console.log(`you clicked 'Some action'`) }, show: 'asOverflow', + icon: PrimeIcons.ADDRESS_BOOK }, { label: 'Other action', diff --git a/libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_menu.scss b/libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_menu.scss new file mode 100644 index 00000000..8dea2841 --- /dev/null +++ b/libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_menu.scss @@ -0,0 +1,3 @@ +.p-menu-overlay { + width: auto !important; + } \ No newline at end of file diff --git a/libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_vendor_extensions.scss b/libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_vendor_extensions.scss index 2c06068f..7fd5181b 100644 --- a/libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_vendor_extensions.scss +++ b/libs/portal-layout-styles/src/styles/primeng/sass/theme/extensions/_vendor_extensions.scss @@ -18,6 +18,7 @@ @import './_fieldset'; @import './_float_label'; @import './_listbox'; +@import './menu'; @import './_multiselect'; @import './_overlaypanel'; @import './_panel'; From 0309fde1a47afeb909f73c9a5af74792fcaf163d Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 22 Aug 2024 07:06:39 +0000 Subject: [PATCH 05/24] chore(release): -v5.6.0 [skip ci] ## [5.6.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.5.0...v5.6.0) (2024-08-22) ### Features * add workspace displayname ([#417](https://github.com/onecx/onecx-portal-ui-libs/issues/417)) ([8aa60a0](https://github.com/onecx/onecx-portal-ui-libs/commit/8aa60a0a94791764652b7d2b1957976e45813927)) ### Bug Fixes * prevent p-menu item text from wrapping ([#415](https://github.com/onecx/onecx-portal-ui-libs/issues/415)) ([3a01639](https://github.com/onecx/onecx-portal-ui-libs/commit/3a016395e3335a9a850fcca8d197210014a883d1)) --- CHANGELOG.md | 10 ++++++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 14 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9404080f..2f89f61b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [5.6.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.5.0...v5.6.0) (2024-08-22) + +### Features + +* add workspace displayname ([#417](https://github.com/onecx/onecx-portal-ui-libs/issues/417)) ([8aa60a0](https://github.com/onecx/onecx-portal-ui-libs/commit/8aa60a0a94791764652b7d2b1957976e45813927)) + +### Bug Fixes + +* prevent p-menu item text from wrapping ([#415](https://github.com/onecx/onecx-portal-ui-libs/issues/415)) ([3a01639](https://github.com/onecx/onecx-portal-ui-libs/commit/3a016395e3335a9a850fcca8d197210014a883d1)) + ## [5.5.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.4.0...v5.5.0) (2024-08-20) ### Features diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index e8111735..ead1d41c 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1" diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 04d883b9..56e128ca 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 7a84676a..14064b70 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", "@angular/common": "^18.0.5", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index 684a0946..acfe1d73 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular/core": "^18.0.5", "@onecx/integration-interface": "~5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index d88fbd54..35bcefcd 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index 60f075dd..7e656d18 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular/cdk": "^18.0.5", "primeng": "^17.18.6" diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index fa4b0523..aea3325b 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/platform-browser": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 3a00d04f..0137b812 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index 3c829475..d54e6e17 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 4903db4a..5bf8ed68 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index a93e6777..f9111b34 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "tslib": "^2.6.3" }, diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index 88d4967e..49a71f85 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.5.0", + "version": "5.6.0", "peerDependencies": { "rxjs": "7.8.1", "@angular/animations": "^18.0.5", diff --git a/package.json b/package.json index 29e1b7ed..b8c3e876 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.5.0", + "version": "5.6.0", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From b61da4bf182400510200c11d22f768c8fdac5eee Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Thu, 22 Aug 2024 12:28:10 +0200 Subject: [PATCH 06/24] feat: default list view refactor, new way of templating (#400) * fix: update angular versions * feat: default listview update and new way of templating * feat: add SharedModule, refactorings listview and templates * fix: template adaptions * feat: tooltiponoverflow directive, updated listviewitem, refactored way of templating * fix: typo in defaultRelativeDateListValue * fix: lint issues * fix: tests fixed * fix: find template when using pTemplate * fix: add deprecated comments for custom templates * fix: fixed template name translationKeyCell and translationKeyTableCell * fix: edited deprecated comments --------- Co-authored-by: kim.tran Co-authored-by: Annika Nowak <139357202+anninowak@users.noreply.github.com> Co-authored-by: Annika Nowak --- libs/angular-accelerator/src/index.ts | 1 + .../lib/angular-accelerator-primeng.module.ts | 11 +- .../src/lib/angular-accelerator.module.ts | 7 +- .../data-layout-selection.component.html | 2 +- .../data-layout-selection.component.ts | 3 +- .../data-list-grid.component.html | 227 ++++++++----- .../data-list-grid.component.spec.ts | 36 +- .../data-list-grid.component.ts | 199 ++++++++++- .../data-table/data-table.component.html | 99 +----- .../data-table/data-table.component.ts | 154 ++++++++- .../data-view/data-view.component.html | 67 +++- .../data-view/data-view.component.spec.ts | 133 ++++---- .../data-view/data-view.component.ts | 177 +++++++++- .../interactive-data-view.component.html | 70 +++- .../interactive-data-view.component.spec.ts | 317 +++++++++--------- .../interactive-data-view.component.ts | 147 +++++++- .../page-header/page-header.component.html | 38 +-- .../directives/tooltipOnOverflow.directive.ts | 60 ++++ .../src/lib/model/column-type.model.ts | 6 + .../testing/data-table.harness.ts | 4 +- .../testing/data-view.harness.ts | 4 +- 21 files changed, 1311 insertions(+), 451 deletions(-) create mode 100644 libs/angular-accelerator/src/lib/directives/tooltipOnOverflow.directive.ts diff --git a/libs/angular-accelerator/src/index.ts b/libs/angular-accelerator/src/index.ts index 2482ba21..cb16dd1f 100644 --- a/libs/angular-accelerator/src/index.ts +++ b/libs/angular-accelerator/src/index.ts @@ -3,6 +3,7 @@ export * from './lib/directives/if-permission.directive' export * from './lib/directives/if-breakpoint.directive' export * from './lib/directives/src.directive' export * from './lib/directives/advanced.directive' +export * from './lib/directives/tooltipOnOverflow.directive' // components export * from './lib/components/column-group-selection/column-group-selection.component' diff --git a/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts b/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts index 600a956b..bb93c724 100644 --- a/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts +++ b/libs/angular-accelerator/src/lib/angular-accelerator-primeng.module.ts @@ -10,8 +10,9 @@ import { MenuModule } from 'primeng/menu' import { ChartModule } from 'primeng/chart' import { MultiSelectModule } from 'primeng/multiselect' import { BreadcrumbModule } from 'primeng/breadcrumb' -import { SkeletonModule } from 'primeng/skeleton'; -import { MessageModule } from 'primeng/message'; +import { SkeletonModule } from 'primeng/skeleton' +import { MessageModule } from 'primeng/message' +import { SharedModule } from 'primeng/api' @NgModule({ imports: [ @@ -27,7 +28,8 @@ import { MessageModule } from 'primeng/message'; ChartModule, MultiSelectModule, SkeletonModule, - MessageModule + MessageModule, + SharedModule, ], exports: [ BreadcrumbModule, @@ -42,7 +44,8 @@ import { MessageModule } from 'primeng/message'; ChartModule, MultiSelectModule, SkeletonModule, - MessageModule + MessageModule, + SharedModule, ], }) export class AngularAcceleratorPrimeNgModule {} diff --git a/libs/angular-accelerator/src/lib/angular-accelerator.module.ts b/libs/angular-accelerator/src/lib/angular-accelerator.module.ts index cccb15ff..5b9c93bf 100644 --- a/libs/angular-accelerator/src/lib/angular-accelerator.module.ts +++ b/libs/angular-accelerator/src/lib/angular-accelerator.module.ts @@ -29,6 +29,7 @@ import { OcxTimeAgoPipe } from './pipes/ocxtimeago.pipe' import { AppConfigService } from './services/app-config-service' import { DynamicLocaleId } from './utils/dynamic-locale-id' import { firstValueFrom, skip } from 'rxjs' +import { TooltipOnOverflowDirective } from './directives/tooltipOnOverflow.directive' export class AngularAcceleratorMissingTranslationHandler implements MissingTranslationHandler { handle(params: MissingTranslationHandlerParams) { @@ -71,8 +72,8 @@ function appInitializer(userService: UserService) { IfBreakpointDirective, SrcDirective, OcxTimeAgoPipe, - SrcDirective, AdvancedDirective, + TooltipOnOverflowDirective, ], providers: [ { @@ -88,7 +89,7 @@ function appInitializer(userService: UserService) { provide: APP_INITIALIZER, useFactory: appInitializer, deps: [UserService], - multi: true + multi: true, }, AppConfigService, ], @@ -109,8 +110,8 @@ function appInitializer(userService: UserService) { IfBreakpointDirective, SrcDirective, OcxTimeAgoPipe, - SrcDirective, AdvancedDirective, + TooltipOnOverflowDirective, ], }) export class AngularAcceleratorModule {} diff --git a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html index 271a5e42..68b23333 100644 --- a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html +++ b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.html @@ -7,7 +7,7 @@ (onChange)="onDataViewLayoutChange($event.value)" > - + diff --git a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts index c706e006..a603799e 100644 --- a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts @@ -24,7 +24,7 @@ export class DataLayoutSelectionComponent implements OnInit { @Input() supportedViewLayouts: Array = [] @Input() set layout(value: 'grid' | 'list' | 'table') { - this.selectedViewLayout = this.viewingLayouts.find((v) => v.layout === value) + this.selectedViewLayout = ALL_VIEW_LAYOUTS.find((v) => v.layout === value) } get layout(): 'grid' | 'list' | 'table' { return this.selectedViewLayout?.layout || 'table' @@ -37,7 +37,6 @@ export class DataLayoutSelectionComponent implements OnInit { ngOnInit(): void { this.viewingLayouts = ALL_VIEW_LAYOUTS.filter((vl) => this.supportedViewLayouts.includes(vl.layout)) - this.layout = 'table' } onDataViewLayoutChange(event: { icon: PrimeIcon; layout: 'grid' | 'list' | 'table' }): void { diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.html b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.html index 3576c4b9..ea7d5668 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.html +++ b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.html @@ -12,8 +12,6 @@ id="dataListGrid_{{name}}" paginatorDropdownAppendTo="body" > - -
@@ -83,99 +81,115 @@
-
-
-
- -
- - - - - - - - - - - - - - - - +
+
+ +
+ + + + + + + + + + + -
+ + + + +
-
- +
+
+ +
+
+
+
+ {{ col.nameKey | translate }} +
+
+ +
@@ -186,3 +200,38 @@ {{ resolveFieldData(item, subtitleLineId) }}
+ + + + + + + + {{ resolveFieldData(rowObject, column.id) }} + + + + {{ resolveFieldData(rowObject, column.id) | number }} + + + + + + {{ resolveFieldData(rowObject, column.id) | date: 'medium' }} + + + + + {{ 'OCX_DATA_TABLE.EDITED' | translate }} {{ resolveFieldData(rowObject, column.id) | timeago }} + + + + + {{ resolveFieldData(rowObject, column.id) | translate }} + diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.spec.ts b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.spec.ts index 133c0884..b64c38fc 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.spec.ts +++ b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.spec.ts @@ -14,6 +14,16 @@ import { DataTableHarness } from '../../../../testing/data-table.harness' import { AngularAcceleratorModule } from '../../angular-accelerator.module' describe('DataListGridComponent', () => { + const mutationObserverMock = jest.fn(function MutationObserver(callback) { + this.observe = jest.fn() + this.disconnect = jest.fn() + this.trigger = (mockedMutationsList: any) => { + callback(mockedMutationsList, this) + } + return this + }) + global.MutationObserver = mutationObserverMock + let fixture: ComponentFixture let component: DataListGridComponent let translateService: TranslateService @@ -311,7 +321,7 @@ describe('DataListGridComponent', () => { }) }) - const setUpListActionButtonMockData = () => { + const setUpListActionButtonMockData = async () => { component.columns = [ ...mockColumns, { @@ -346,6 +356,9 @@ describe('DataListGridComponent', () => { component.viewPermission = 'VIEW' component.editPermission = 'EDIT' component.deletePermission = 'DELETE' + + fixture.detectChanges() + await fixture.whenStable() } describe('Disable list action buttons based on field path', () => { it('should not disable any list action button by default', async () => { @@ -355,7 +368,7 @@ describe('DataListGridComponent', () => { expect(component.editItemObserved).toBe(false) expect(component.deleteItemObserved).toBe(false) - setUpListActionButtonMockData() + await setUpListActionButtonMockData() expect(component.viewItemObserved).toBe(true) expect(component.editItemObserved).toBe(true) @@ -380,7 +393,7 @@ describe('DataListGridComponent', () => { it('should dynamically enable/disable an action button based on the contents of a specified field', async () => { component.layout = 'list' - setUpListActionButtonMockData() + await setUpListActionButtonMockData() component.viewActionEnabledField = 'ready' let listActions = await listGrid.getActionButtons('list') @@ -418,7 +431,7 @@ describe('DataListGridComponent', () => { expect(component.editItemObserved).toBe(false) expect(component.deleteItemObserved).toBe(false) - setUpListActionButtonMockData() + await setUpListActionButtonMockData() expect(component.viewItemObserved).toBe(true) expect(component.editItemObserved).toBe(true) @@ -442,7 +455,7 @@ describe('DataListGridComponent', () => { it('should dynamically hide/show an action button based on the contents of a specified field', async () => { component.layout = 'list' - setUpListActionButtonMockData() + await setUpListActionButtonMockData() component.viewActionVisibleField = 'ready' let listActions = await listGrid.getActionButtons('list') @@ -464,7 +477,7 @@ describe('DataListGridComponent', () => { expect(listActions.length).toBe(3) }) }) - const setUpGridActionButtonMockData = () => { + const setUpGridActionButtonMockData = async () => { component.columns = [ ...mockColumns, { @@ -489,6 +502,9 @@ describe('DataListGridComponent', () => { component.viewPermission = 'VIEW' component.editPermission = 'EDIT' component.deletePermission = 'DELETE' + + fixture.detectChanges() + await fixture.whenStable() } describe('Disable grid action buttons based on field path', () => { it('should not disable any grid action button by default', async () => { @@ -497,7 +513,7 @@ describe('DataListGridComponent', () => { expect(component.editItemObserved).toBe(false) expect(component.deleteItemObserved).toBe(false) - setUpGridActionButtonMockData() + await setUpGridActionButtonMockData() expect(component.viewItemObserved).toBe(true) expect(component.editItemObserved).toBe(true) @@ -517,7 +533,7 @@ describe('DataListGridComponent', () => { it('should dynamically enable/disable an action button based on the contents of a specified field', async () => { component.layout = 'grid' - setUpGridActionButtonMockData() + await setUpGridActionButtonMockData() component.viewActionEnabledField = 'ready' const gridMenuButton = await listGrid.getMenuButton() @@ -562,7 +578,7 @@ describe('DataListGridComponent', () => { expect(component.editItemObserved).toBe(false) expect(component.deleteItemObserved).toBe(false) - setUpGridActionButtonMockData() + await setUpGridActionButtonMockData() expect(component.viewItemObserved).toBe(true) expect(component.editItemObserved).toBe(true) @@ -578,7 +594,7 @@ describe('DataListGridComponent', () => { it('should dynamically hide/show an action button based on the contents of a specified field', async () => { component.layout = 'grid' - setUpGridActionButtonMockData() + await setUpGridActionButtonMockData() component.viewActionVisibleField = 'ready' const gridMenuButton = await listGrid.getMenuButton() diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts index e21374a9..a9bd6251 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts @@ -1,6 +1,8 @@ import { + AfterContentInit, Component, ContentChild, + ContentChildren, DoCheck, EventEmitter, Inject, @@ -9,22 +11,24 @@ import { LOCALE_ID, OnInit, Output, + QueryList, TemplateRef, + ViewChildren, } from '@angular/core' import { Router } from '@angular/router' import { TranslateService } from '@ngx-translate/core' -import { MenuItem, PrimeIcons } from 'primeng/api' -import { BehaviorSubject, Observable, combineLatest, map, mergeMap } from 'rxjs' +import { AppStateService, UserService } from '@onecx/angular-integration-interface' import { MfeInfo } from '@onecx/integration-interface' -import { AppStateService } from '@onecx/angular-integration-interface' -import { UserService } from '@onecx/angular-integration-interface' +import { MenuItem, PrimeIcons, PrimeTemplate } from 'primeng/api' +import { Menu } from 'primeng/menu' +import { BehaviorSubject, Observable, combineLatest, debounceTime, map, mergeMap } from 'rxjs' +import { ColumnType } from '../../model/column-type.model' import { DataAction } from '../../model/data-action' import { DataSortDirection } from '../../model/data-sort-direction' import { DataTableColumn } from '../../model/data-table-column.model' import { ObjectUtils } from '../../utils/objectutils' import { DataSortBase } from '../data-sort-base/data-sort-base' import { Filter, Row } from '../data-table/data-table.component' -import { Menu } from 'primeng/menu' export type ListGridData = { id: string | number @@ -43,7 +47,7 @@ export interface ListGridDataMenuItem extends MenuItem { templateUrl: './data-list-grid.component.html', styleUrls: ['./data-list-grid.component.scss'], }) -export class DataListGridComponent extends DataSortBase implements OnInit, DoCheck { +export class DataListGridComponent extends DataSortBase implements OnInit, DoCheck, AfterContentInit { @Input() titleLineId: string | undefined @Input() subtitleLineIds: string[] = [] @Input() clientSideSorting = true @@ -171,6 +175,57 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe return this.gridItemTemplate || this.gridItemChildTemplate } + @Input() listValueTemplate: TemplateRef | undefined + @ContentChild('listValue') listValueChildTemplate: TemplateRef | undefined + get _listValue(): TemplateRef | undefined { + return this.listValueTemplate || this.listValueChildTemplate + } + + @Input() translationKeyListValueTemplate: TemplateRef | undefined + @ContentChild('translationKeyListValue') translationKeyListValueChildTemplate: TemplateRef | undefined + get _translationKeyListValue(): TemplateRef | undefined { + return this.translationKeyListValueTemplate || this.translationKeyListValueChildTemplate + } + + @Input() numberListValueTemplate: TemplateRef | undefined + @ContentChild('numberListValue') numberListValueChildTemplate: TemplateRef | undefined + get _numberListValue(): TemplateRef | undefined { + return this.numberListValueTemplate || this.numberListValueChildTemplate + } + + @Input() relativeDateListValueTemplate: TemplateRef | undefined + @ContentChild('relativeDateListValue') relativeDateListValueChildTemplate: TemplateRef | undefined + get _relativeDateListValue(): TemplateRef | undefined { + return this.relativeDateListValueTemplate || this.relativeDateListValueChildTemplate + } + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdListValue + * e.g. for a column with the id 'status' use pTemplate="statusIdListValue" + */ + @Input() customListValueTemplate: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdListValue + * e.g. for a column with the id 'status' use pTemplate="statusIdListValue" + */ + @ContentChild('customListValue') customListValueChildTemplate: TemplateRef | undefined + get _customListValue(): TemplateRef | undefined { + return this.customListValueTemplate || this.customListValueChildTemplate + } + + @Input() stringListValueTemplate: TemplateRef | undefined + @ContentChild('stringListValue') stringListValueChildTemplate: TemplateRef | undefined + get _stringListValue(): TemplateRef | undefined { + return this.stringListValueTemplate || this.stringListValueChildTemplate + } + + @Input() dateListValueTemplate: TemplateRef | undefined + @ContentChild('dateListValue') dateListValueChildTemplate: TemplateRef | undefined + get _dateListValue(): TemplateRef | undefined { + return this.dateListValueTemplate || this.dateListValueChildTemplate + } + inlineListActions$: Observable overflowListActions$: Observable overflowMenuItems$: Observable @@ -217,6 +272,33 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe displayedItems$: Observable | undefined fallbackImagePath$!: Observable + templates$: BehaviorSubject | undefined> = new BehaviorSubject< + QueryList | undefined + >(undefined) + @ContentChildren(PrimeTemplate) + set templates(value: QueryList | undefined) { + this.templates$.next(value) + } + + viewTemplates$: BehaviorSubject | undefined> = new BehaviorSubject< + QueryList | undefined + >(undefined) + @ViewChildren(PrimeTemplate) + set viewTemplates(value: QueryList | undefined) { + this.viewTemplates$.next(value) + } + + parentTemplates$: BehaviorSubject | null | undefined> = new BehaviorSubject< + QueryList | null | undefined + >(undefined) + @Input() + set parentTemplates(value: QueryList | null | undefined) { + this.parentTemplates$.next(value) + } + + columnType = ColumnType + templatesObservables: Record | null>> = {} + constructor( @Inject(LOCALE_ID) locale: string, translateService: TranslateService, @@ -284,6 +366,34 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe (!!this.deletePermission && this.userService.hasPermission(this.deletePermission)) } + ngAfterContentInit() { + this.templates?.forEach((item) => { + switch (item.getType()) { + case 'listValue': + this.listValueChildTemplate = item.template + break + case 'translationKeyListValue': + this.translationKeyListValueChildTemplate = item.template + break + case 'numberListValue': + this.numberListValueChildTemplate = item.template + break + case 'relativeDateListValue': + this.relativeDateListValueChildTemplate = item.template + break + case 'customListValue': + this.customListValueChildTemplate = item.template + break + case 'stringListValue': + this.stringListValueChildTemplate = item.template + break + case 'dateListValue': + this.dateListValueChildTemplate = item.template + break + } + }) + } + onDeleteRow(element: ListGridData) { this.deleteItem.emit(element) } @@ -428,4 +538,81 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe this.currentMenuRow$.next(row) menu.toggle(event) } + + getFilteredColumns() { + let ids: string[] = [...(this.subtitleLineIds ?? [])] + if (this.titleLineId) { + ids = [this.titleLineId, ...(this.subtitleLineIds ?? [])] + } + return this.columns.filter((c) => !ids.includes(c.id)) + } + + findTemplate(templates: PrimeTemplate[], names: string[]): PrimeTemplate | undefined { + for (let index = 0; index < names.length; index++) { + const name = names[index] + const template = templates.find((template) => template.name === name) + if (template) { + return template + } + } + return undefined + } + + getTemplate(column: DataTableColumn): Observable | null> { + if (!this.templatesObservables[column.id]) { + this.templatesObservables[column.id] = combineLatest([ + this.templates$, + this.viewTemplates$, + this.parentTemplates$, + ]).pipe( + map(([t, vt, pt]) => { + const templates = [...(t ?? []), ...(vt ?? []), ...(pt ?? [])] + const columnTemplate = templates.find((template) => template.name === column.id + 'IdListValue')?.template + if (columnTemplate) { + return columnTemplate + } + switch (column.columnType) { + case ColumnType.DATE: + return ( + this._dateListValue ?? + this.findTemplate(templates, ['dateListValue', 'defaultDateListValue'])?.template ?? + null + ) + case ColumnType.NUMBER: + return ( + this._numberListValue ?? + this.findTemplate(templates, ['numberListValue', 'defaultNumberListValue'])?.template ?? + null + ) + case ColumnType.RELATIVE_DATE: + return ( + this._relativeDateListValue ?? + this.findTemplate(templates, ['relativeDateListValue', 'defaultRelativeDateListValue'])?.template ?? + null + ) + case ColumnType.TRANSLATION_KEY: + return ( + this._translationKeyListValue ?? + this.findTemplate(templates, ['translationListValue', 'defaultTranslationListValue'])?.template ?? + null + ) + case ColumnType.CUSTOM: + return ( + this._customListValue ?? + this.findTemplate(templates, ['customListValue', 'defaultCustomListValue'])?.template ?? + null + ) + default: + return ( + this._stringListValue ?? + this.findTemplate(templates, ['stringListValue', 'defaultStringListValue'])?.template ?? + null + ) + } + }), + debounceTime(50) + ) + } + return this.templatesObservables[column.id] + } } diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html index f39cae63..c20b2399 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html @@ -222,100 +222,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + > - - {{ rowObject[column.id] }} + + {{ resolveFieldData(rowObject, column.id)}} - - {{ rowObject[column.id] | number }} + + {{ resolveFieldData(rowObject, column.id) | number }} - + - - {{ rowObject[column.id] | date: 'medium' }} + + {{ resolveFieldData(rowObject, column.id)| date: 'medium' }} - - {{ 'OCX_DATA_TABLE.EDITED' | translate }} {{ rowObject[column.id] | timeago }} + + + {{ 'OCX_DATA_TABLE.EDITED' | translate }} {{ resolveFieldData(rowObject, column.id) | timeago }} + - - {{ rowObject[column.id] | translate }} + + {{ resolveFieldData(rowObject, column.id) | translate }} diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts index 165aff96..f846badc 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts @@ -1,6 +1,8 @@ import { + AfterContentInit, Component, ContentChild, + ContentChildren, EventEmitter, Inject, Injector, @@ -8,21 +10,23 @@ import { LOCALE_ID, OnInit, Output, + QueryList, TemplateRef, + ViewChildren, } from '@angular/core' import { Router } from '@angular/router' import { TranslateService } from '@ngx-translate/core' +import { isValidDate } from '@onecx/accelerator' import { UserService } from '@onecx/angular-integration-interface' -import { MenuItem, SelectItem } from 'primeng/api' +import { MenuItem, PrimeTemplate, SelectItem } from 'primeng/api' import { Menu } from 'primeng/menu' -import { BehaviorSubject, Observable, combineLatest, map, mergeMap, of } from 'rxjs' +import { BehaviorSubject, Observable, combineLatest, debounceTime, map, mergeMap, of } from 'rxjs' import { ColumnType } from '../../model/column-type.model' import { DataAction } from '../../model/data-action' import { DataSortDirection } from '../../model/data-sort-direction' import { DataTableColumn } from '../../model/data-table-column.model' import { ObjectUtils } from '../../utils/objectutils' import { DataSortBase } from '../data-sort-base/data-sort-base' -import { isValidDate } from '@onecx/accelerator' type Primitive = number | string | boolean | bigint | Date export type Row = { @@ -38,7 +42,7 @@ export type Sort = { sortColumn: string; sortDirection: DataSortDirection } templateUrl: './data-table.component.html', styleUrls: ['./data-table.component.scss'], }) -export class DataTableComponent extends DataSortBase implements OnInit { +export class DataTableComponent extends DataSortBase implements OnInit, AfterContentInit { _rows$ = new BehaviorSubject([]) @Input() get rows(): Row[] { @@ -149,7 +153,17 @@ export class DataTableComponent extends DataSortBase implements OnInit { return this.numberCellTemplate || this.numberCellChildTemplate } + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdCell + * e.g. for a column with the id 'status' use pTemplate="statusIdCell" + */ @Input() customCellTemplate: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdCell + * e.g. for a column with the id 'status' use pTemplate="statusIdCell" + */ @ContentChild('customCell') customCellChildTemplate: TemplateRef | undefined get _customCell(): TemplateRef | undefined { return this.customCellTemplate || this.customCellChildTemplate @@ -210,6 +224,30 @@ export class DataTableComponent extends DataSortBase implements OnInit { overflowMenuItems$: Observable currentMenuRow$ = new BehaviorSubject(null) + templates$: BehaviorSubject | undefined> = new BehaviorSubject< + QueryList | undefined + >(undefined) + @ContentChildren(PrimeTemplate) + set templates(value: QueryList | undefined) { + this.templates$.next(value) + } + + viewTemplates$: BehaviorSubject | undefined> = new BehaviorSubject< + QueryList | undefined + >(undefined) + @ViewChildren(PrimeTemplate) + set viewTemplates(value: QueryList | undefined) { + this.viewTemplates$.next(value) + } + + parentTemplates$: BehaviorSubject | null | undefined> = new BehaviorSubject< + QueryList | null | undefined + >(undefined) + @Input() + set parentTemplates(value: QueryList | null | undefined) { + this.parentTemplates$.next(value) + } + get viewTableRowObserved(): boolean { const dv = this.injector.get('DataViewComponent', null) return dv?.viewItemObserved || dv?.viewItem.observed || this.viewTableRow.observed @@ -231,6 +269,8 @@ export class DataTableComponent extends DataSortBase implements OnInit { return dv?.selectionChangedObserved || dv?.selectionChanged.observed || this.selectionChanged.observed } + templatesObservables: Record | null>> = {} + constructor( @Inject(LOCALE_ID) locale: string, translateService: TranslateService, @@ -325,6 +365,34 @@ export class DataTableComponent extends DataSortBase implements OnInit { this.mapSelectionToRows() } + ngAfterContentInit() { + this.templates?.forEach((item) => { + switch (item.getType()) { + case 'stringCell': + this.stringCellChildTemplate = item.template + break + case 'numberCell': + this.numberCellChildTemplate = item.template + break + case 'customCell': + this.customCellChildTemplate = item.template + break + case 'dateCell': + this.dateCellChildTemplate = item.template + break + case 'relativeDateCell': + this.relativeDateCellChildTemplate = item.template + break + case 'cellTemplate': + this.cellChildTemplate = item.template + break + case 'translationKeyCell': + this.translationKeyCellChildTemplate = item.template + break + } + }) + } + onSortColumnClick(sortColumn: string) { const newSortDirection = this.columnNextSortDirection(sortColumn) @@ -448,4 +516,82 @@ export class DataTableComponent extends DataSortBase implements OnInit { const d = new Date(value) return isValidDate(d) } + + findTemplate(templates: PrimeTemplate[], names: string[]): PrimeTemplate | undefined { + for (let index = 0; index < names.length; index++) { + const name = names[index] + const template = templates.find((template) => template.name === name) + if (template) { + return template + } + } + return undefined + } + + getTemplate(column: DataTableColumn): Observable | null> { + if (!this.templatesObservables[column.id]) { + this.templatesObservables[column.id] = combineLatest([ + this.templates$, + this.viewTemplates$, + this.parentTemplates$, + ]).pipe( + map(([t, vt, pt]) => { + const templates = [...(t ?? []), ...(vt ?? []), ...(pt ?? [])] + const columnTemplate = this.findTemplate(templates, [ + column.id + 'IdCell', + column.id + 'IdTableCell', + ])?.template + if (columnTemplate) { + return columnTemplate + } + switch (column.columnType) { + case ColumnType.DATE: + return ( + this._dateCell ?? + this.findTemplate(templates, ['dateCell', 'dateTableCell', 'defaultDateCell'])?.template ?? + null + ) + case ColumnType.NUMBER: + return ( + this._numberCell ?? + this.findTemplate(templates, ['numberCell', 'numberTableCell', 'defaultNumberCell'])?.template ?? + null + ) + case ColumnType.RELATIVE_DATE: + return ( + this._relativeDateCell ?? + this.findTemplate(templates, ['relativeDateCell', 'relativeDateTableCell', 'defaultRelativeDateCell']) + ?.template ?? + null + ) + case ColumnType.TRANSLATION_KEY: + return ( + this._translationKeyCell ?? + this.findTemplate(templates, ['translationKeyCell', 'translationKeyTableCell', 'defaultTranslationKeyCell']) + ?.template ?? + null + ) + case ColumnType.CUSTOM: + return ( + this._customCell ?? + this.findTemplate(templates, ['customCell', 'customTableCell', 'defaultCustomCell'])?.template ?? + null + ) + default: + return ( + this._stringCell ?? + this.findTemplate(templates, ['stringCell', 'stringTableCell', 'defaultStringCell'])?.template ?? + null + ) + } + }), + debounceTime(50) + ) + } + return this.templatesObservables[column.id] + } + + resolveFieldData(object: any, key: any) { + return ObjectUtils.resolveFieldData(object, key) + } } diff --git a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html index cf3bf96a..4db28412 100644 --- a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html +++ b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html @@ -10,7 +10,7 @@ [sortStates]="sortStates" [clientSideFiltering]="clientSideFiltering" [clientSideSorting]="clientSideSorting" - [titleLineId]="titleLineId || firstColumnId" + [titleLineId]="titleLineId" [subtitleLineIds]="subtitleLineIds" [clientSideSorting]="true" [pageSizes]="pageSizes" @@ -33,8 +33,16 @@ [gridItemSubtitleLinesTemplate]="_gridItemSubtitleLines ? gridItemSubtitleLines : undefined" [listItemSubtitleLinesTemplate]="_listItemSubtitleLines ? listItemSubtitleLines : undefined" [listItemTemplate]="_listItem ? listItem : undefined" + [listValueTemplate]="_listValue ? listValue : undefined" + [translationKeyListValueTemplate]="_translationKeyListValue ? translationKeyListValue : undefined" + [numberListValueTemplate]="_numberListValue ? numberListValue : undefined" + [relativeDateListValueTemplate]="_relativeDateListValue ? relativeDateListValue : undefined" + [customListValueTemplate]="_customListValue ? customListValue : undefined" + [stringListValueTemplate]="_stringListValue ? stringListValue : undefined" + [dateListValueTemplate]="_dateListValue ? dateListValue : undefined" [gridItemTemplate]="_gridItem ? gridItem : undefined" [totalRecordsOnServer]="totalRecordsOnServer" + [parentTemplates]="templatesForChildren$ | async" > @@ -61,6 +69,62 @@ + + + + + + + + + + + + + + + + + + + + +
@@ -106,6 +170,7 @@ [totalRecordsOnServer]="totalRecordsOnServer" [currentPageShowingKey]="currentPageShowingKey" [currentPageShowingWithTotalOnServerKey]="currentPageShowingWithTotalOnServerKey" + [parentTemplates]="templatesForChildren$ | async" > diff --git a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.spec.ts b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.spec.ts index d64581a4..0d6fad21 100644 --- a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.spec.ts +++ b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.spec.ts @@ -18,6 +18,16 @@ import { AngularAcceleratorModule } from '../../angular-accelerator.module' import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' describe('DataViewComponent', () => { + const mutationObserverMock = jest.fn(function MutationObserver(callback) { + this.observe = jest.fn() + this.disconnect = jest.fn() + this.trigger = (mockedMutationsList: any) => { + callback(mockedMutationsList, this) + } + return this + }) + global.MutationObserver = mutationObserverMock + let component: DataViewComponent let fixture: ComponentFixture let dataViewHarness: DataViewHarness @@ -234,23 +244,23 @@ describe('DataViewComponent', () => { }) describe('Table row selection ', () => { - let dataTable: DataTableHarness + let dataTable: DataTableHarness | null beforeEach(async () => { component.layout = 'table' - dataTable = await dataViewHarness.getDataTable() + dataTable = await dataViewHarness?.getDataTable() }) it('should initially show a table without selection checkboxes', async () => { expect(dataTable).toBeTruthy() - expect(await dataTable.rowSelectionIsEnabled()).toEqual(false) + expect(await dataTable?.rowSelectionIsEnabled()).toEqual(false) }) it('should show a table with selection checkboxes if the parent binds to the event emitter', async () => { expect(dataTable).toBeTruthy() - expect(await dataTable.rowSelectionIsEnabled()).toEqual(false) + expect(await dataTable?.rowSelectionIsEnabled()).toEqual(false) component.selectionChanged.subscribe() - expect(await dataTable.rowSelectionIsEnabled()).toEqual(true) + expect(await dataTable?.rowSelectionIsEnabled()).toEqual(true) }) it('should render an unpinnend action column on the right side of the table by default', async () => { @@ -258,15 +268,15 @@ describe('DataViewComponent', () => { expect(component.frozenActionColumn).toBe(false) expect(component.actionColumnPosition).toBe('right') - expect(await dataTable.getActionColumnHeader('left')).toBe(null) - expect(await dataTable.getActionColumn('left')).toBe(null) + expect(await dataTable?.getActionColumnHeader('left')).toBe(null) + expect(await dataTable?.getActionColumn('left')).toBe(null) - const rightActionColumnHeader = await dataTable.getActionColumnHeader('right') - const rightActionColumn = await dataTable.getActionColumn('right') + const rightActionColumnHeader = await dataTable?.getActionColumnHeader('right') + const rightActionColumn = await dataTable?.getActionColumn('right') expect(rightActionColumnHeader).toBeTruthy() expect(rightActionColumn).toBeTruthy() - expect(await dataTable.columnIsFrozen(rightActionColumnHeader)).toBe(false) - expect(await dataTable.columnIsFrozen(rightActionColumn)).toBe(false) + expect(await dataTable?.columnIsFrozen(rightActionColumnHeader)).toBe(false) + expect(await dataTable?.columnIsFrozen(rightActionColumn)).toBe(false) }) it('should render an pinned action column on the specified side of the table', async () => { @@ -275,15 +285,15 @@ describe('DataViewComponent', () => { component.frozenActionColumn = true component.actionColumnPosition = 'left' - expect(await dataTable.getActionColumnHeader('right')).toBe(null) - expect(await dataTable.getActionColumn('right')).toBe(null) + expect(await dataTable?.getActionColumnHeader('right')).toBe(null) + expect(await dataTable?.getActionColumn('right')).toBe(null) - const leftActionColumnHeader = await dataTable.getActionColumnHeader('left') - const leftActionColumn = await dataTable.getActionColumn('left') + const leftActionColumnHeader = await dataTable?.getActionColumnHeader('left') + const leftActionColumn = await dataTable?.getActionColumn('left') expect(leftActionColumnHeader).toBeTruthy() expect(leftActionColumn).toBeTruthy() - expect(await dataTable.columnIsFrozen(leftActionColumnHeader)).toBe(true) - expect(await dataTable.columnIsFrozen(leftActionColumn)).toBe(true) + expect(await dataTable?.columnIsFrozen(leftActionColumnHeader)).toBe(true) + expect(await dataTable?.columnIsFrozen(leftActionColumn)).toBe(true) }) }) @@ -339,7 +349,7 @@ describe('DataViewComponent', () => { }) describe('Dynamically disable/hide based on field path in data view', () => { - const setUpMockData = (viewType: 'grid' | 'list' | 'table') => { + const setUpMockData = async (viewType: 'grid' | 'list' | 'table') => { component.viewItem.subscribe(() => console.log()) component.editItem.subscribe(() => console.log()) component.deleteItem.subscribe(() => console.log()) @@ -369,113 +379,116 @@ describe('DataViewComponent', () => { }, ] component.titleLineId = 'name' + + fixture.detectChanges() + await fixture.whenStable() } describe('Disable list action buttons based on field path', () => { it('should not disable any buttons initially', async () => { - setUpMockData('list') + await setUpMockData('list') const dataView = await dataViewHarness.getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) }) it('should disable a button based on a given field path', async () => { - setUpMockData('list') + await setUpMockData('list') component.viewActionEnabledField = 'ready' const dataView = await dataViewHarness.getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 1)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 1)).toBe(true) }) }) describe('Disable grid action buttons based on field path', () => { it('should not disable any buttons initially', async () => { - setUpMockData('grid') + await setUpMockData('grid') const dataView = await dataViewHarness.getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) }) it('should disable a button based on a given field path', async () => { - setUpMockData('grid') + await setUpMockData('grid') component.viewActionEnabledField = 'ready' const dataView = await dataViewHarness.getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 1)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 1)).toBe(true) }) }) describe('Disable table action buttons based on field path', () => { it('should not disable any buttons initially', async () => { - setUpMockData('table') + await setUpMockData('table') const dataTable = await dataViewHarness.getDataTable() - expect(await dataTable.hasAmountOfActionButtons(3)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(0)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(3)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(0)).toBe(true) }) it('should disable a button based on a given field path', async () => { - setUpMockData('table') + await setUpMockData('table') component.viewActionEnabledField = 'ready' const dataTable = await dataViewHarness.getDataTable() - expect(await dataTable.hasAmountOfActionButtons(3)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(1)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(3)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(1)).toBe(true) }) }) describe('Hide list action buttons based on field path', () => { it('should not hide any buttons initially', async () => { - setUpMockData('list') + await setUpMockData('list') const dataView = await dataViewHarness.getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) }) it('should hide a button based on a given field path', async () => { - setUpMockData('list') + await setUpMockData('list') component.viewActionVisibleField = 'ready' const dataView = await dataViewHarness.getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 2)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 2)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) }) }) describe('Hide grid action buttons based on field path', () => { it('should not hide any buttons initially', async () => { - setUpMockData('grid') + await setUpMockData('grid') const dataView = await dataViewHarness.getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 3)).toBe(true) - expect(await dataView.hasAmountOfActionButtons('grid-hidden', 0)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 3)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('grid-hidden', 0)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) }) it('should hide a button based on a given field path', async () => { - setUpMockData('grid') + await setUpMockData('grid') component.viewActionVisibleField = 'ready' const dataView = await dataViewHarness.getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 2)).toBe(true) - expect(await dataView.hasAmountOfActionButtons('grid-hidden', 1)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 2)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('grid-hidden', 1)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) }) }) describe('Hide table action buttons based on field path', () => { it('should not hide any buttons initially', async () => { - setUpMockData('table') + await setUpMockData('table') const dataTable = await dataViewHarness.getDataTable() - expect(await dataTable.hasAmountOfActionButtons(3)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(0)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(3)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(0)).toBe(true) }) it('should hide a button based on a given field path', async () => { - setUpMockData('table') + await setUpMockData('table') component.viewActionVisibleField = 'ready' const dataTable = await dataViewHarness.getDataTable() - expect(await dataTable.hasAmountOfActionButtons(2)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(0)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(2)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(0)).toBe(true) }) }) }) diff --git a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts index dd4eda5b..f24f1bf6 100644 --- a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts @@ -1,12 +1,15 @@ import { + AfterContentInit, Component, ContentChild, + ContentChildren, DoCheck, EventEmitter, Injector, Input, OnInit, Output, + QueryList, TemplateRef, ViewChild, } from '@angular/core' @@ -15,6 +18,8 @@ import { Row, Filter, Sort, DataTableComponent } from '../data-table/data-table. import { DataTableColumn } from '../../model/data-table-column.model' import { DataSortDirection } from '../../model/data-sort-direction' import { DataAction } from '../../model/data-action' +import { PrimeTemplate } from 'primeng/api' +import { BehaviorSubject, Observable, combineLatest, map } from 'rxjs' export type RowListGridData = ListGridData & Row @Component({ @@ -23,7 +28,7 @@ export type RowListGridData = ListGridData & Row styleUrls: ['./data-view.component.css'], providers: [{ provide: 'DataViewComponent', useExisting: DataViewComponent }], }) -export class DataViewComponent implements DoCheck, OnInit { +export class DataViewComponent implements DoCheck, OnInit, AfterContentInit { _dataListGridComponent: DataListGridComponent | undefined @ViewChild(DataListGridComponent) set listGrid(ref: DataListGridComponent | undefined) { this._dataListGridComponent = ref @@ -41,6 +46,7 @@ export class DataViewComponent implements DoCheck, OnInit { get dataTable(): DataTableComponent | undefined { return this._dataTableComponent } + @Input() deletePermission: string | undefined @Input() editPermission: string | undefined @Input() viewPermission: string | undefined @@ -97,8 +103,17 @@ export class DataViewComponent implements DoCheck, OnInit { get _numberTableCell(): TemplateRef | undefined { return this.numberTableCellTemplate || this.numberTableCellChildTemplate } - + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdTableCell + * e.g. for a column with the id 'status' in DataTable use pTemplate="statusIdTableCell" + */ @Input() customTableCellTemplate: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdTableCell + * e.g. for a column with the id 'status' in DataTable use pTemplate="statusIdTableCell" + */ @ContentChild('customTableCell') customTableCellChildTemplate: TemplateRef | undefined get _customTableCell(): TemplateRef | undefined { return this.customTableCellTemplate || this.customTableCellChildTemplate @@ -147,7 +162,11 @@ export class DataViewComponent implements DoCheck, OnInit { @ContentChild('tableTranslationKeyCell') tableTranslationKeyCellChildTemplate: TemplateRef | undefined @ContentChild('translationKeyTableCell') translationKeyTableCellChildTemplate: TemplateRef | undefined get _translationKeyTableCell(): TemplateRef | undefined { - return this.translationKeyTableCellTemplate || this.translationKeyTableCellChildTemplate || this.tableTranslationKeyCellChildTemplate + return ( + this.translationKeyTableCellTemplate || + this.translationKeyTableCellChildTemplate || + this.tableTranslationKeyCellChildTemplate + ) } @Input() gridItemSubtitleLinesTemplate: TemplateRef | undefined @@ -190,7 +209,57 @@ export class DataViewComponent implements DoCheck, OnInit { @ContentChild('tableRelativeDateCell') tableRelativeDateCellChildTemplate: TemplateRef | undefined @ContentChild('relativeDateTableCell') relativeDateTableCellChildTemplate: TemplateRef | undefined get _relativeDateTableCell(): TemplateRef | undefined { - return this.relativeDateTableCellTemplate || this.relativeDateTableCellChildTemplate || this.tableRelativeDateCellChildTemplate + return ( + this.relativeDateTableCellTemplate || + this.relativeDateTableCellChildTemplate || + this.tableRelativeDateCellChildTemplate + ) + } + + @Input() listValueTemplate: TemplateRef | undefined + @ContentChild('listValue') listValueChildTemplate: TemplateRef | undefined + get _listValue(): TemplateRef | undefined { + return this.listValueTemplate || this.listValueChildTemplate + } + @Input() translationKeyListValueTemplate: TemplateRef | undefined + @ContentChild('translationKeyListValue') translationKeyListValueChildTemplate: TemplateRef | undefined + get _translationKeyListValue(): TemplateRef | undefined { + return this.translationKeyListValueTemplate || this.translationKeyListValueChildTemplate + } + @Input() numberListValueTemplate: TemplateRef | undefined + @ContentChild('numberListValue') numberListValueChildTemplate: TemplateRef | undefined + get _numberListValue(): TemplateRef | undefined { + return this.numberListValueTemplate || this.numberListValueChildTemplate + } + @Input() relativeDateListValueTemplate: TemplateRef | undefined + @ContentChild('relativeDateListValue') relativeDateListValueChildTemplate: TemplateRef | undefined + get _relativeDateListValue(): TemplateRef | undefined { + return this.relativeDateListValueTemplate || this.relativeDateListValueChildTemplate + } + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdListValue + * e.g. for a column with the id 'status' in DataListGrid use pTemplate="statusIdListValue" + */ + @Input() customListValueTemplate: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdListValue + * e.g. for a column with the id 'status' DataListGrid use pTemplate="statusIdListValue" + */ + @ContentChild('customListValue') customListValueChildTemplate: TemplateRef | undefined + get _customListValue(): TemplateRef | undefined { + return this.customListValueTemplate || this.customListValueChildTemplate + } + @Input() stringListValueTemplate: TemplateRef | undefined + @ContentChild('stringListValue') stringListValueChildTemplate: TemplateRef | undefined + get _stringListValue(): TemplateRef | undefined { + return this.stringListValueTemplate || this.stringListValueChildTemplate + } + @Input() dateListValueTemplate: TemplateRef | undefined + @ContentChild('dateListValue') dateListValueChildTemplate: TemplateRef | undefined + get _dateListValue(): TemplateRef | undefined { + return this.dateListValueTemplate || this.dateListValueChildTemplate } @Input() additionalActions: DataAction[] = [] @@ -207,6 +276,33 @@ export class DataViewComponent implements DoCheck, OnInit { IsEditItemObserved: boolean | undefined firstColumnId: string | undefined + parentTemplates$: BehaviorSubject | null | undefined> = new BehaviorSubject< + QueryList | null | undefined + >(undefined) + @Input() + set parentTemplates(value: QueryList | null | undefined) { + this.parentTemplates$.next(value) + } + + templates$: BehaviorSubject | undefined> = new BehaviorSubject< + QueryList | undefined + >(undefined) + @ContentChildren(PrimeTemplate) + set templates(value: QueryList | undefined) { + this.templates$.next(value) + } + + templatesForChildren$: Observable | undefined> = combineLatest([ + this.templates$, + this.parentTemplates$, + ]).pipe( + map(([t, pt]) => { + const ql = new QueryList() + ql.reset([...(t?.toArray() ?? []), ...(pt?.toArray() ?? [])]) + return ql + }) + ) + get viewItemObserved(): boolean { return this.injector.get('InteractiveDataViewComponent', null)?.viewItem.observed || this.viewItem.observed } @@ -228,10 +324,82 @@ export class DataViewComponent implements DoCheck, OnInit { ngOnInit(): void { this.firstColumnId = this.columns[0]?.id } + + ngAfterContentInit() { + this.templates?.forEach((item) => { + switch (item.getType()) { + case 'stringTableCell': + this.stringTableCellChildTemplate = item.template + break + case 'numberTableCell': + this.numberTableCellChildTemplate = item.template + break + case 'customTableCell': + this.customTableCellChildTemplate = item.template + break + case 'tableDateCell': + this.tableDateCellChildTemplate = item.template + break + case 'dateTableCell': + this.dateTableCellChildTemplate = item.template + break + case 'tableCell': + this.tableCellChildTemplate = item.template + break + case 'tableTranslationKeyCell': + this.tableTranslationKeyCellChildTemplate = item.template + break + case 'translationKeyTableCell': + this.translationKeyTableCellChildTemplate = item.template + break + case 'gridItemSubtitleLines': + this.gridItemSubtitleLinesChildTemplate = item.template + break + case 'listItemSubtitleLines': + this.listItemSubtitleLinesChildTemplate = item.template + break + case 'gridItem': + this.gridItemChildTemplate = item.template + break + case 'listItem': + this.listItemChildTemplate = item.template + break + case 'tableRelativeDateCell': + this.tableRelativeDateCellChildTemplate = item.template + break + case 'relativeDateTableCell': + this.relativeDateTableCellChildTemplate = item.template + break + case 'listValue': + this.listValueChildTemplate = item.template + break + case 'translationKeyListValue': + this.translationKeyListValueChildTemplate = item.template + break + case 'numberListValue': + this.numberListValueChildTemplate = item.template + break + case 'relativeDateListValue': + this.relativeDateListValueChildTemplate = item.template + break + case 'customListValue': + this.customListValueChildTemplate = item.template + break + case 'stringListValue': + this.stringListValueChildTemplate = item.template + break + case 'dateListValue': + this.dateListValueChildTemplate = item.template + break + } + }) + } + ngDoCheck(): void { this.registerEventListenerForDataTable() this.registerEventListenerForListGrid() } + registerEventListenerForListGrid() { if (this.layout !== 'table') { if (this.deleteItem.observed) { @@ -260,6 +428,7 @@ export class DataViewComponent implements DoCheck, OnInit { } } } + registerEventListenerForDataTable() { if (this.layout === 'table') { if (this.deleteItem.observed) { diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html index e46079c1..515e13c0 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html @@ -50,7 +50,7 @@ [filters]="filters" [data]="data" [sortDirection]="sortDirection" - [titleLineId]="titleLineId || firstColumnId" + [titleLineId]="titleLineId" [subtitleLineIds]="subtitleLineIds" [clientSideSorting]="clientSideSorting" [clientSideFiltering]="clientSideFiltering" @@ -85,13 +85,21 @@ [translationKeyTableCellTemplate]="_translationKeyTableCell ? translationKeyTableCell : _tableTranslationKeyCell ? tableTranslationKeyCell : undefined" [gridItemSubtitleLinesTemplate]="_gridItemSubtitleLines ? gridItemSubtitleLines : undefined" [listItemSubtitleLinesTemplate]="_listItemSubtitleLines ? listItemSubtitleLines : undefined" - [listItemTemplate]="_listItem? listItem : undefined" - [gridItemTemplate]="_gridItem? gridItem : undefined" + [listItemTemplate]="_listItem ? listItem : undefined" + [listValueTemplate]="_listValue ? listValue : undefined" + [translationKeyListValueTemplate]="_translationKeyListValue ? translationKeyListValue : undefined" + [numberListValueTemplate]="_numberListValue ? numberListValue : undefined" + [relativeDateListValueTemplate]="_relativeDateListValue ? relativeDateListValue : undefined" + [customListValueTemplate]="_customListValue ? customListValue : undefined" + [stringListValueTemplate]="_stringListValue ? stringListValue : undefined" + [dateListValueTemplate]="_dateListValue ? dateListValue : undefined" + [gridItemTemplate]="_gridItem ? gridItem : undefined" (sorted)="sorting($event)" (filtered)="filtering($event)" [totalRecordsOnServer]="totalRecordsOnServer" [currentPageShowingKey]="currentPageShowingKey" [currentPageShowingWithTotalOnServerKey]="currentPageShowingWithTotalOnServerKey" + [parentTemplates]="templates$ | async" >
@@ -183,3 +191,59 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts index 98e76788..aec3b3d2 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.spec.ts @@ -43,6 +43,16 @@ import { DateUtils } from '../../utils/dateutils' import { provideRouter } from '@angular/router' describe('InteractiveDataViewComponent', () => { + const mutationObserverMock = jest.fn(function MutationObserver(callback) { + this.observe = jest.fn() + this.disconnect = jest.fn() + this.trigger = (mockedMutationsList: any) => { + callback(mockedMutationsList, this) + } + return this + }) + global.MutationObserver = mutationObserverMock + let component: InteractiveDataViewComponent let fixture: ComponentFixture let loader: HarnessLoader @@ -249,6 +259,7 @@ describe('InteractiveDataViewComponent', () => { component.viewItem.subscribe((event) => (viewItemEvent = event)) component.editItem.subscribe((event) => (editItemEvent = event)) component.deleteItem.subscribe((event) => (deleteItemEvent = event)) + component.titleLineId = 'name' component.subtitleLineIds = ['startDate'] component.data = mockData component.columns = mockColumns @@ -312,7 +323,7 @@ describe('InteractiveDataViewComponent', () => { describe('Table view ', () => { let dataLayoutSelection: DataLayoutSelectionHarness let dataView: DataViewHarness - let dataTable: DataTableHarness + let dataTable: DataTableHarness | null let tableHeaders: TableHeaderColumnHarness[] let tableRows: TableRowHarness[] let allFilterOptions: PMultiSelectListItemHarness[] | undefined @@ -320,9 +331,9 @@ describe('InteractiveDataViewComponent', () => { beforeEach(async () => { dataLayoutSelection = await loader.getHarness(DataLayoutSelectionHarness) dataView = await loader.getHarness(DataViewHarness) - dataTable = await dataView.getDataTable() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + dataTable = await dataView?.getDataTable() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] allFilterOptions = undefined }) @@ -365,7 +376,7 @@ describe('InteractiveDataViewComponent', () => { const sortButton = await tableHeaders[0].getSortButton() await sortButton.click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsDataAfterSorting) @@ -382,7 +393,7 @@ describe('InteractiveDataViewComponent', () => { const sortButton = await tableHeaders[2].getSortButton() await sortButton.click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsDataAfterSorting) @@ -400,7 +411,7 @@ describe('InteractiveDataViewComponent', () => { await sortButton.click() await sortButton.click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsDataAfterSorting) @@ -418,7 +429,7 @@ describe('InteractiveDataViewComponent', () => { await sortButton.click() await sortButton.click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsDataAfterSorting) @@ -453,7 +464,7 @@ describe('InteractiveDataViewComponent', () => { allFilterOptions = await filterMultiSelect.getAllOptions() await allFilterOptions[1].click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsDataAfterFilter) @@ -475,7 +486,7 @@ describe('InteractiveDataViewComponent', () => { expect(await filterMultiSelect.getSelectedOptions()).toEqual(expectedSelectedOptions) - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsDataAfterFilter) @@ -497,7 +508,7 @@ describe('InteractiveDataViewComponent', () => { expect(await filterMultiSelect.getSelectedOptions()).toEqual(expectedSelectedOption) - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsDataAfterFilter) @@ -611,8 +622,8 @@ describe('InteractiveDataViewComponent', () => { const dropdownItems = await columnGroupSelectionDropdown.getDropdownItems() await dropdownItems[1].selectItem() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] const headers = await parallel(() => tableHeaders.map((header) => header.getText())) const rows = await parallel(() => tableRows.map((row) => row.getData())) @@ -676,11 +687,11 @@ describe('InteractiveDataViewComponent', () => { const dropdownItems = await columnGroupSelectionDropdown.getDropdownItems() await dropdownItems[1].selectItem() - tableHeaders = await dataTable.getHeaderColumns() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] const sortButton = await tableHeaders[6].getSortButton() await sortButton.click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsData) @@ -742,12 +753,12 @@ describe('InteractiveDataViewComponent', () => { const dropdownItems = await columnGroupSelectionDropdown.getDropdownItems() await dropdownItems[1].selectItem() - tableHeaders = await dataTable.getHeaderColumns() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] const sortButton = await tableHeaders[6].getSortButton() await sortButton.click() await sortButton.click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsData) @@ -809,13 +820,13 @@ describe('InteractiveDataViewComponent', () => { const dropdownItems = await columnGroupSelectionDropdown.getDropdownItems() await dropdownItems[1].selectItem() - tableHeaders = await dataTable.getHeaderColumns() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] const sortButton = await tableHeaders[6].getSortButton() await sortButton.click() await sortButton.click() await sortButton.click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedRowsData) @@ -826,15 +837,15 @@ describe('InteractiveDataViewComponent', () => { expect(component.frozenActionColumn).toBe(false) expect(component.actionColumnPosition).toBe('right') - expect(await dataTable.getActionColumnHeader('left')).toBe(null) - expect(await dataTable.getActionColumn('left')).toBe(null) + expect(await dataTable?.getActionColumnHeader('left')).toBe(null) + expect(await dataTable?.getActionColumn('left')).toBe(null) - const rightActionColumnHeader = await dataTable.getActionColumnHeader('right') - const rightActionColumn = await dataTable.getActionColumn('right') + const rightActionColumnHeader = await dataTable?.getActionColumnHeader('right') + const rightActionColumn = await dataTable?.getActionColumn('right') expect(rightActionColumnHeader).toBeTruthy() expect(rightActionColumn).toBeTruthy() - expect(await dataTable.columnIsFrozen(rightActionColumnHeader)).toBe(false) - expect(await dataTable.columnIsFrozen(rightActionColumn)).toBe(false) + expect(await dataTable?.columnIsFrozen(rightActionColumnHeader)).toBe(false) + expect(await dataTable?.columnIsFrozen(rightActionColumn)).toBe(false) }) it('should render an pinned action column on the specified side of the table', async () => { @@ -843,50 +854,50 @@ describe('InteractiveDataViewComponent', () => { component.frozenActionColumn = true component.actionColumnPosition = 'left' - expect(await dataTable.getActionColumnHeader('right')).toBe(null) - expect(await dataTable.getActionColumn('right')).toBe(null) + expect(await dataTable?.getActionColumnHeader('right')).toBe(null) + expect(await dataTable?.getActionColumn('right')).toBe(null) - const leftActionColumnHeader = await dataTable.getActionColumnHeader('left') - const leftActionColumn = await dataTable.getActionColumn('left') + const leftActionColumnHeader = await dataTable?.getActionColumnHeader('left') + const leftActionColumn = await dataTable?.getActionColumn('left') expect(leftActionColumnHeader).toBeTruthy() expect(leftActionColumn).toBeTruthy() - expect(await dataTable.columnIsFrozen(leftActionColumnHeader)).toBe(true) - expect(await dataTable.columnIsFrozen(leftActionColumn)).toBe(true) + expect(await dataTable?.columnIsFrozen(leftActionColumnHeader)).toBe(true) + expect(await dataTable?.columnIsFrozen(leftActionColumn)).toBe(true) }) }) describe('Table row selection ', () => { let dataLayoutSelection: DataLayoutSelectionHarness let dataView: DataViewHarness - let dataTable: DataTableHarness + let dataTable: DataTableHarness | null beforeEach(async () => { dataLayoutSelection = await loader.getHarness(DataLayoutSelectionHarness) dataView = await interactiveDataViewHarness.getDataView() - dataTable = await dataView.getDataTable() + dataTable = await dataView?.getDataTable() }) it('should initially show a table without selection checkboxes', async () => { expect(dataTable).toBeTruthy() expect(await dataLayoutSelection.getCurrentLayout()).toEqual('table') - expect(await dataTable.rowSelectionIsEnabled()).toEqual(false) + expect(await dataTable?.rowSelectionIsEnabled()).toEqual(false) }) it('should show a table with selection checkboxes if the parent binds to the event emitter', async () => { expect(dataTable).toBeTruthy() expect(await dataLayoutSelection.getCurrentLayout()).toEqual('table') - expect(await dataTable.rowSelectionIsEnabled()).toEqual(false) + expect(await dataTable?.rowSelectionIsEnabled()).toEqual(false) component.selectionChanged.subscribe() - expect(await dataTable.rowSelectionIsEnabled()).toEqual(true) + expect(await dataTable?.rowSelectionIsEnabled()).toEqual(true) component.selectionChanged.unsubscribe() }) }) describe('Table view custom group column selector ', () => { let dataView: DataViewHarness - let dataTable: DataTableHarness + let dataTable: DataTableHarness | null let tableHeaders: TableHeaderColumnHarness[] let tableRows: TableRowHarness[] @@ -902,9 +913,9 @@ describe('InteractiveDataViewComponent', () => { beforeEach(async () => { dataView = await loader.getHarness(DataViewHarness) - dataTable = await dataView.getDataTable() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + dataTable = await dataView?.getDataTable() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] customGroupColumnSelector = await loader.getHarness(CustomGroupColumnSelectorHarness) await customGroupColumnSelector.openCustomGroupColumnSelectorDialog() @@ -940,8 +951,8 @@ describe('InteractiveDataViewComponent', () => { await dialogSaveButton.click() expect(spy).toHaveBeenCalled() dataTable = await dataView.getDataTable() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] const headers = await parallel(() => tableHeaders.map((header) => header.getText())) const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(headers).toEqual(expectedHeaders) @@ -972,8 +983,8 @@ describe('InteractiveDataViewComponent', () => { expect(spy).toHaveBeenCalled() dataTable = await dataView.getDataTable() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] const headers = await parallel(() => tableHeaders.map((header) => header.getText())) const rows = await parallel(() => tableRows.map((row) => row.getData())) @@ -1004,8 +1015,8 @@ describe('InteractiveDataViewComponent', () => { expect(spy).toHaveBeenCalled() dataTable = await dataView.getDataTable() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] const headers = await parallel(() => tableHeaders.map((header) => header.getText())) const rows = await parallel(() => tableRows.map((row) => row.getData())) @@ -1037,8 +1048,8 @@ describe('InteractiveDataViewComponent', () => { expect(spy).toHaveBeenCalled() dataTable = await dataView.getDataTable() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] const headers = await parallel(() => tableHeaders.map((header) => header.getText())) const rows = await parallel(() => tableRows.map((row) => row.getData())) @@ -1057,15 +1068,15 @@ describe('InteractiveDataViewComponent', () => { expect(component.actionColumnPosition).toBe('left') - expect(await dataTable.getActionColumnHeader('right')).toBe(null) - expect(await dataTable.getActionColumn('right')).toBe(null) + expect(await dataTable?.getActionColumnHeader('right')).toBe(null) + expect(await dataTable?.getActionColumn('right')).toBe(null) - const leftActionColumnHeader = await dataTable.getActionColumnHeader('left') - const leftActionColumn = await dataTable.getActionColumn('left') + const leftActionColumnHeader = await dataTable?.getActionColumnHeader('left') + const leftActionColumn = await dataTable?.getActionColumn('left') expect(leftActionColumnHeader).toBeTruthy() expect(leftActionColumn).toBeTruthy() - expect(await dataTable.columnIsFrozen(leftActionColumnHeader)).toBe(false) - expect(await dataTable.columnIsFrozen(leftActionColumn)).toBe(false) + expect(await dataTable?.columnIsFrozen(leftActionColumnHeader)).toBe(false) + expect(await dataTable?.columnIsFrozen(leftActionColumn)).toBe(false) }) it('should allow users to freeze action column', async () => { @@ -1079,22 +1090,22 @@ describe('InteractiveDataViewComponent', () => { expect(component.frozenActionColumn).toBe(true) - expect(await dataTable.getActionColumnHeader('left')).toBe(null) - expect(await dataTable.getActionColumn('left')).toBe(null) + expect(await dataTable?.getActionColumnHeader('left')).toBe(null) + expect(await dataTable?.getActionColumn('left')).toBe(null) - const rightActionColumnHeader = await dataTable.getActionColumnHeader('right') - const rightActionColumn = await dataTable.getActionColumn('right') + const rightActionColumnHeader = await dataTable?.getActionColumnHeader('right') + const rightActionColumn = await dataTable?.getActionColumn('right') expect(rightActionColumnHeader).toBeTruthy() expect(rightActionColumn).toBeTruthy() - expect(await dataTable.columnIsFrozen(rightActionColumnHeader)).toBe(true) - expect(await dataTable.columnIsFrozen(rightActionColumn)).toBe(true) + expect(await dataTable?.columnIsFrozen(rightActionColumnHeader)).toBe(true) + expect(await dataTable?.columnIsFrozen(rightActionColumn)).toBe(true) }) }) describe('Grid view ', () => { let dataLayoutSelection: DataLayoutSelectionHarness let dataView: DataViewHarness - let dataGrid: DataListGridHarness + let dataGrid: DataListGridHarness | null let gridItems: DefaultGridItemHarness[] let sortingDropdown: PDropdownHarness @@ -1103,12 +1114,12 @@ describe('InteractiveDataViewComponent', () => { beforeEach(async () => { dataLayoutSelection = await loader.getHarness(DataLayoutSelectionHarness) - + const gridLayoutSelectionButton = await dataLayoutSelection.getGridLayoutSelectionButton() await gridLayoutSelectionButton?.click() dataView = await loader.getHarness(DataViewHarness) - dataGrid = await dataView.getDataListGrid() + dataGrid = await dataView?.getDataListGrid() sortingDropdown = await loader.getHarness(PDropdownHarness.with({ id: 'dataListGridSortingDropdown' })) sortingDropdownItems = await sortingDropdown.getDropdownItems() dataListGridSortingButton = await loader.getHarness(PButtonHarness.with({ id: 'dataListGridSortingButton' })) @@ -1127,7 +1138,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get grid data', async () => { - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemsData = await parallel(() => gridItems.map((item) => item.getData())) expect(gridItemsData).toEqual(expectedInitialGridItemsData) @@ -1145,7 +1156,7 @@ describe('InteractiveDataViewComponent', () => { await sortingDropdownItems[0].selectItem() await dataListGridSortingButton.click() - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemsData = await parallel(() => gridItems.map((item) => item.getData())) expect(gridItemsData).toEqual(expectedGridItemsDataAfterSorting) @@ -1164,7 +1175,7 @@ describe('InteractiveDataViewComponent', () => { await dataListGridSortingButton.click() await dataListGridSortingButton.click() - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemsData = await parallel(() => gridItems.map((item) => item.getData())) expect(gridItemsData).toEqual(expectedGridItemsDataAfterSorting) @@ -1176,14 +1187,14 @@ describe('InteractiveDataViewComponent', () => { await dataListGridSortingButton.click() await dataListGridSortingButton.click() - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemsData = await parallel(() => gridItems.map((item) => item.getData())) expect(gridItemsData).toEqual(expectedInitialGridItemsData) }) it('should get view actions menu button of first grid item and get event viewItem with first data grid item when clicked', async () => { - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemMoreActionsMenu = await gridItems[0].getMoreActionsButton() const moreActionsMenuItems = await gridItemMoreActionsMenu.getAllActionsMenuItems() await moreActionsMenuItems[0].selectItem() @@ -1192,7 +1203,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get view actions menu button of third grid item and get event viewItem with third data grid item when clicked', async () => { - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemMoreActionsMenu = await gridItems[2].getMoreActionsButton() const moreActionsMenuItems = await gridItemMoreActionsMenu.getAllActionsMenuItems() await moreActionsMenuItems[0].selectItem() @@ -1201,7 +1212,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get edit actions menu button first grid item and get event editItem with first data grid item when clicked', async () => { - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemMoreActionsMenu = await gridItems[0].getMoreActionsButton() const moreActionsMenuItems = await gridItemMoreActionsMenu.getAllActionsMenuItems() await moreActionsMenuItems[1].selectItem() @@ -1210,7 +1221,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get edit actions menu button third grid item and get event editItem with third data grid item when clicked', async () => { - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemMoreActionsMenu = await gridItems[2].getMoreActionsButton() const moreActionsMenuItems = await gridItemMoreActionsMenu.getAllActionsMenuItems() await moreActionsMenuItems[1].selectItem() @@ -1219,7 +1230,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get delete actions menu button first grid item and get event deleteItem with first data grid item when clicked', async () => { - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemMoreActionsMenu = await gridItems[0].getMoreActionsButton() const moreActionsMenuItems = await gridItemMoreActionsMenu.getAllActionsMenuItems() await moreActionsMenuItems[2].selectItem() @@ -1228,7 +1239,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get delete actions menu button third grid item and get event deleteItem with third data grid item when clicked', async () => { - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemMoreActionsMenu = await gridItems[2].getMoreActionsButton() const moreActionsMenuItems = await gridItemMoreActionsMenu.getAllActionsMenuItems() await moreActionsMenuItems[2].selectItem() @@ -1240,7 +1251,7 @@ describe('InteractiveDataViewComponent', () => { describe('List view ', () => { let dataLayoutSelection: DataLayoutSelectionHarness let dataView: DataViewHarness - let dataList: DataListGridHarness + let dataList: DataListGridHarness | null let listItems: DefaultListItemHarness[] let sortingDropdown: PDropdownHarness @@ -1252,8 +1263,11 @@ describe('InteractiveDataViewComponent', () => { const listLayoutSelectionButton = await dataLayoutSelection.getListLayoutSelectionButton() await listLayoutSelectionButton?.click() + fixture.detectChanges() + await fixture.whenStable() + dataView = await loader.getHarness(DataViewHarness) - dataList = await dataView.getDataListGrid() + dataList = await dataView?.getDataListGrid() sortingDropdown = await loader.getHarness(PDropdownHarness.with({ id: 'dataListGridSortingDropdown' })) sortingDropdownItems = await sortingDropdown.getDropdownItems() dataListGridSortingButton = await loader.getHarness(PButtonHarness.with({ id: 'dataListGridSortingButton' })) @@ -1272,7 +1286,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get list data', async () => { - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedInitialListItemsData) @@ -1290,7 +1304,7 @@ describe('InteractiveDataViewComponent', () => { await sortingDropdownItems[0].selectItem() await dataListGridSortingButton.click() - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedListItemsDataAfterSorting) @@ -1309,7 +1323,7 @@ describe('InteractiveDataViewComponent', () => { await dataListGridSortingButton.click() await dataListGridSortingButton.click() - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedListItemsDataAfterSorting) @@ -1321,14 +1335,14 @@ describe('InteractiveDataViewComponent', () => { await dataListGridSortingButton.click() await dataListGridSortingButton.click() - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedInitialListItemsData) }) it('should get list item view button of first list item and get event viewItem with first data list item when clicked', async () => { - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const viewButton = await listItems[0].getViewButton() await viewButton?.click() @@ -1336,7 +1350,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get list item view button of third list item and get event viewItem with third data list item when clicked', async () => { - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const viewButton = await listItems[2].getViewButton() await viewButton?.click() @@ -1344,7 +1358,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get list item view button of first list item and get event editItem with first data list item when clicked', async () => { - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const editButton = await listItems[0].getEditButton() await editButton?.click() @@ -1352,7 +1366,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get list item view button of third list item and get event editItem with third data list item when clicked', async () => { - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const editButton = await listItems[2].getEditButton() await editButton?.click() @@ -1360,7 +1374,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get list item view button of first list item and get event deleteItem with first data list item when clicked', async () => { - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const deleteButton = await listItems[0].getDeleteButton() await deleteButton?.click() @@ -1368,7 +1382,7 @@ describe('InteractiveDataViewComponent', () => { }) it('should get list item view button of third list item and get event deleteItem with third data list item when clicked', async () => { - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const deleteButton = await listItems[2].getDeleteButton() await deleteButton?.click() @@ -1380,16 +1394,16 @@ describe('InteractiveDataViewComponent', () => { let dataLayoutSelection: DataLayoutSelectionHarness let dataView: DataViewHarness - let dataTable: DataTableHarness + let dataTable: DataTableHarness | null let tableHeaders: TableHeaderColumnHarness[] let tableRows: TableRowHarness[] let allFilterOptions: PMultiSelectListItemHarness[] | undefined - let dataList: DataListGridHarness + let dataList: DataListGridHarness | null let listItems: DefaultListItemHarness[] let listLayoutSelectionButton: TestElement | null - let dataGrid: DataListGridHarness + let dataGrid: DataListGridHarness | null let gridItems: DefaultGridItemHarness[] let gridLayoutSelectionButton: TestElement | null @@ -1402,8 +1416,8 @@ describe('InteractiveDataViewComponent', () => { dataView = await loader.getHarness(DataViewHarness) dataTable = await dataView.getDataTable() - tableHeaders = await dataTable.getHeaderColumns() - tableRows = await dataTable.getRows() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + tableRows = (await dataTable?.getRows()) ?? [] allFilterOptions = undefined }) @@ -1444,14 +1458,14 @@ describe('InteractiveDataViewComponent', () => { const dropdownItems = await columnGroupSelectionDropdown.getDropdownItems() await dropdownItems[1].selectItem() - tableHeaders = await dataTable.getHeaderColumns() - const sortButton = await tableHeaders[6].getSortButton() - await sortButton.click() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + const sortButton = await tableHeaders?.[6].getSortButton() + await sortButton?.click() await gridLayoutSelectionButton?.click() dataGrid = await dataView.getDataListGrid() - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemsData = await parallel(() => gridItems.map((item) => item.getData())) expect(gridItemsData).toEqual(expectedSortedGridItemsDataAscending) @@ -1459,7 +1473,7 @@ describe('InteractiveDataViewComponent', () => { await listLayoutSelectionButton?.click() dataList = await dataView.getDataListGrid() - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedSortedListItemsDataAscending) @@ -1473,14 +1487,14 @@ describe('InteractiveDataViewComponent', () => { const dropdownItems = await columnGroupSelectionDropdown.getDropdownItems() await dropdownItems[1].selectItem() - tableHeaders = await dataTable.getHeaderColumns() - const sortButton = await tableHeaders[6].getSortButton() - await sortButton.click() + tableHeaders = (await dataTable?.getHeaderColumns()) ?? [] + const sortButton = await tableHeaders?.[6].getSortButton() + await sortButton?.click() await listLayoutSelectionButton?.click() dataList = await dataView.getDataListGrid() - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] let listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedSortedListItemsDataAscending) @@ -1493,7 +1507,7 @@ describe('InteractiveDataViewComponent', () => { expect(await (await sortingDropdown.host()).text()).toEqual('COLUMN_HEADER_NAME.TEST_NUMBER') await dataListGridSortingButton.click() - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedSortedListItemsDataDescending) @@ -1501,7 +1515,7 @@ describe('InteractiveDataViewComponent', () => { await gridLayoutSelectionButton?.click() dataGrid = await dataView.getDataListGrid() - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemsData = await parallel(() => gridItems.map((item) => item.getData())) expect(gridItemsData).toEqual(expectedSortedGridItemsDataDescending) @@ -1513,12 +1527,12 @@ describe('InteractiveDataViewComponent', () => { const expectedFilteredGridItemsData = [ ['./onecx-portal-lib/assets/images/placeholder.png', 'name 1', '2023-09-14T09:34:22Z', '123456789'], ] - const filterMultiSelect = await tableHeaders[0].getFilterMultiSelect() + const filterMultiSelect = await tableHeaders?.[0].getFilterMultiSelect() - allFilterOptions = await filterMultiSelect.getAllOptions() - await allFilterOptions[2].click() + allFilterOptions = await filterMultiSelect?.getAllOptions() + await allFilterOptions?.[2].click() - tableRows = await dataTable.getRows() + tableRows = (await dataTable?.getRows()) ?? [] const rows = await parallel(() => tableRows.map((row) => row.getData())) expect(rows).toEqual(expectedFilteredRowsData) @@ -1526,7 +1540,7 @@ describe('InteractiveDataViewComponent', () => { await gridLayoutSelectionButton?.click() dataGrid = await dataView.getDataListGrid() - gridItems = await dataGrid.getDefaultGridItems() + gridItems = (await dataGrid?.getDefaultGridItems()) ?? [] const gridItemsData = await parallel(() => gridItems.map((item) => item.getData())) expect(gridItemsData).toEqual(expectedFilteredGridItemsData) @@ -1534,14 +1548,14 @@ describe('InteractiveDataViewComponent', () => { await listLayoutSelectionButton?.click() dataList = await dataView.getDataListGrid() - listItems = await dataList.getDefaultListItems() + listItems = (await dataList?.getDefaultListItems()) ?? [] const listItemsData = await parallel(() => listItems.map((item) => item.getData())) expect(listItemsData).toEqual(expectedFilteredListItemsData) }) }) describe('Dynamically disable/hide based on field path in interactive data view', () => { - const setUpMockData = (viewType: 'grid' | 'list' | 'table') => { + const setUpMockData = async (viewType: 'grid' | 'list' | 'table') => { component.viewItem.subscribe(() => console.log()) component.editItem.subscribe(() => console.log()) component.deleteItem.subscribe(() => console.log()) @@ -1571,113 +1585,116 @@ describe('InteractiveDataViewComponent', () => { }, ] component.titleLineId = 'name' + + fixture.detectChanges() + await fixture.whenStable() } describe('Disable list action buttons based on field path', () => { it('should not disable any buttons initially', async () => { - setUpMockData('list') + await setUpMockData('list') const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) }) it('should disable a button based on a given field path', async () => { - setUpMockData('list') + await setUpMockData('list') component.viewActionEnabledField = 'ready' const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 1)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 1)).toBe(true) }) }) describe('Disable grid action buttons based on field path', () => { it('should not disable any buttons initially', async () => { - setUpMockData('grid') + await setUpMockData('grid') const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) }) it('should disable a button based on a given field path', async () => { - setUpMockData('grid') + await setUpMockData('grid') component.viewActionEnabledField = 'ready' const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 1)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 1)).toBe(true) }) }) describe('Disable table action buttons based on field path', () => { it('should not disable any buttons initially', async () => { - setUpMockData('table') + await setUpMockData('table') const dataTable = await (await interactiveDataViewHarness.getDataView()).getDataTable() - expect(await dataTable.hasAmountOfActionButtons(3)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(0)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(3)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(0)).toBe(true) }) it('should disable a button based on a given field path', async () => { - setUpMockData('table') + await setUpMockData('table') component.viewActionEnabledField = 'ready' const dataTable = await (await interactiveDataViewHarness.getDataView()).getDataTable() - expect(await dataTable.hasAmountOfActionButtons(3)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(1)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(3)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(1)).toBe(true) }) }) describe('Hide list action buttons based on field path', () => { it('should not hide any buttons initially', async () => { - setUpMockData('list') + await setUpMockData('list') const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 3)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 3)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) }) it('should hide a button based on a given field path', async () => { - setUpMockData('list') + await setUpMockData('list') component.viewActionVisibleField = 'ready' const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - expect(await dataView.hasAmountOfActionButtons('list', 2)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('list', 2)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('list', 0)).toBe(true) }) }) describe('Hide grid action buttons based on field path', () => { it('should not hide any buttons initially', async () => { - setUpMockData('grid') + await setUpMockData('grid') const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 3)).toBe(true) - expect(await dataView.hasAmountOfActionButtons('grid-hidden', 0)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 3)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('grid-hidden', 0)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) }) it('should hide a button based on a given field path', async () => { - setUpMockData('grid') + await setUpMockData('grid') component.viewActionVisibleField = 'ready' const dataView = await (await interactiveDataViewHarness.getDataView()).getDataListGrid() - await (await dataView.getMenuButton()).click() - expect(await dataView.hasAmountOfActionButtons('grid', 2)).toBe(true) - expect(await dataView.hasAmountOfActionButtons('grid-hidden', 1)).toBe(true) - expect(await dataView.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) + await (await dataView?.getMenuButton())?.click() + expect(await dataView?.hasAmountOfActionButtons('grid', 2)).toBe(true) + expect(await dataView?.hasAmountOfActionButtons('grid-hidden', 1)).toBe(true) + expect(await dataView?.hasAmountOfDisabledActionButtons('grid', 0)).toBe(true) }) }) describe('Hide table action buttons based on field path', () => { it('should not hide any buttons initially', async () => { - setUpMockData('table') + await setUpMockData('table') const dataTable = await (await interactiveDataViewHarness.getDataView()).getDataTable() - expect(await dataTable.hasAmountOfActionButtons(3)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(0)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(3)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(0)).toBe(true) }) it('should hide a button based on a given field path', async () => { - setUpMockData('table') + await setUpMockData('table') component.viewActionVisibleField = 'ready' const dataTable = await (await interactiveDataViewHarness.getDataView()).getDataTable() - expect(await dataTable.hasAmountOfActionButtons(2)).toBe(true) - expect(await dataTable.hasAmountOfDisabledActionButtons(0)).toBe(true) + expect(await dataTable?.hasAmountOfActionButtons(2)).toBe(true) + expect(await dataTable?.hasAmountOfDisabledActionButtons(0)).toBe(true) }) }) }) diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts index bd6a8fe8..f111309c 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts @@ -1,14 +1,28 @@ -import { Component, ContentChild, EventEmitter, Input, OnInit, Output, TemplateRef, ViewChild } from '@angular/core' -import { DataTableColumn } from '../../model/data-table-column.model' +import { + AfterContentInit, + Component, + ContentChild, + ContentChildren, + EventEmitter, + Input, + OnInit, + Output, + QueryList, + TemplateRef, + ViewChild, +} from '@angular/core' +import { PrimeTemplate } from 'primeng/api' +import { DataAction } from '../../model/data-action' import { DataSortDirection } from '../../model/data-sort-direction' -import { Filter, Row, Sort } from '../data-table/data-table.component' -import { DataViewComponent, RowListGridData } from '../data-view/data-view.component' +import { DataTableColumn } from '../../model/data-table-column.model' import { GroupSelectionChangedEvent } from '../column-group-selection/column-group-selection.component' import { ActionColumnChangedEvent, ColumnSelectionChangedEvent, } from '../custom-group-column-selector/custom-group-column-selector.component' -import { DataAction } from '../../model/data-action' +import { Filter, Row, Sort } from '../data-table/data-table.component' +import { DataViewComponent, RowListGridData } from '../data-view/data-view.component' +import { BehaviorSubject } from 'rxjs' @Component({ selector: 'ocx-interactive-data-view', @@ -16,7 +30,7 @@ import { DataAction } from '../../model/data-action' styleUrls: ['./interactive-data-view.component.css'], providers: [{ provide: 'InteractiveDataViewComponent', useExisting: InteractiveDataViewComponent }], }) -export class InteractiveDataViewComponent implements OnInit { +export class InteractiveDataViewComponent implements OnInit, AfterContentInit { _dataViewComponent: DataViewComponent | undefined @ViewChild(DataViewComponent) set dataView(ref: DataViewComponent | undefined) { this._dataViewComponent = ref @@ -53,7 +67,7 @@ export class InteractiveDataViewComponent implements OnInit { DataSortDirection.NONE, ] @Input() pageSizes: number[] = [10, 25, 50] - @Input() pageSize: number | undefined; + @Input() pageSize: number | undefined @Input() totalRecordsOnServer: number | undefined @Input() layout: 'grid' | 'list' | 'table' = 'table' @Input() defaultGroupKey = '' @@ -92,10 +106,35 @@ export class InteractiveDataViewComponent implements OnInit { @ContentChild('listItemSubtitleLines') listItemSubtitleLines: TemplateRef | undefined @ContentChild('stringTableCell') stringTableCell: TemplateRef | undefined @ContentChild('numberTableCell') numberTableCell: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdTableCell + * e.g. for a column with the id 'status' in DataTable use pTemplate="statusIdTableCell" + */ @ContentChild('customTableCell') customTableCell: TemplateRef | undefined @ContentChild('gridItem') gridItem: TemplateRef | undefined @ContentChild('listItem') listItem: TemplateRef | undefined @ContentChild('topCenter') topCenter: TemplateRef | undefined + @ContentChild('listValue') listValue: TemplateRef | undefined + @ContentChild('translationKeyListValue') translationKeyListValue: TemplateRef | undefined + @ContentChild('numberListValue') numberListValue: TemplateRef | undefined + @ContentChild('relativeDateListValue') relativeDateListValue: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column + * use the new approach instead by following the naming convention column id + IdListValue + * e.g. for a column with the id 'status' DataListGrid use pTemplate="statusIdListValue" + */ + @ContentChild('customListValue') customListValue: TemplateRef | undefined + @ContentChild('stringListValue') stringListValue: TemplateRef | undefined + @ContentChild('dateListValue') dateListValue: TemplateRef | undefined + + templates$: BehaviorSubject | undefined> = new BehaviorSubject< + QueryList | undefined + >(undefined) + @ContentChildren(PrimeTemplate) + set templates(value: QueryList | undefined) { + this.templates$.next(value) + } @Output() filtered = new EventEmitter() @Output() sorted = new EventEmitter() @@ -164,6 +203,27 @@ export class InteractiveDataViewComponent implements OnInit { get _listItem(): TemplateRef | undefined { return this.listItem } + get _listValue(): TemplateRef | undefined { + return this.listValue + } + get _translationKeyListValue(): TemplateRef | undefined { + return this.translationKeyListValue + } + get _numberListValue(): TemplateRef | undefined { + return this.numberListValue + } + get _relativeDateListValue(): TemplateRef | undefined { + return this.relativeDateListValue + } + get _customListValue(): TemplateRef | undefined { + return this.customListValue + } + get _stringListValue(): TemplateRef | undefined { + return this.stringListValue + } + get _dateListValue(): TemplateRef | undefined { + return this.dateListValue + } _data: RowListGridData[] = [] @Input() @@ -189,6 +249,79 @@ export class InteractiveDataViewComponent implements OnInit { this.firstColumnId = this.columns[0]?.id } + ngAfterContentInit() { + this.templates?.forEach((item) => { + switch (item.getType()) { + case 'tableCell': + this.tableCell = item.template + break + case 'tableDateCell': + this.tableDateCell = item.template + break + case 'dateTableCell': + this.dateTableCell = item.template + break + case 'tableRelativeDateCell': + this.tableRelativeDateCell = item.template + break + case 'relativeDateTableCell': + this.relativeDateTableCell = item.template + break + case 'tableTranslationKeyCell': + this.tableTranslationKeyCell = item.template + break + case 'translationKeyTableCell': + this.translationKeyTableCell = item.template + break + case 'gridItemSubtitleLines': + this.gridItemSubtitleLines = item.template + break + case 'listItemSubtitleLines': + this.listItemSubtitleLines = item.template + break + case 'stringTableCell': + this.stringTableCell = item.template + break + case 'numberTableCell': + this.numberTableCell = item.template + break + case 'customTableCell': + this.customTableCell = item.template + break + case 'gridItem': + this.gridItem = item.template + break + case 'listItem': + this.listItem = item.template + break + case 'topCenter': + this.topCenter = item.template + break + case 'listValue': + this.listValue = item.template + break + case 'translationKeyListValue': + this.translationKeyListValue = item.template + break + case 'numberListValue': + this.numberListValue = item.template + break + case 'relativeDateListValue': + this.relativeDateListValue = item.template + break + case 'customListValue': + this.customListValue = item.template + break + case 'stringListValue': + this.stringListValue = item.template + break + case 'dateListValue': + this.dateListValue = item.template + break + } + }) + } + filtering(event: any) { this.filters = event this.filtered.emit(event) diff --git a/libs/angular-accelerator/src/lib/components/page-header/page-header.component.html b/libs/angular-accelerator/src/lib/components/page-header/page-header.component.html index c8e67246..55a6305e 100644 --- a/libs/angular-accelerator/src/lib/components/page-header/page-header.component.html +++ b/libs/angular-accelerator/src/lib/components/page-header/page-header.component.html @@ -91,16 +91,9 @@

{{ subheader }}

-
+
-
+
{{ subheader }} tooltipPosition="top" >{{ item.label | dynamicPipe:item.labelPipe }} - + - - - {{ item.value | dynamicPipe:item.valuePipe:item.valuePipeArgs}} - + + + {{ item.value | dynamicPipe:item.valuePipe:item.valuePipeArgs}} + { + this.zone.run(() => { + this.disabled = this.el.nativeElement.scrollWidth <= this.el.nativeElement.offsetWidth + this.setOption({ disabled: this.disabled }) + }, this) + }) + + @Input() + get ocxTooltipOnOverflow(): string | TemplateRef | undefined { + return this.content + } + set ocxTooltipOnOverflow(value: string | TemplateRef | undefined) { + this.content = value + this.setOption({ tooltipLabel: value }) + } + + override ngOnDestroy(): void { + super.ngOnDestroy() + this.mutationObserver.disconnect() + } + + override ngAfterViewInit(): void { + super.ngAfterViewInit() + this.mutationObserver.observe(this.el.nativeElement, { subtree: true, characterData: true, childList: true }) + } + + constructor( + @Inject(PLATFORM_ID) platformId: any, + el: ElementRef, + zone: NgZone, + config: PrimeNGConfig, + renderer: Renderer2, + viewContainer: ViewContainerRef + ) { + super(platformId, el, zone, config, renderer, viewContainer) + renderer.setStyle(this.el.nativeElement, 'text-overflow', 'ellipsis') + renderer.setStyle(this.el.nativeElement, 'overflow', 'hidden') + renderer.setStyle(this.el.nativeElement, 'white-space', 'nowrap') + this.disabled = true + this.setOption({ disabled: this.disabled }) + } +} diff --git a/libs/angular-accelerator/src/lib/model/column-type.model.ts b/libs/angular-accelerator/src/lib/model/column-type.model.ts index 5a4ad746..1722b7e2 100644 --- a/libs/angular-accelerator/src/lib/model/column-type.model.ts +++ b/libs/angular-accelerator/src/lib/model/column-type.model.ts @@ -4,5 +4,11 @@ export enum ColumnType { DATE = 'DATE', RELATIVE_DATE = 'RELATIVE_DATE', TRANSLATION_KEY = 'TRANSLATION_KEY', + /** + * @deprecated Will be removed with the next major v6 upgrade. + * Please use pTemplate="column id + IdCell" in DataTable or + * pTemplate="column id + IdTableCell" in DataView and InteractiveDataView + * e.g. for a column with the id 'status' in DataTable use pTemplate="statusIdCell" + */ CUSTOM = 'CUSTOM', } diff --git a/libs/angular-accelerator/testing/data-table.harness.ts b/libs/angular-accelerator/testing/data-table.harness.ts index 20c165a0..2c1f50ca 100644 --- a/libs/angular-accelerator/testing/data-table.harness.ts +++ b/libs/angular-accelerator/testing/data-table.harness.ts @@ -67,8 +67,8 @@ export class DataTableHarness extends ContentContainerComponentHarness { return disabledActionButtonsCount === amount } - async columnIsFrozen(column: TestElement | null) { - if (column == null) { + async columnIsFrozen(column: TestElement | null | undefined) { + if (column === null || column === undefined) { throw new Error('Given column is null') } return await column.hasClass('p-frozen-column') diff --git a/libs/angular-accelerator/testing/data-view.harness.ts b/libs/angular-accelerator/testing/data-view.harness.ts index e056c3df..2316a2dc 100644 --- a/libs/angular-accelerator/testing/data-view.harness.ts +++ b/libs/angular-accelerator/testing/data-view.harness.ts @@ -5,6 +5,6 @@ import { DataTableHarness } from './data-table.harness' export class DataViewHarness extends ContentContainerComponentHarness { static hostSelector = 'ocx-data-view' - getDataTable = this.locatorFor(DataTableHarness) - getDataListGrid = this.locatorFor(DataListGridHarness) + getDataTable = this.locatorForOptional(DataTableHarness) + getDataListGrid = this.locatorForOptional(DataListGridHarness) } From e141e4f29d2d5d620a872b383123f3100a7b8a1d Mon Sep 17 00:00:00 2001 From: Bastian Jakobi <55296998+bastianjakobi@users.noreply.github.com> Date: Thu, 22 Aug 2024 12:28:37 +0200 Subject: [PATCH 07/24] fix: fix nx migration and improve storybook action handling (#418) --- .storybook/main.js | 3 - libs/angular-accelerator/.storybook/main.js | 2 +- .../angular-accelerator/.storybook/preview.ts | 2 +- ...group-column-selector.component.stories.ts | 1 - .../data-list-grid.component.stories.ts | 7 +- .../data-table.component.stories.ts | 83 ++------- .../search-header/search-header.stories.ts | 1 - .../.storybook/main.js | 2 +- .../.storybook/preview.ts | 2 +- package-lock.json | 173 +++++++++--------- package.json | 6 +- 11 files changed, 115 insertions(+), 167 deletions(-) diff --git a/.storybook/main.js b/.storybook/main.js index b83a6857..f1a81f5e 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -4,8 +4,5 @@ module.exports = { options: {}, }, addons: ['@storybook/addon-a11y'], - docs: { - autodocs: true, - }, } \ No newline at end of file diff --git a/libs/angular-accelerator/.storybook/main.js b/libs/angular-accelerator/.storybook/main.js index 93c8c875..5feb6383 100644 --- a/libs/angular-accelerator/.storybook/main.js +++ b/libs/angular-accelerator/.storybook/main.js @@ -3,7 +3,7 @@ const rootMain = require('../../../.storybook/main') module.exports = { ...rootMain, staticDirs: [{ from: '../assets', to: '/assets' }], - stories: ['../src/lib/**/*.stories.mdx', '../src/lib/**/*.stories.@(js|jsx|ts|tsx)'], + stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx)'], addons: [...rootMain.addons, '@storybook/addon-essentials'], webpackFinal: async (config, { configType }) => { // apply any global webpack configs that might have been specified in .storybook/main.js diff --git a/libs/angular-accelerator/.storybook/preview.ts b/libs/angular-accelerator/.storybook/preview.ts index 21f38ed5..6df20793 100644 --- a/libs/angular-accelerator/.storybook/preview.ts +++ b/libs/angular-accelerator/.storybook/preview.ts @@ -13,7 +13,6 @@ initialize({ const preview: Preview = { decorators: [mswDecorator], parameters: { - actions: { argTypesRegex: '^on[A-Z].*' }, controls: { matchers: { color: /(background|color)$/i, @@ -21,6 +20,7 @@ const preview: Preview = { }, }, }, + tags: ['autodocs'] } export default preview diff --git a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.stories.ts b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.stories.ts index ce725485..de30c5f8 100644 --- a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.stories.ts +++ b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.stories.ts @@ -92,7 +92,6 @@ export const Default = { render: Template, args: { ...defaultComponentArgs, - actionColumnConfigChanged: ($event: any) => console.log('Action column config changed ', $event), }, argTypes: { actionColumnConfigChanged: { action: 'actionColumnConfigChanged' }, diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.stories.ts b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.stories.ts index 689e04d0..bdada519 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.stories.ts +++ b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.stories.ts @@ -57,17 +57,14 @@ const defaultComponentArgs = { emptyResultsMessage: 'No results', titleLineId: 'property1', layout: 'list', - deleteItem: ($event: any) => console.log('Delete table row ', $event), - editItem: ($event: any) => console.log('Edit table row ', $event), - viewItem: ($event: any) => console.log('View table row ', $event), deletePermission: 'TEST_MGMT#TEST_DELETE', editPermission: 'TEST_MGMT#TEST_EDIT', viewPermission: 'TEST_MGMT#TEST_VIEW', } const defaultArgTypes = { deleteItem: { action: 'deleteItem' }, - editItem: { action: 'deleteItem' }, - viewItem: { action: 'deleteItem' }, + editItem: { action: 'editItem' }, + viewItem: { action: 'viewItem' }, } const extendedMockData = [ { diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.stories.ts b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.stories.ts index 304fb9d6..7bbd8805 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.stories.ts +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.stories.ts @@ -44,6 +44,16 @@ const Template: StoryFn = (args) => ({ props: args, }) +const dataTableActionsArgTypes = { + deleteTableRow: { action: 'deleteTableRow' }, + editTableRow: { action: 'editTableRow' }, + viewTableRow: { action: 'viewTableRow' }, +} + +const dataTableSelectionArgTypes = { + selectionChanged: { action: 'selectionChanged' }, +} + const defaultComponentArgs: DataTableInputTypes = { columns: [ { @@ -112,24 +122,18 @@ export const NoData = { } export const WithRowSelection = { - argTypes: { - selectionChanged: { action: 'selectionChanged' }, - }, + argTypes: dataTableSelectionArgTypes, render: Template, args: { ...defaultComponentArgs, - selectionChanged: ($event: any) => console.log('Selection changed ', $event), }, } export const WithRowSelectionAndDefaultSelection = { - argTypes: { - selectionChanged: { action: 'selectionChanged' }, - }, + argTypes: dataTableSelectionArgTypes, render: Template, args: { ...defaultComponentArgs, - selectionChanged: ($event: any) => console.log('Selection changed ', $event), selectedRows: [ { id: 1, @@ -228,17 +232,10 @@ export const ResponsiveWithScroll = { } export const ResponsiveWithScrollAndFrozenActionsColumn = { - argTypes: { - deleteTableRow: { action: 'deleteTableRow' }, - editTableRow: { action: 'deleteTableRow' }, - viewTableRow: { action: 'deleteTableRow' }, - }, + argTypes: dataTableActionsArgTypes, render: Template, args: { ...extendedComponentArgs, - deleteTableRow: ($event: any) => console.log('Delete table row ', $event), - editTableRow: ($event: any) => console.log('Edit table row ', $event), - viewTableRow: ($event: any) => console.log('View table row ', $event), deletePermission: 'TEST_MGMT#TEST_DELETE', editPermission: 'TEST_MGMT#TEST_EDIT', viewPermission: 'TEST_MGMT#TEST_VIEW', @@ -248,17 +245,10 @@ export const ResponsiveWithScrollAndFrozenActionsColumn = { } export const WithConditionallyDisabledActionButtons = { - argTypes: { - deleteTableRow: { action: 'deleteTableRow' }, - editTableRow: { action: 'deleteTableRow' }, - viewTableRow: { action: 'deleteTableRow' }, - }, + argTypes: dataTableActionsArgTypes, render: Template, args: { ...defaultComponentArgs, - deleteTableRow: ($event: any) => console.log('Delete table row ', $event), - editTableRow: ($event: any) => console.log('Edit table row ', $event), - viewTableRow: ($event: any) => console.log('View table row ', $event), deleteActionEnabledField: 'available', editActionEnabledField: 'available', deletePermission: 'TEST_MGMT#TEST_DELETE', @@ -268,17 +258,10 @@ export const WithConditionallyDisabledActionButtons = { } export const WithConditionallyHiddenActionButtons = { - argTypes: { - deleteTableRow: { action: 'deleteTableRow' }, - editTableRow: { action: 'deleteTableRow' }, - viewTableRow: { action: 'deleteTableRow' }, - }, + argTypes: dataTableActionsArgTypes, render: Template, args: { ...defaultComponentArgs, - deleteTableRow: ($event: any) => console.log('Delete table row ', $event), - editTableRow: ($event: any) => console.log('Edit table row ', $event), - viewTableRow: ($event: any) => console.log('View table row ', $event), deleteActionVisibleField: 'available', editActionVisibleField: 'available', deletePermission: 'TEST_MGMT#TEST_DELETE', @@ -288,17 +271,10 @@ export const WithConditionallyHiddenActionButtons = { } export const WithAdditionalActions = { - argTypes: { - deleteTableRow: { action: 'deleteTableRow' }, - editTableRow: { action: 'deleteTableRow' }, - viewTableRow: { action: 'deleteTableRow' }, - }, + argTypes: dataTableActionsArgTypes, render: Template, args: { ...defaultComponentArgs, - deleteTableRow: ($event: any) => console.log('Delete table row ', $event), - editTableRow: ($event: any) => console.log('Edit table row ', $event), - viewTableRow: ($event: any) => console.log('View table row ', $event), deleteActionVisibleField: 'available', editActionVisibleField: 'available', deletePermission: 'TEST_MGMT#TEST_DELETE', @@ -316,17 +292,10 @@ export const WithAdditionalActions = { } export const WithConditionallyEnabledAdditionalActions = { - argTypes: { - deleteTableRow: { action: 'deleteTableRow' }, - editTableRow: { action: 'deleteTableRow' }, - viewTableRow: { action: 'deleteTableRow' }, - }, + argTypes: dataTableActionsArgTypes, render: Template, args: { ...defaultComponentArgs, - deleteTableRow: ($event: any) => console.log('Delete table row ', $event), - editTableRow: ($event: any) => console.log('Edit table row ', $event), - viewTableRow: ($event: any) => console.log('View table row ', $event), deleteActionVisibleField: 'available', editActionVisibleField: 'available', deletePermission: 'TEST_MGMT#TEST_DELETE', @@ -345,17 +314,10 @@ export const WithConditionallyEnabledAdditionalActions = { } export const WithConditionallyVisibleAdditionalActions = { - argTypes: { - deleteTableRow: { action: 'deleteTableRow' }, - editTableRow: { action: 'deleteTableRow' }, - viewTableRow: { action: 'deleteTableRow' }, - }, + argTypes: dataTableActionsArgTypes, render: Template, args: { ...defaultComponentArgs, - deleteTableRow: ($event: any) => console.log('Delete table row ', $event), - editTableRow: ($event: any) => console.log('Edit table row ', $event), - viewTableRow: ($event: any) => console.log('View table row ', $event), deleteActionVisibleField: 'available', editActionVisibleField: 'available', deletePermission: 'TEST_MGMT#TEST_DELETE', @@ -374,17 +336,10 @@ export const WithConditionallyVisibleAdditionalActions = { } export const WithAdditionalOverflowActions = { - argTypes: { - deleteTableRow: { action: 'deleteTableRow' }, - editTableRow: { action: 'deleteTableRow' }, - viewTableRow: { action: 'deleteTableRow' }, - }, + argTypes: dataTableActionsArgTypes, render: Template, args: { ...defaultComponentArgs, - deleteTableRow: ($event: any) => console.log('Delete table row ', $event), - editTableRow: ($event: any) => console.log('Edit table row ', $event), - viewTableRow: ($event: any) => console.log('View table row ', $event), deletePermission: 'TEST_MGMT#TEST_DELETE', editPermission: 'TEST_MGMT#TEST_EDIT', viewPermission: 'TEST_MGMT#TEST_VIEW', diff --git a/libs/angular-accelerator/src/lib/components/search-header/search-header.stories.ts b/libs/angular-accelerator/src/lib/components/search-header/search-header.stories.ts index ac68dd38..d59c3a99 100644 --- a/libs/angular-accelerator/src/lib/components/search-header/search-header.stories.ts +++ b/libs/angular-accelerator/src/lib/components/search-header/search-header.stories.ts @@ -121,6 +121,5 @@ export const WithCustomTemplates = { }, args: { header: 'My title', - resetted: ($event: any) => console.log($event), }, } \ No newline at end of file diff --git a/libs/portal-integration-angular/.storybook/main.js b/libs/portal-integration-angular/.storybook/main.js index 729f82c5..81350b2f 100644 --- a/libs/portal-integration-angular/.storybook/main.js +++ b/libs/portal-integration-angular/.storybook/main.js @@ -3,7 +3,7 @@ const rootMain = require('../../../.storybook/main') module.exports = { ...rootMain, staticDirs: [{ from: '../assets', to: '/assets' }, '../mocks'], - stories: ['../src/lib/**/*.stories.mdx', '../src/lib/**/*.stories.@(js|jsx|ts|tsx)'], + stories: ['../src/lib/**/*.stories.@(js|jsx|ts|tsx)'], addons: [...rootMain.addons, '@storybook/addon-essentials'], webpackFinal: async (config, { configType }) => { // apply any global webpack configs that might have been specified in .storybook/main.js diff --git a/libs/portal-integration-angular/.storybook/preview.ts b/libs/portal-integration-angular/.storybook/preview.ts index 21f38ed5..6df20793 100644 --- a/libs/portal-integration-angular/.storybook/preview.ts +++ b/libs/portal-integration-angular/.storybook/preview.ts @@ -13,7 +13,6 @@ initialize({ const preview: Preview = { decorators: [mswDecorator], parameters: { - actions: { argTypesRegex: '^on[A-Z].*' }, controls: { matchers: { color: /(background|color)$/i, @@ -21,6 +20,7 @@ const preview: Preview = { }, }, }, + tags: ['autodocs'] } export default preview diff --git a/package-lock.json b/package-lock.json index a6c9f14a..2197c7b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,8 +40,6 @@ "primeflex": "^3.3.1", "primeicons": "^7.0.0", "primeng": "17.18.8", - "react": "^18.3.1", - "react-dom": "^18.3.1", "rxjs": "7.8.1", "tslib": "^2.6.3", "zod": "^3.23.8", @@ -74,8 +72,8 @@ "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", "@semantic-release/release-notes-generator": "^14.0.1", - "@storybook/addon-a11y": "^8.2.8", - "@storybook/addon-essentials": "^8.2.8", + "@storybook/addon-a11y": "^8.2.9", + "@storybook/addon-essentials": "^8.2.9", "@storybook/angular": "^8.2.9", "@storybook/core-server": "^8.2.8", "@swc-node/register": "~1.10.0", @@ -10662,12 +10660,12 @@ } }, "node_modules/@storybook/addon-a11y": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-8.2.8.tgz", - "integrity": "sha512-pUjTjJjoP/52hoB2BGqWmGPOUpM1YwEKsYJmY4ki3qJo/ehau+mMlal9xY9/mxafYFkYbrWvHoVSLxSRBxt3yg==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-8.2.9.tgz", + "integrity": "sha512-9zm0Ecn2KUUKZbRsQM5l2KcQ8RHK6a9eqdQtOMjGagrdUvUstcf7XjBmV1W6PQE2Urj93ciz1cgx4T1AYQyKtA==", "dev": true, "dependencies": { - "@storybook/addon-highlight": "8.2.8", + "@storybook/addon-highlight": "8.2.9", "axe-core": "^4.2.0" }, "funding": { @@ -10675,13 +10673,13 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-actions": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-8.2.8.tgz", - "integrity": "sha512-dyajqsMNAUktpi7aiml0Fsm4ey8Nh2YwRyTDuTJZ1iJFcFyARqfr5iKH4/qElq80y0FYXGgGRJB+dKJsCdefLw==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-actions/-/addon-actions-8.2.9.tgz", + "integrity": "sha512-eh2teOqjga7aoClDVV+/b1gHJqsPwjiU1t+Hg/l4i2CkaBUNdYMEL90nR6fgReOdvvL5YhcPwJ8w38f9TrQcoQ==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0", @@ -10695,13 +10693,13 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-backgrounds": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-backgrounds/-/addon-backgrounds-8.2.8.tgz", - "integrity": "sha512-OqXGpq8KzWwAAQWPnby/v4ayWuUAB18Twgi6zeb+QNLEQdFnSp7kz6+4mP8ZVg8RS3ACGXD31nnvvlF7GYoJjQ==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-backgrounds/-/addon-backgrounds-8.2.9.tgz", + "integrity": "sha512-eGmZAd742ORBbQ6JepzBCko/in62T4Xg9j9LVa+Cvz/7L1C/RQSuU6sUwbRAsXaz+PMVDksPDCUUNsXl3zUL7w==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0", @@ -10713,13 +10711,13 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-controls": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-controls/-/addon-controls-8.2.8.tgz", - "integrity": "sha512-adhg68CSFaR/r95rgyKU4ZzWwZz+MU0c4vr9hqrR1UGvg/zl33IZQQzb5j5v3Axo0O31yPMaY6LRty7pOv3+/Q==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-controls/-/addon-controls-8.2.9.tgz", + "integrity": "sha512-vaSE78KOE7SO0GrW4e+mdQphSNpvCX/FGybIRxyaKX9h8smoyUwRNHVyCS3ROHTwH324QWu7GDzsOVrnyXOv0A==", "dev": true, "dependencies": { "dequal": "^2.0.2", @@ -10731,21 +10729,21 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-docs": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-8.2.8.tgz", - "integrity": "sha512-8hqUYYveJjR3e/XdXt0vduA7TxFRIFWgXoa9jN5axa63kqfiHcfkpFYPjM8jCRhsfDIRgdrwe2qxsA0wewO1pA==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-8.2.9.tgz", + "integrity": "sha512-flDOxFIGmXg+6lVdwTLMOKsGob1WrT7rG98mn1SNW0Nxhg3Wg+9pQuq1GLxEzKtAgSflmu+xcBRfYhsogyDXkw==", "dev": true, "dependencies": { "@babel/core": "^7.24.4", "@mdx-js/react": "^3.0.0", - "@storybook/blocks": "8.2.8", - "@storybook/csf-plugin": "8.2.8", + "@storybook/blocks": "8.2.9", + "@storybook/csf-plugin": "8.2.9", "@storybook/global": "^5.0.0", - "@storybook/react-dom-shim": "8.2.8", + "@storybook/react-dom-shim": "8.2.9", "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", "fs-extra": "^11.1.0", "react": "^16.8.0 || ^17.0.0 || ^18.0.0", @@ -10759,24 +10757,24 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-essentials": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-essentials/-/addon-essentials-8.2.8.tgz", - "integrity": "sha512-NRbFv2ociM1l/Oi/1go/ZC5bUU41n9aKD1DzIbguEKBhUs/TGAES+f5x+7DvYnt3Hvd925/FyTXuMU+vNUeiUA==", - "dev": true, - "dependencies": { - "@storybook/addon-actions": "8.2.8", - "@storybook/addon-backgrounds": "8.2.8", - "@storybook/addon-controls": "8.2.8", - "@storybook/addon-docs": "8.2.8", - "@storybook/addon-highlight": "8.2.8", - "@storybook/addon-measure": "8.2.8", - "@storybook/addon-outline": "8.2.8", - "@storybook/addon-toolbars": "8.2.8", - "@storybook/addon-viewport": "8.2.8", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-essentials/-/addon-essentials-8.2.9.tgz", + "integrity": "sha512-B2d3eznGZvPIyCVtYX0UhrYcEfK+3Y2sACmEWpSwtk8KXomFEsZnD95m397BYDRw3/X6qeSLWxqgMfqDTEDeMA==", + "dev": true, + "dependencies": { + "@storybook/addon-actions": "8.2.9", + "@storybook/addon-backgrounds": "8.2.9", + "@storybook/addon-controls": "8.2.9", + "@storybook/addon-docs": "8.2.9", + "@storybook/addon-highlight": "8.2.9", + "@storybook/addon-measure": "8.2.9", + "@storybook/addon-outline": "8.2.9", + "@storybook/addon-toolbars": "8.2.9", + "@storybook/addon-viewport": "8.2.9", "ts-dedent": "^2.0.0" }, "funding": { @@ -10784,13 +10782,13 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-highlight": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-highlight/-/addon-highlight-8.2.8.tgz", - "integrity": "sha512-IM1pPx6CCZbHV0bv3oB1qBCGDsr8soq7XLl93tc7mc4hstWSDFfNn7rx4CWycSlCqXlNTKh8cEkbrPrhV9cwbg==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-highlight/-/addon-highlight-8.2.9.tgz", + "integrity": "sha512-qdcazeNQoo9QKIq+LJJZZXvFZoLn+i4uhbt1Uf9WtW6oU/c1qxORGVD7jc3zsxbQN9nROVPbJ76sfthogxeqWA==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0" @@ -10800,13 +10798,13 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-measure": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-measure/-/addon-measure-8.2.8.tgz", - "integrity": "sha512-oqZiX571F9NNy8o/oVyM1Pe2cJz3WJ/OpL0lVbepHrV4ir1f+SDYZdMI58jGBAtoM52cwFc2ZPbzXKQs7a513A==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-measure/-/addon-measure-8.2.9.tgz", + "integrity": "sha512-XUfQtYRKWB2dfbPRmHuos816wt1JrLbtRld5ZC8J8ljeqZ4hFBPTQcgI5GAzZqjQuclLC0KuhlA/0bKxdxMMGA==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0", @@ -10817,13 +10815,13 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-outline": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-outline/-/addon-outline-8.2.8.tgz", - "integrity": "sha512-Cbk4Z0ojggiXjpbS2c4WUP56yikQdT4O7+8AuBNNjVUHNvJQADWYovi6SvDmrS5dH1iyIkB+4saXMr0syp+BDw==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-outline/-/addon-outline-8.2.9.tgz", + "integrity": "sha512-p22kI4W7MT0YJOCmg/FfhfH+NpZEDA5tgwstjazSg4ertyhaxziMwWZWiK2JCg0gOAfRJjoYjHz+6/u56iXwgQ==", "dev": true, "dependencies": { "@storybook/global": "^5.0.0", @@ -10834,26 +10832,26 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-toolbars": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-toolbars/-/addon-toolbars-8.2.8.tgz", - "integrity": "sha512-k64G3FUpX3H/mhJ7AG1r/4Drsk6cdUtxI3yVdgWb7O3Ka7v/OFZexRXRSiV03n5q/kaqVKDu96Tuog57+7EB4w==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-toolbars/-/addon-toolbars-8.2.9.tgz", + "integrity": "sha512-9LMZZ2jRD86Jh6KXedDbAYs4eHj9HtJA9VhSEE2wiqMGwXozpySi7B1GWniNzmFfcgMQ4JHfmD/OrBVTK7Ca/w==", "dev": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/addon-viewport": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/addon-viewport/-/addon-viewport-8.2.8.tgz", - "integrity": "sha512-/JZeIgB33yhryUvWaNO+3t9akcS8nGLyAUmlljPFr3LUDDYrO/0H9tE4CgjLqtwCXBq3k3s0HLzEJOrKI9Tmbw==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/addon-viewport/-/addon-viewport-8.2.9.tgz", + "integrity": "sha512-lyM24+DJEt8R0YZkJKee34NQWv0REACU6lYDalqJNdKS1sEwzLGWxg1hZXnw2JFdBID9NGVvyYU2w6LDozOB0g==", "dev": true, "dependencies": { "memoizerific": "^1.11.3" @@ -10863,7 +10861,7 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/angular": { @@ -10999,9 +10997,9 @@ } }, "node_modules/@storybook/blocks": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/blocks/-/blocks-8.2.8.tgz", - "integrity": "sha512-AHBXu9s73Xv9r1JageIL7C4eGf5XYEByai4Y6NYQsE+jF7b7e8oaSUoLW6fWSyLGuqvjRx+5P7GMNI2K1EngBA==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/blocks/-/blocks-8.2.9.tgz", + "integrity": "sha512-5276q/s/UL8arwftuBXovUNHqYo/HPQFMGXEmjVVAMXUyFjzEAfKj3+xU897J6AuL+7XVZG32WnqA+X6LJMrcQ==", "dev": true, "dependencies": { "@storybook/csf": "0.1.11", @@ -11026,7 +11024,7 @@ "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", - "storybook": "^8.2.8" + "storybook": "^8.2.9" }, "peerDependenciesMeta": { "react": { @@ -11506,9 +11504,9 @@ } }, "node_modules/@storybook/csf-plugin": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/csf-plugin/-/csf-plugin-8.2.8.tgz", - "integrity": "sha512-CEHY7xloBPE8d8h0wg2AM2kRaZkHK8/vkYMNZPbccqAYj6PQIdTuOcXZIBAhAGydyIBULZmsmmsASxM9RO5fKA==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/csf-plugin/-/csf-plugin-8.2.9.tgz", + "integrity": "sha512-QQCFb3g12VQQEraDV1UfCmniGhQZKyT6oEt1Im6dzzPJj9NQk+6BjWoDep33CZhBHWoLryrMQd2fjuHxnFRNEA==", "dev": true, "dependencies": { "unplugin": "^1.3.1" @@ -11518,7 +11516,7 @@ "url": "https://opencollective.com/storybook" }, "peerDependencies": { - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/global": { @@ -11567,9 +11565,9 @@ } }, "node_modules/@storybook/react-dom-shim": { - "version": "8.2.8", - "resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-8.2.8.tgz", - "integrity": "sha512-2my3dGBOpBe30+FsSdQOIYCfxMyT68+SEq0qcXxfuax0BkhhJnZLpwvpqOna6EOVTgBD+Tk1TKmjpGwxuwp4rg==", + "version": "8.2.9", + "resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-8.2.9.tgz", + "integrity": "sha512-uCAjSQEsNk8somVn1j/I1G9G/uUax5byHseIIV0Eq3gVXttGd7gaWcP+TDHtqIaenWHx4l+hCSuCesxiLWmx4Q==", "dev": true, "funding": { "type": "opencollective", @@ -11578,7 +11576,7 @@ "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0-beta", - "storybook": "^8.2.8" + "storybook": "^8.2.9" } }, "node_modules/@storybook/theming": { @@ -12622,9 +12620,9 @@ "dev": true }, "node_modules/@types/unist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", - "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", "dev": true }, "node_modules/@types/uuid": { @@ -21778,7 +21776,8 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true }, "node_modules/js-yaml": { "version": "3.14.1", @@ -22932,6 +22931,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, @@ -23044,9 +23044,9 @@ "dev": true }, "node_modules/markdown-to-jsx": { - "version": "7.4.7", - "resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.4.7.tgz", - "integrity": "sha512-0+ls1IQZdU6cwM1yu0ZjjiVWYtkbExSyUIFU2ZeDIFuZM1W42Mh4OlJ4nb4apX4H8smxDHRdFaoIVJGwfv5hkg==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/markdown-to-jsx/-/markdown-to-jsx-7.5.0.tgz", + "integrity": "sha512-RrBNcMHiFPcz/iqIj0n3wclzHXjwS7mzjBNWecKKVhNTIxQepIix6Il/wZCn2Cg5Y1ow2Qi84+eJrryFRWBEWw==", "dev": true, "engines": { "node": ">= 10" @@ -31217,6 +31217,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", + "dev": true, "dependencies": { "loose-envify": "^1.1.0" }, @@ -31238,6 +31239,7 @@ "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", + "dev": true, "dependencies": { "loose-envify": "^1.1.0", "scheduler": "^0.23.2" @@ -32132,6 +32134,7 @@ "version": "0.23.2", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dev": true, "dependencies": { "loose-envify": "^1.1.0" } @@ -34963,9 +34966,9 @@ } }, "node_modules/unplugin": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.12.1.tgz", - "integrity": "sha512-aXEH9c5qi3uYZHo0niUtxDlT9ylG/luMW/dZslSCkbtC31wCyFkmM0kyoBBh+Grhn7CL+/kvKLfN61/EdxPxMQ==", + "version": "1.12.2", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-1.12.2.tgz", + "integrity": "sha512-bEqQxeC7rxtxPZ3M5V4Djcc4lQqKPgGe3mAWZvxcSmX5jhGxll19NliaRzQSQPrk4xJZSGniK3puLWpRuZN7VQ==", "dev": true, "dependencies": { "acorn": "^8.12.1", diff --git a/package.json b/package.json index b8c3e876..2e0368eb 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,6 @@ "primeflex": "^3.3.1", "primeicons": "^7.0.0", "primeng": "17.18.8", - "react": "^18.3.1", - "react-dom": "^18.3.1", "rxjs": "7.8.1", "tslib": "^2.6.3", "zod": "^3.23.8", @@ -73,8 +71,8 @@ "@semantic-release/exec": "^6.0.3", "@semantic-release/git": "^10.0.1", "@semantic-release/release-notes-generator": "^14.0.1", - "@storybook/addon-a11y": "^8.2.8", - "@storybook/addon-essentials": "^8.2.8", + "@storybook/addon-a11y": "^8.2.9", + "@storybook/addon-essentials": "^8.2.9", "@storybook/angular": "^8.2.9", "@storybook/core-server": "^8.2.8", "@swc-node/register": "~1.10.0", From 99138bac35188a4bbd56f4a27787427d37204130 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Thu, 22 Aug 2024 11:24:12 +0000 Subject: [PATCH 08/24] chore(release): -v5.7.0 [skip ci] ## [5.7.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.6.0...v5.7.0) (2024-08-22) ### Features * default list view refactor, new way of templating ([#400](https://github.com/onecx/onecx-portal-ui-libs/issues/400)) ([b61da4b](https://github.com/onecx/onecx-portal-ui-libs/commit/b61da4bf182400510200c11d22f768c8fdac5eee)) ### Bug Fixes * fix nx migration and improve storybook action handling ([#418](https://github.com/onecx/onecx-portal-ui-libs/issues/418)) ([e141e4f](https://github.com/onecx/onecx-portal-ui-libs/commit/e141e4f29d2d5d620a872b383123f3100a7b8a1d)) --- CHANGELOG.md | 10 ++++++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 14 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2f89f61b..a12b736b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [5.7.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.6.0...v5.7.0) (2024-08-22) + +### Features + +* default list view refactor, new way of templating ([#400](https://github.com/onecx/onecx-portal-ui-libs/issues/400)) ([b61da4b](https://github.com/onecx/onecx-portal-ui-libs/commit/b61da4bf182400510200c11d22f768c8fdac5eee)) + +### Bug Fixes + +* fix nx migration and improve storybook action handling ([#418](https://github.com/onecx/onecx-portal-ui-libs/issues/418)) ([e141e4f](https://github.com/onecx/onecx-portal-ui-libs/commit/e141e4f29d2d5d620a872b383123f3100a7b8a1d)) + ## [5.6.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.5.0...v5.6.0) (2024-08-22) ### Features diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index ead1d41c..8ecef80e 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1" diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 56e128ca..4229c89b 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 14064b70..11666a9e 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", "@angular/common": "^18.0.5", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index acfe1d73..d86b112a 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular/core": "^18.0.5", "@onecx/integration-interface": "~5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index 35bcefcd..1ba28f25 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index 7e656d18..573de4af 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular/cdk": "^18.0.5", "primeng": "^17.18.6" diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index aea3325b..915f7ee3 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/platform-browser": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 0137b812..9d29b5a2 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index d54e6e17..eefb13e9 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 5bf8ed68..5102c3a4 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index f9111b34..f5edbb5a 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "tslib": "^2.6.3" }, diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index 49a71f85..b2b37131 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.6.0", + "version": "5.7.0", "peerDependencies": { "rxjs": "7.8.1", "@angular/animations": "^18.0.5", diff --git a/package.json b/package.json index 2e0368eb..a7a53475 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.6.0", + "version": "5.7.0", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From ff3885410499476e25e6e95a286af32ed45a1769 Mon Sep 17 00:00:00 2001 From: markuczy <129275100+markuczy@users.noreply.github.com> Date: Thu, 22 Aug 2024 14:37:14 +0200 Subject: [PATCH 09/24] feat: filter templates for data-table (#416) * fix: update angular versions * feat: default listview update and new way of templating * feat: add SharedModule, refactorings listview and templates * fix: template adaptions * feat: tooltiponoverflow directive, updated listviewitem, refactored way of templating * fix: typo in defaultRelativeDateListValue * fix: lint issues * feat: data-table templates for filter values * feat: working filter templates * fix: tests fixed * fix: find template when using pTemplate * fix: add deprecated comments for custom templates * fix: fixed template name translationKeyCell and translationKeyTableCell * feat: deprecated custom filter columns * fix: date cell template passing fix * feat: improved deprecated messages --------- Co-authored-by: kim.tran Co-authored-by: Kim Tran Co-authored-by: Annika Nowak <139357202+anninowak@users.noreply.github.com> Co-authored-by: Annika Nowak --- .../data-list-grid.component.ts | 4 +- .../data-table/data-table.component.html | 13 +- .../data-table/data-table.component.ts | 235 ++++++++++++++---- .../data-view/data-view.component.html | 63 +++++ .../data-view/data-view.component.ts | 68 +++++ .../interactive-data-view.component.html | 58 ++++- .../interactive-data-view.component.ts | 54 ++++ 7 files changed, 440 insertions(+), 55 deletions(-) diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts index a9bd6251..84430e65 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts @@ -198,13 +198,13 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe get _relativeDateListValue(): TemplateRef | undefined { return this.relativeDateListValueTemplate || this.relativeDateListValueChildTemplate } - /** + /** * @deprecated Will be removed and instead to change the template of a specific column * use the new approach instead by following the naming convention column id + IdListValue * e.g. for a column with the id 'status' use pTemplate="statusIdListValue" */ @Input() customListValueTemplate: TemplateRef | undefined - /** + /** * @deprecated Will be removed and instead to change the template of a specific column * use the new approach instead by following the naming convention column id + IdListValue * e.g. for a column with the id 'status' use pTemplate="statusIdListValue" diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html index c20b2399..154de656 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.html @@ -167,9 +167,14 @@ >
- - {{ isDate(value.label) ? (value.label | date) : '' }} - {{ value.label }} + @@ -223,7 +228,7 @@ | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column filter + * use the new approach instead by following the naming convention column id + IdFilterCell + * e.g. for a column with the id 'status' use pTemplate="statusIdFilterCell" + */ + @ContentChild('customFilterCell') customFilterCellChildTemplate: TemplateRef | undefined + get _customFilterCell(): TemplateRef | undefined { + return this.customFilterCellTemplate || this.customFilterCellChildTemplate + } + @Input() dateFilterCellTemplate: TemplateRef | undefined + @ContentChild('dateFilterCell') dateFilterCellChildTemplate: TemplateRef | undefined + get _dateFilterCell(): TemplateRef | undefined { + return this.dateFilterCellTemplate || this.dateFilterCellChildTemplate + } + @Input() relativeDateFilterCellTemplate: TemplateRef | undefined + @ContentChild('relativeDateFilterCell') relativeDateFilterCellChildTemplate: TemplateRef | undefined + get _relativeDateFilterCell(): TemplateRef | undefined { + return this.relativeDateFilterCellTemplate || this.relativeDateFilterCellChildTemplate + } + @Input() filterCellTemplate: TemplateRef | undefined + @ContentChild('filterCell') filterCellChildTemplate: TemplateRef | undefined + get _filterCell(): TemplateRef | undefined { + return this.filterCellTemplate || this.filterCellChildTemplate + } + @Input() translationKeyFilterCellTemplate: TemplateRef | undefined + @ContentChild('translationKeyFilterCell') translationKeyFilterCellChildTemplate: TemplateRef | undefined + get _translationKeyFilterCell(): TemplateRef | undefined { + return this.translationKeyFilterCellTemplate || this.translationKeyFilterCellChildTemplate + } _additionalActions$ = new BehaviorSubject([]) @Input() @@ -389,6 +448,27 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon case 'translationKeyCell': this.translationKeyCellChildTemplate = item.template break + case 'stringFilterCell': + this.stringFilterCellChildTemplate = item.template + break + case 'numberFilterCell': + this.numberFilterCellChildTemplate = item.template + break + case 'customFilterCell': + this.customFilterCellChildTemplate = item.template + break + case 'dateFilterCell': + this.dateFilterCellChildTemplate = item.template + break + case 'relativeDateFilterCell': + this.relativeDateFilterCellChildTemplate = item.template + break + case 'filterCellTemplate': + this.filterCellChildTemplate = item.template + break + case 'translationKeyFilterCell': + this.translationKeyFilterCellChildTemplate = item.template + break } }) } @@ -517,6 +597,41 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon return isValidDate(d) } + cellTemplatesData: TemplatesData = { + templatesObservables: {}, + idSuffix: ['IdTableCell', 'IdCell'], + templateNames: { + [ColumnType.DATE]: ['dateCell', 'dateTableCell', 'defaultDateCell'], + [ColumnType.NUMBER]: ['numberCell', 'numberTableCell', 'defaultNumberCell'], + [ColumnType.RELATIVE_DATE]: ['relativeDateCell', 'relativeDateTableCell', 'defaultRelativeDateCell'], + [ColumnType.TRANSLATION_KEY]: ['translationKeyCell', 'translationKeyTableCell', 'defaultTranslationKeyCell'], + [ColumnType.CUSTOM]: ['customCell', 'customTableCell', 'defaultCustomCell'], + [ColumnType.STRING]: ['stringCell', 'stringTableCell', 'defaultStringCell'], + }, + } + + filterTemplatesData: TemplatesData = { + templatesObservables: {}, + idSuffix: ['IdTableFilterCell', 'IdFilterCell'], + templateNames: { + [ColumnType.DATE]: ['dateFilterCell', 'dateTableFilterCell', 'defaultDateCell'], + [ColumnType.NUMBER]: ['numberFilterCell', 'numberTableFilterCell', 'defaultNumberCell'], + [ColumnType.RELATIVE_DATE]: ['relativeDateFilterCell', 'relativeDateTableFilterCell', 'defaultRelativeDateCell'], + [ColumnType.TRANSLATION_KEY]: [ + 'translationKeyFilterCell', + 'translationKeyTableFilterCell', + 'defaultTranslationKeyCell', + ], + [ColumnType.CUSTOM]: ['customFilterCell', 'customTableFilterCell', 'defaultCustomCell'], + [ColumnType.STRING]: ['stringFilterCell', 'stringTableFilterCell', 'defaultStringCell'], + }, + } + + templatesDataMap: Record = { + [TemplateType.CELL]: this.cellTemplatesData, + [TemplateType.FILTERCELL]: this.filterTemplatesData, + } + findTemplate(templates: PrimeTemplate[], names: string[]): PrimeTemplate | undefined { for (let index = 0; index < names.length; index++) { const name = names[index] @@ -528,70 +643,94 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon return undefined } - getTemplate(column: DataTableColumn): Observable | null> { - if (!this.templatesObservables[column.id]) { - this.templatesObservables[column.id] = combineLatest([ + getColumnTypeTemplate(templates: PrimeTemplate[], columnType: ColumnType, templateType: TemplateType) { + let template: TemplateRef | undefined + + switch (templateType) { + case TemplateType.CELL: + switch (columnType) { + case ColumnType.DATE: + template = this._dateCell + break + case ColumnType.NUMBER: + template = this._numberCell + break + case ColumnType.RELATIVE_DATE: + template = this._relativeDateCell + break + case ColumnType.TRANSLATION_KEY: + template = this._translationKeyCell + break + case ColumnType.CUSTOM: + template = this._customCell + break + default: + template = this._stringCell + } + break + case TemplateType.FILTERCELL: + switch (columnType) { + case ColumnType.DATE: + template = this._dateFilterCell + break + case ColumnType.NUMBER: + template = this._numberFilterCell + break + case ColumnType.RELATIVE_DATE: + template = this._relativeDateFilterCell + break + case ColumnType.TRANSLATION_KEY: + template = this._translationKeyFilterCell + break + case ColumnType.CUSTOM: + template = this._customFilterCell + break + default: + template = this._stringFilterCell + } + break + } + + return ( + template ?? + this.findTemplate(templates, this.templatesDataMap[templateType].templateNames[columnType])?.template ?? + null + ) + } + + getTemplate(column: DataTableColumn, templateType: TemplateType): Observable | null> { + const templatesData = this.templatesDataMap[templateType] + + if (!templatesData.templatesObservables[column.id]) { + templatesData.templatesObservables[column.id] = combineLatest([ this.templates$, this.viewTemplates$, this.parentTemplates$, ]).pipe( map(([t, vt, pt]) => { const templates = [...(t ?? []), ...(vt ?? []), ...(pt ?? [])] - const columnTemplate = this.findTemplate(templates, [ - column.id + 'IdCell', - column.id + 'IdTableCell', - ])?.template + const columnTemplate = this.findTemplate( + templates, + templatesData.idSuffix.map((suffix) => column.id + suffix) + )?.template if (columnTemplate) { return columnTemplate } - switch (column.columnType) { - case ColumnType.DATE: - return ( - this._dateCell ?? - this.findTemplate(templates, ['dateCell', 'dateTableCell', 'defaultDateCell'])?.template ?? - null - ) - case ColumnType.NUMBER: - return ( - this._numberCell ?? - this.findTemplate(templates, ['numberCell', 'numberTableCell', 'defaultNumberCell'])?.template ?? - null - ) - case ColumnType.RELATIVE_DATE: - return ( - this._relativeDateCell ?? - this.findTemplate(templates, ['relativeDateCell', 'relativeDateTableCell', 'defaultRelativeDateCell']) - ?.template ?? - null - ) - case ColumnType.TRANSLATION_KEY: - return ( - this._translationKeyCell ?? - this.findTemplate(templates, ['translationKeyCell', 'translationKeyTableCell', 'defaultTranslationKeyCell']) - ?.template ?? - null - ) - case ColumnType.CUSTOM: - return ( - this._customCell ?? - this.findTemplate(templates, ['customCell', 'customTableCell', 'defaultCustomCell'])?.template ?? - null - ) - default: - return ( - this._stringCell ?? - this.findTemplate(templates, ['stringCell', 'stringTableCell', 'defaultStringCell'])?.template ?? - null - ) - } + return this.getColumnTypeTemplate(templates, column.columnType, templateType) }), debounceTime(50) ) } - return this.templatesObservables[column.id] + return templatesData.templatesObservables[column.id] } resolveFieldData(object: any, key: any) { return ObjectUtils.resolveFieldData(object, key) } + + getRowObjectFromMultiselectItem(value: MultiSelectItem, column: DataTableColumn) { + return { + [column.id]: value.label, + } + } } diff --git a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html index 4db28412..d0a41d9f 100644 --- a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html +++ b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html @@ -165,6 +165,13 @@ [relativeDateCellTemplate]="_relativeDateTableCell ? relativeDateCell : undefined" [cellTemplate]="_tableCell ? cell : undefined" [translationKeyCellTemplate]="_translationKeyTableCell ? translationKeyCell : undefined" + [filterCellTemplate]="_tableFilterCell ? filterCell : undefined" + [dateFilterCellTemplate]="_dateTableFilterCell ? dateFilterCell : undefined" + [customFilterCellTemplate]="_customTableFilterCell ? customFilterCell : undefined" + [numberFilterCellTemplate]="_numberTableFilterCell ? numberFilterCell : undefined" + [stringFilterCellTemplate]="_stringTableFilterCell ? stringFilterCell : undefined" + [relativeDateFilterCellTemplate]="_relativeDateTableFilterCell ? relativeDateFilterCell : undefined" + [translationKeyFilterCellTemplate]="_translationKeyTableFilterCell ? translationKeyFilterCell : undefined" (sorted)="sorting($event)" (filtered)="filtering($event)" [totalRecordsOnServer]="totalRecordsOnServer" @@ -229,4 +236,60 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts index f24f1bf6..065a6380 100644 --- a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts @@ -261,6 +261,53 @@ export class DataViewComponent implements DoCheck, OnInit, AfterContentInit { get _dateListValue(): TemplateRef | undefined { return this.dateListValueTemplate || this.dateListValueChildTemplate } + @Input() tableFilterCellTemplate: TemplateRef | undefined + @ContentChild('tableFilterCell') tableFilterCellChildTemplate: TemplateRef | undefined + get _tableFilterCell(): TemplateRef | undefined { + return this.tableFilterCellTemplate || this.tableFilterCellChildTemplate + } + @Input() dateTableFilterCellTemplate: TemplateRef | undefined + @ContentChild('dateFilterCell') dateTableFilterCellChildTemplate: TemplateRef | undefined + get _dateTableFilterCell(): TemplateRef | undefined { + return this.dateTableFilterCellTemplate || this.dateTableFilterCellChildTemplate + } + @Input() relativeDateTableFilterCellTemplate: TemplateRef | undefined + @ContentChild('relativeDateTableFilterCell') relativeDateTableFilterCellChildTemplate: TemplateRef | undefined + get _relativeDateTableFilterCell(): TemplateRef | undefined { + return this.relativeDateTableFilterCellTemplate || this.relativeDateTableFilterCellChildTemplate + } + @Input() translationKeyTableFilterCellTemplate: TemplateRef | undefined + @ContentChild('translationKeyTableFilterCell') translationKeyTableFilterCellChildTemplate: + | TemplateRef + | undefined + get _translationKeyTableFilterCell(): TemplateRef | undefined { + return this.translationKeyTableFilterCellTemplate || this.translationKeyTableFilterCellChildTemplate + } + @Input() stringTableFilterCellTemplate: TemplateRef | undefined + @ContentChild('stringTableFilterCell') stringTableFilterCellChildTemplate: TemplateRef | undefined + get _stringTableFilterCell(): TemplateRef | undefined { + return this.stringTableFilterCellTemplate || this.stringTableFilterCellChildTemplate + } + @Input() numberTableFilterCellTemplate: TemplateRef | undefined + @ContentChild('numberTableFilterCell') numberTableFilterCellChildTemplate: TemplateRef | undefined + get _numberTableFilterCell(): TemplateRef | undefined { + return this.numberTableFilterCellTemplate || this.numberTableFilterCellChildTemplate + } + /** + * @deprecated Will be removed and instead to change the template of a specific column filter + * use the new approach instead by following the naming convention column id + IdTableFilterCell + * e.g. for a column with the id 'status' in DataTable use pTemplate="statusIdTableFilterCell" + */ + @Input() customTableFilterCellTemplate: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column filter + * use the new approach instead by following the naming convention column id + IdTableFilterCell + * e.g. for a column with the id 'status' in DataTable use pTemplate="statusIdTableFilterCell" + */ + @ContentChild('customTableFilterCell') customTableFilterCellChildTemplate: TemplateRef | undefined + get _customTableFilterCell(): TemplateRef | undefined { + return this.customTableFilterCellTemplate || this.customTableFilterCellChildTemplate + } @Input() additionalActions: DataAction[] = [] @@ -391,6 +438,27 @@ export class DataViewComponent implements DoCheck, OnInit, AfterContentInit { case 'dateListValue': this.dateListValueChildTemplate = item.template break + case 'tableFilterCell': + this.tableFilterCellChildTemplate = item.template + break + case 'dateTableFilterCell': + this.dateTableFilterCellChildTemplate = item.template + break + case 'relativeDateTableFilterCell': + this.relativeDateTableFilterCellChildTemplate = item.template + break + case 'translationKeyTableFilterCell': + this.translationKeyTableFilterCellChildTemplate = item.template + break + case 'stringTableFilterCell': + this.stringTableFilterCellChildTemplate = item.template + break + case 'numberTableFilterCell': + this.numberTableFilterCellChildTemplate = item.template + break + case 'customTableFilterCell': + this.customTableFilterCellChildTemplate = item.template + break } }) } diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html index 515e13c0..bc8d650e 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html @@ -94,6 +94,13 @@ [stringListValueTemplate]="_stringListValue ? stringListValue : undefined" [dateListValueTemplate]="_dateListValue ? dateListValue : undefined" [gridItemTemplate]="_gridItem ? gridItem : undefined" + [tableFilterCellTemplate]="_tableFilterCell ? tableFilterCell : undefined" + [dateTableFilterCellTemplate]="_dateTableFilterCell ? dateTableFilterCell : undefined" + [customTableFilterCellTemplate]="_customTableFilterCell ? customTableFilterCell : undefined" + [numberTableFilterCellTemplate]="_numberTableFilterCell ? numberTableFilterCell : undefined" + [stringTableFilterCellTemplate]="_stringTableFilterCell ? stringTableFilterCell : undefined" + [relativeDateTableFilterCellTemplate]="_relativeDateTableFilterCell ? relativeDateTableFilterCell : undefined" + [translationKeyTableFilterCellTemplate]="_translationKeyTableFilterCell ? translationKeyTableFilterCell : undefined" (sorted)="sorting($event)" (filtered)="filtering($event)" [totalRecordsOnServer]="totalRecordsOnServer" @@ -246,4 +253,53 @@ [ngTemplateOutletContext]="{rowObject: rowObject, column:column}" >
\ No newline at end of file +> + + + + + + + + + + + + + + + + + + + diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts index f111309c..1e775996 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts @@ -127,6 +127,18 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { @ContentChild('customListValue') customListValue: TemplateRef | undefined @ContentChild('stringListValue') stringListValue: TemplateRef | undefined @ContentChild('dateListValue') dateListValue: TemplateRef | undefined + @ContentChild('tableFilterCell') tableFilterCell: TemplateRef | undefined + @ContentChild('dateTableFilterCell') dateTableFilterCell: TemplateRef | undefined + @ContentChild('relativeDateTableFilterCell') relativeDateTableFilterCell: TemplateRef | undefined + @ContentChild('translationKeyTableFilterCell') translationKeyTableFilterCell: TemplateRef | undefined + @ContentChild('stringTableFilterCell') stringTableFilterCell: TemplateRef | undefined + @ContentChild('numberTableFilterCell') numberTableFilterCell: TemplateRef | undefined + /** + * @deprecated Will be removed and instead to change the template of a specific column filter + * use the new approach instead by following the naming convention column id + IdTableFilterCell + * e.g. for a column with the id 'status' in DataTable use pTemplate="statusIdTableFilterCell" + */ + @ContentChild('customTableFilterCell') customTableFilterCell: TemplateRef | undefined templates$: BehaviorSubject | undefined> = new BehaviorSubject< QueryList | undefined @@ -224,6 +236,27 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { get _dateListValue(): TemplateRef | undefined { return this.dateListValue } + get _tableFilterCell(): TemplateRef | undefined { + return this.tableFilterCell + } + get _dateTableFilterCell(): TemplateRef | undefined { + return this.dateTableFilterCell + } + get _relativeDateTableFilterCell(): TemplateRef | undefined { + return this.relativeDateTableFilterCell + } + get _translationKeyTableFilterCell(): TemplateRef | undefined { + return this.translationKeyTableFilterCell + } + get _stringTableFilterCell(): TemplateRef | undefined { + return this.stringTableFilterCell + } + get _numberTableFilterCell(): TemplateRef | undefined { + return this.numberTableFilterCell + } + get _customTableFilterCell(): TemplateRef | undefined { + return this.customTableFilterCell + } _data: RowListGridData[] = [] @Input() @@ -318,6 +351,27 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { case 'dateListValue': this.dateListValue = item.template break + case 'tableFilterCell': + this.tableFilterCell = item.template + break + case 'dateTableFilterCell': + this.dateTableFilterCell = item.template + break + case 'relativeDateTableFilterCell': + this.relativeDateTableFilterCell = item.template + break + case 'translationKeyTableFilterCell': + this.translationKeyTableFilterCell = item.template + break + case 'stringTableFilterCell': + this.stringTableFilterCell = item.template + break + case 'numberTableFilterCell': + this.numberTableFilterCell = item.template + break + case 'customTableFilterCell': + this.customTableFilterCell = item.template + break } }) } From 8126189dd0dccbe4fabad57582f53ae700fa259a Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Thu, 22 Aug 2024 17:02:52 +0200 Subject: [PATCH 10/24] fix: add Apache 2.0 open source license (#420) * fix: update angular versions * fix: add Apache 2.0 license --------- Co-authored-by: kim.tran Co-authored-by: Annika Nowak <139357202+anninowak@users.noreply.github.com> Co-authored-by: markuczy <129275100+markuczy@users.noreply.github.com> --- libs/accelerator/package.json | 1 + libs/angular-accelerator/package.json | 1 + libs/angular-auth/package.json | 1 + libs/angular-integration-interface/package.json | 1 + libs/angular-remote-components/package.json | 1 + libs/angular-testing/package.json | 1 + libs/angular-webcomponents/package.json | 1 + libs/integration-interface/package.json | 1 + libs/keycloak-auth/package.json | 1 + libs/portal-integration-angular/package.json | 1 + libs/portal-layout-styles/package.json | 1 + libs/shell-core/package.json | 1 + package-lock.json | 7 ++++--- 13 files changed, 16 insertions(+), 3 deletions(-) diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 8ecef80e..8a3fed43 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/accelerator", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1" diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 4229c89b..876f6a56 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/angular-accelerator", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 11666a9e..3b49b3a7 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/angular-auth", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", "@angular/common": "^18.0.5", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index d86b112a..0f03621b 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/angular-integration-interface", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", "@onecx/integration-interface": "~5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index 1ba28f25..11eedca1 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/angular-remote-components", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index 573de4af..5a3fed7f 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/angular-testing", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", "primeng": "^17.18.6" diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index 915f7ee3..ea56b7ff 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/angular-webcomponents", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/platform-browser": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 9d29b5a2..f655b73b 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/integration-interface", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", "rxjs": "7.8.1", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index eefb13e9..bf933ccf 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/keycloak-auth", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 5102c3a4..d94d4f67 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/portal-integration-angular", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", "@angular/core": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index f5edbb5a..47420bcc 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/portal-layout-styles", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" }, diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index b2b37131..ff21a6cf 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,7 @@ { "name": "@onecx/shell-core", "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", "@angular/animations": "^18.0.5", diff --git a/package-lock.json b/package-lock.json index 2197c7b3..d6a24979 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.5.0", + "version": "5.7.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.5.0", + "version": "5.7.0", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -115,7 +115,8 @@ }, "libs/portal-layout-styles": { "name": "@onecx/portal-layout-styles", - "version": "5.5.0", + "version": "5.7.0", + "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" } From 023dd8b24a696b35ff4662a402d16d80a60cd9ee Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 23 Aug 2024 07:14:21 +0000 Subject: [PATCH 11/24] chore(release): -v5.8.0 [skip ci] ## [5.8.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.7.0...v5.8.0) (2024-08-23) ### Features * filter templates for data-table ([#416](https://github.com/onecx/onecx-portal-ui-libs/issues/416)) ([ff38854](https://github.com/onecx/onecx-portal-ui-libs/commit/ff3885410499476e25e6e95a286af32ed45a1769)) ### Bug Fixes * add Apache 2.0 open source license ([#420](https://github.com/onecx/onecx-portal-ui-libs/issues/420)) ([8126189](https://github.com/onecx/onecx-portal-ui-libs/commit/8126189dd0dccbe4fabad57582f53ae700fa259a)) --- CHANGELOG.md | 10 ++++++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 14 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a12b736b..50e00bef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [5.8.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.7.0...v5.8.0) (2024-08-23) + +### Features + +* filter templates for data-table ([#416](https://github.com/onecx/onecx-portal-ui-libs/issues/416)) ([ff38854](https://github.com/onecx/onecx-portal-ui-libs/commit/ff3885410499476e25e6e95a286af32ed45a1769)) + +### Bug Fixes + +* add Apache 2.0 open source license ([#420](https://github.com/onecx/onecx-portal-ui-libs/issues/420)) ([8126189](https://github.com/onecx/onecx-portal-ui-libs/commit/8126189dd0dccbe4fabad57582f53ae700fa259a)) + ## [5.7.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.6.0...v5.7.0) (2024-08-22) ### Features diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 8a3fed43..337b68a5 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 876f6a56..75488a71 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 3b49b3a7..02050ced 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index 0f03621b..726f776c 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index 11eedca1..e3a09ad8 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index 5a3fed7f..df86dbbd 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index ea56b7ff..2bdf70f0 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index f655b73b..efd9ceb1 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index bf933ccf..26eec995 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index d94d4f67..2399358f 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index 47420bcc..3b1b9ee7 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index ff21a6cf..7ed1eca0 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", diff --git a/package.json b/package.json index a7a53475..2d3d73d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.7.0", + "version": "5.8.0", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From d3007a1a2ab5b743b00e5bfdf63aab6149809ea0 Mon Sep 17 00:00:00 2001 From: Bastian Jakobi <55296998+bastianjakobi@users.noreply.github.com> Date: Mon, 26 Aug 2024 14:17:36 +0200 Subject: [PATCH 12/24] feat: create ngrx-accelerator (#399) * feat: initialize new lib * feat: add ngrx utils to lib and deprecate ngrx utils in pia * fix: linter error * fix: add missing dependencies * fix: fix typing issues * feat: add navigationMergeReducer * fix: add missing dependency * fix: fix linting * feat: add lazyLoadingMergeReducer to ngrx-accelerator * fix: fix linting issue --- libs/ngrx-accelerator/.eslintrc.json | 40 +++++++++++++ libs/ngrx-accelerator/README.md | 7 +++ libs/ngrx-accelerator/jest.config.ts | 22 +++++++ libs/ngrx-accelerator/ng-package.json | 10 ++++ libs/ngrx-accelerator/package.json | 22 +++++++ libs/ngrx-accelerator/project.json | 47 +++++++++++++++ libs/ngrx-accelerator/src/index.ts | 11 ++++ .../effects/create-query-params-effect.ts | 32 ++++++++++ .../utils/effects/filter-for-navigated-to.ts | 30 ++++++++++ .../filter-for-only-query-params-changed.ts | 34 +++++++++++ .../filter-for-query-params-changed.ts | 59 +++++++++++++++++++ .../lazy-loading-merge-reducer.ts | 22 +++++++ .../utils/selectors/create-child-selectors.ts | 26 ++++++++ libs/ngrx-accelerator/src/test-setup.ts | 8 +++ libs/ngrx-accelerator/tsconfig.json | 28 +++++++++ libs/ngrx-accelerator/tsconfig.lib.json | 12 ++++ libs/ngrx-accelerator/tsconfig.spec.json | 11 ++++ .../ngrx/create-child-selectors.ts | 3 + .../ngrx/create-query-params-effect.ts | 3 + .../ngrx/filter-for-navigated-to.ts | 3 + .../filter-for-only-query-params-changed.ts | 3 + .../ngrx/filter-for-query-params-changed.ts | 3 + nx.json | 37 +++--------- package-lock.json | 23 ++++++-- package.json | 2 + tsconfig.base.json | 1 + 26 files changed, 463 insertions(+), 36 deletions(-) create mode 100644 libs/ngrx-accelerator/.eslintrc.json create mode 100644 libs/ngrx-accelerator/README.md create mode 100644 libs/ngrx-accelerator/jest.config.ts create mode 100644 libs/ngrx-accelerator/ng-package.json create mode 100644 libs/ngrx-accelerator/package.json create mode 100644 libs/ngrx-accelerator/project.json create mode 100644 libs/ngrx-accelerator/src/index.ts create mode 100644 libs/ngrx-accelerator/src/lib/utils/effects/create-query-params-effect.ts create mode 100644 libs/ngrx-accelerator/src/lib/utils/effects/filter-for-navigated-to.ts create mode 100644 libs/ngrx-accelerator/src/lib/utils/effects/filter-for-only-query-params-changed.ts create mode 100644 libs/ngrx-accelerator/src/lib/utils/effects/filter-for-query-params-changed.ts create mode 100644 libs/ngrx-accelerator/src/lib/utils/local-storage/lazy-loading-merge-reducer.ts create mode 100644 libs/ngrx-accelerator/src/lib/utils/selectors/create-child-selectors.ts create mode 100644 libs/ngrx-accelerator/src/test-setup.ts create mode 100644 libs/ngrx-accelerator/tsconfig.json create mode 100644 libs/ngrx-accelerator/tsconfig.lib.json create mode 100644 libs/ngrx-accelerator/tsconfig.spec.json diff --git a/libs/ngrx-accelerator/.eslintrc.json b/libs/ngrx-accelerator/.eslintrc.json new file mode 100644 index 00000000..4557503f --- /dev/null +++ b/libs/ngrx-accelerator/.eslintrc.json @@ -0,0 +1,40 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": ["plugin:@nx/angular", "plugin:@angular-eslint/template/process-inline-templates"], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "ocx", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "ocx", + "style": "kebab-case" + } + ] + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": "error" + } + } + ] +} diff --git a/libs/ngrx-accelerator/README.md b/libs/ngrx-accelerator/README.md new file mode 100644 index 00000000..212412a1 --- /dev/null +++ b/libs/ngrx-accelerator/README.md @@ -0,0 +1,7 @@ +# ngrx-accelerator + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test ngrx-accelerator` to execute the unit tests. diff --git a/libs/ngrx-accelerator/jest.config.ts b/libs/ngrx-accelerator/jest.config.ts new file mode 100644 index 00000000..fe363561 --- /dev/null +++ b/libs/ngrx-accelerator/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'ngrx-accelerator', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../coverage/libs/ngrx-accelerator', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], +} diff --git a/libs/ngrx-accelerator/ng-package.json b/libs/ngrx-accelerator/ng-package.json new file mode 100644 index 00000000..b600f8d9 --- /dev/null +++ b/libs/ngrx-accelerator/ng-package.json @@ -0,0 +1,10 @@ +{ + "$schema": "../../node_modules/ng-packagr/ng-package.schema.json", + "dest": "../../dist/libs/ngrx-accelerator", + "lib": { + "entryFile": "src/index.ts" + }, + "assets": [ + "CHANGELOG.md" + ] +} \ No newline at end of file diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json new file mode 100644 index 00000000..0dd4ae59 --- /dev/null +++ b/libs/ngrx-accelerator/package.json @@ -0,0 +1,22 @@ +{ + "name": "@onecx/ngrx-accelerator", + "version": "5.3.2", + "peerDependencies": { + "@angular/core": "^18.0.5", + "@angular/router": "^18.0.5", + "deepmerge": "^4.3.1", + "fast-deep-equal": "^3.1.3", + "@ngrx/effects": "^18.0.1", + "@ngrx/operators": "^18.0.1", + "@ngrx/router-store": "^18.0.1", + "@ngrx/store": "^18.0.1", + "rxjs": "7.8.1", + "tslib": "^2.6.3", + "zod": "^3.23.8" + }, + "main": "./src/index.js", + "typings": "./src/index.d.ts", + "publishConfig": { + "access": "public" + } +} diff --git a/libs/ngrx-accelerator/project.json b/libs/ngrx-accelerator/project.json new file mode 100644 index 00000000..d2e0d49c --- /dev/null +++ b/libs/ngrx-accelerator/project.json @@ -0,0 +1,47 @@ +{ + "name": "ngrx-accelerator", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/ngrx-accelerator/src", + "prefix": "lib", + "projectType": "library", + "tags": [], + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/libs/ngrx-accelerator", + "main": "libs/ngrx-accelerator/src/index.ts", + "tsConfig": "libs/ngrx-accelerator/tsconfig.lib.json", + "assets": ["libs/ngrx-accelerator/*.md"] + } + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/ngrx-accelerator/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["libs/ngrx-accelerator/**/*.ts", "libs/ngrx-accelerator/package.json"] + } + }, + "release": { + "executor": "nx-release:build-update-publish", + "options": { + "libName": "ngrx-accelerator" + } + } + } +} diff --git a/libs/ngrx-accelerator/src/index.ts b/libs/ngrx-accelerator/src/index.ts new file mode 100644 index 00000000..f457c2fe --- /dev/null +++ b/libs/ngrx-accelerator/src/index.ts @@ -0,0 +1,11 @@ +// Effects +export * from './lib/utils/effects/create-query-params-effect' +export * from './lib/utils/effects/filter-for-navigated-to' +export * from './lib/utils/effects/filter-for-only-query-params-changed' +export * from './lib/utils/effects/filter-for-query-params-changed' + +// Selectors +export * from './lib/utils/selectors/create-child-selectors' + +// Local Storage +export * from './lib/utils/local-storage/lazy-loading-merge-reducer' \ No newline at end of file diff --git a/libs/ngrx-accelerator/src/lib/utils/effects/create-query-params-effect.ts b/libs/ngrx-accelerator/src/lib/utils/effects/create-query-params-effect.ts new file mode 100644 index 00000000..fea8eab4 --- /dev/null +++ b/libs/ngrx-accelerator/src/lib/utils/effects/create-query-params-effect.ts @@ -0,0 +1,32 @@ +import { ActivatedRoute, Router } from '@angular/router' +import { Actions, createEffect, ofType } from '@ngrx/effects' +import { concatLatestFrom } from '@ngrx/operators' +import { ActionCreator, Creator } from '@ngrx/store' +import { tap } from 'rxjs' + +export function createQueryParamsEffect>( + actions$: Actions, + actionType: AC, + router: Router, + activatedRoute: ActivatedRoute, + reducer: (state: Record, action: ReturnType) => Record +) { + return createEffect( + () => { + return actions$.pipe( + ofType(actionType), + concatLatestFrom(() => activatedRoute.queryParams), + tap(([action, queryParams]) => { + const params = reducer(queryParams, action) + router.navigate([], { + relativeTo: activatedRoute, + queryParams: params, + replaceUrl: true, + onSameUrlNavigation: 'reload', + }) + }) + ) + }, + { dispatch: false } + ) +} diff --git a/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-navigated-to.ts b/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-navigated-to.ts new file mode 100644 index 00000000..d2669c93 --- /dev/null +++ b/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-navigated-to.ts @@ -0,0 +1,30 @@ +import { filter, MonoTypeOperatorFunction } from 'rxjs' +import { ActivatedRoute, Router } from '@angular/router' +import { Type } from '@angular/core' +import { RouterNavigatedAction } from '@ngrx/router-store' + +export function filterForNavigatedTo( + router: Router, + component: Type +): MonoTypeOperatorFunction { + return (source) => { + return source.pipe( + filter(() => { + return checkForComponent(component, router.routerState.root) + }) + ) + } +} + +function checkForComponent(component: any, route: ActivatedRoute): boolean { + if (route.component === component) { + return true + } + for (const c of route.children) { + const r = checkForComponent(component, c) + if (r) { + return true + } + } + return false +} diff --git a/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-only-query-params-changed.ts b/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-only-query-params-changed.ts new file mode 100644 index 00000000..d9977b65 --- /dev/null +++ b/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-only-query-params-changed.ts @@ -0,0 +1,34 @@ +import { Router, RoutesRecognized } from '@angular/router' +import { RouterNavigatedAction } from '@ngrx/router-store' +import { filter, map, MonoTypeOperatorFunction, withLatestFrom } from 'rxjs' + +/** + * @deprecated use filterOutOnlyQueryParamsChanged + */ +export function filterForOnlyQueryParamsChanged( + router: Router +): MonoTypeOperatorFunction { + return filterOutOnlyQueryParamsChanged(router) +} + +export function filterOutOnlyQueryParamsChanged( + router: Router +): MonoTypeOperatorFunction { + return (source) => { + return source.pipe( + withLatestFrom( + router.events.pipe( + filter((e) => e instanceof RoutesRecognized), + map(() => router.routerState) + ) + ), + filter(([action, previousRouterState]) => { + const previousPath = previousRouterState.snapshot.url.split('?')[0] + const currentPath = action.payload.event.urlAfterRedirects.split('?')[0] + + return previousPath !== currentPath + }), + map(([action]) => action) + ) + } +} diff --git a/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-query-params-changed.ts b/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-query-params-changed.ts new file mode 100644 index 00000000..b53cef21 --- /dev/null +++ b/libs/ngrx-accelerator/src/lib/utils/effects/filter-for-query-params-changed.ts @@ -0,0 +1,59 @@ +import { RouterNavigatedAction } from '@ngrx/router-store' +import { ZodType } from 'zod' +import { MonoTypeOperatorFunction, filter, withLatestFrom, map } from 'rxjs' +import equal from 'fast-deep-equal' +import { Router, RoutesRecognized } from '@angular/router' + +/** + * @deprecated use filterOutQueryParamsHaveNotChanged + */ +export function filterForQueryParamsChanged( + router: Router, + queryParamsTypeDef: ZodType, + allowEmptyQueryParamsList = false +): MonoTypeOperatorFunction { + return filterOutQueryParamsHaveNotChanged(router, queryParamsTypeDef, allowEmptyQueryParamsList) +} + +export function filterOutQueryParamsHaveNotChanged( + router: Router, + queryParamsTypeDef: ZodType, + allowEmptyQueryParamsList = false +): MonoTypeOperatorFunction { + return (source) => { + return source.pipe( + withLatestFrom( + router.events.pipe( + filter((e) => e instanceof RoutesRecognized), + map(() => router.routerState) + ) + ), + filter(([action, previousRouterState]) => { + if ( + !allowEmptyQueryParamsList && + Object.keys(action?.payload?.routerState?.root?.queryParams || {}).length === 0 + ) { + return false + } + const currentQueryParams = previousRouterState.snapshot.root.queryParams + const actionResult = queryParamsTypeDef.safeParse(action?.payload?.routerState?.root?.queryParams) + const currentResult = queryParamsTypeDef.safeParse(currentQueryParams) + + if (actionResult.success && currentResult.success) { + const actionParams = actionResult.data + const currentParams = currentResult.data + if ( + allowEmptyQueryParamsList && + Object.keys(actionParams).length === 0 && + Object.keys(currentParams).length === 0 + ) { + return true + } + return !equal(actionParams, currentParams) + } + return false + }), + map(([action]) => action) + ) + } +} diff --git a/libs/ngrx-accelerator/src/lib/utils/local-storage/lazy-loading-merge-reducer.ts b/libs/ngrx-accelerator/src/lib/utils/local-storage/lazy-loading-merge-reducer.ts new file mode 100644 index 00000000..469825d0 --- /dev/null +++ b/libs/ngrx-accelerator/src/lib/utils/local-storage/lazy-loading-merge-reducer.ts @@ -0,0 +1,22 @@ +import deepmerge from 'deepmerge' + +export const lazyLoadingMergeReducer = (state: any, rehydratedState: any, _action: any) => { + const overwriteMerge = (_destinationArray: any, sourceArray: any, _options: any) => sourceArray + const options: deepmerge.Options = { + arrayMerge: overwriteMerge, + } + const keysToRehydrate = Object.keys(rehydratedState).filter((key) => state[key]) + if (keysToRehydrate.length) { + const stateToRehydrate = Object.keys(rehydratedState).reduce((acc: Record, key) => { + if (keysToRehydrate.includes(key)) { + acc[key] = rehydratedState[key] + } + return acc + }, {}) + state = deepmerge(state, stateToRehydrate, options) + keysToRehydrate.forEach((key) => { + delete rehydratedState[key] + }) + } + return state +} diff --git a/libs/ngrx-accelerator/src/lib/utils/selectors/create-child-selectors.ts b/libs/ngrx-accelerator/src/lib/utils/selectors/create-child-selectors.ts new file mode 100644 index 00000000..efadae1e --- /dev/null +++ b/libs/ngrx-accelerator/src/lib/utils/selectors/create-child-selectors.ts @@ -0,0 +1,26 @@ +import { MemoizedSelector, createSelector } from '@ngrx/store' + +type Primitive = string | number | bigint | boolean | null | undefined + +type ChildSelectors, ChildState> = ChildState extends Primitive | unknown[] | Date + ? Record + : { + [K in keyof ChildState & string as `select${Capitalize}`]: MemoizedSelector + } + +function capitalize(text: T): Capitalize { + return (text.charAt(0).toUpperCase() + text.substring(1)) as Capitalize +} + +export function createChildSelectors, ChildState extends Record>( + featureSelector: MemoizedSelector, + initialChildState: ChildState +): ChildSelectors { + return Object.keys(initialChildState).reduce( + (nestedSelectors, nestedKey) => ({ + ...nestedSelectors, + [`select${capitalize(nestedKey)}`]: createSelector(featureSelector, (parentState) => parentState?.[nestedKey]), + }), + {} as ChildSelectors + ) +} diff --git a/libs/ngrx-accelerator/src/test-setup.ts b/libs/ngrx-accelerator/src/test-setup.ts new file mode 100644 index 00000000..a5e675ac --- /dev/null +++ b/libs/ngrx-accelerator/src/test-setup.ts @@ -0,0 +1,8 @@ +// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment +globalThis.ngJest = { + testEnvironmentOptions: { + errorOnUnknownElements: true, + errorOnUnknownProperties: true, + }, +} +import 'jest-preset-angular/setup-jest' diff --git a/libs/ngrx-accelerator/tsconfig.json b/libs/ngrx-accelerator/tsconfig.json new file mode 100644 index 00000000..56deb89f --- /dev/null +++ b/libs/ngrx-accelerator/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "es2022", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/libs/ngrx-accelerator/tsconfig.lib.json b/libs/ngrx-accelerator/tsconfig.lib.json new file mode 100644 index 00000000..4cab05d4 --- /dev/null +++ b/libs/ngrx-accelerator/tsconfig.lib.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": ["src/**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/libs/ngrx-accelerator/tsconfig.spec.json b/libs/ngrx-accelerator/tsconfig.spec.json new file mode 100644 index 00000000..7870b7c0 --- /dev/null +++ b/libs/ngrx-accelerator/tsconfig.spec.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"] +} diff --git a/libs/portal-integration-angular/ngrx/create-child-selectors.ts b/libs/portal-integration-angular/ngrx/create-child-selectors.ts index efadae1e..80c048b5 100644 --- a/libs/portal-integration-angular/ngrx/create-child-selectors.ts +++ b/libs/portal-integration-angular/ngrx/create-child-selectors.ts @@ -12,6 +12,9 @@ function capitalize(text: T): Capitalize { return (text.charAt(0).toUpperCase() + text.substring(1)) as Capitalize } +/** + * @deprecated Please import from \@onecx/ngrx-accelerator + */ export function createChildSelectors, ChildState extends Record>( featureSelector: MemoizedSelector, initialChildState: ChildState diff --git a/libs/portal-integration-angular/ngrx/create-query-params-effect.ts b/libs/portal-integration-angular/ngrx/create-query-params-effect.ts index fea8eab4..f26653e2 100644 --- a/libs/portal-integration-angular/ngrx/create-query-params-effect.ts +++ b/libs/portal-integration-angular/ngrx/create-query-params-effect.ts @@ -4,6 +4,9 @@ import { concatLatestFrom } from '@ngrx/operators' import { ActionCreator, Creator } from '@ngrx/store' import { tap } from 'rxjs' +/** + * @deprecated Please import from \@onecx/ngrx-accelerator + */ export function createQueryParamsEffect>( actions$: Actions, actionType: AC, diff --git a/libs/portal-integration-angular/ngrx/filter-for-navigated-to.ts b/libs/portal-integration-angular/ngrx/filter-for-navigated-to.ts index d2669c93..78a8eddf 100644 --- a/libs/portal-integration-angular/ngrx/filter-for-navigated-to.ts +++ b/libs/portal-integration-angular/ngrx/filter-for-navigated-to.ts @@ -3,6 +3,9 @@ import { ActivatedRoute, Router } from '@angular/router' import { Type } from '@angular/core' import { RouterNavigatedAction } from '@ngrx/router-store' +/** + * @deprecated Please import from \@onecx/ngrx-accelerator + */ export function filterForNavigatedTo( router: Router, component: Type diff --git a/libs/portal-integration-angular/ngrx/filter-for-only-query-params-changed.ts b/libs/portal-integration-angular/ngrx/filter-for-only-query-params-changed.ts index d9977b65..955d8265 100644 --- a/libs/portal-integration-angular/ngrx/filter-for-only-query-params-changed.ts +++ b/libs/portal-integration-angular/ngrx/filter-for-only-query-params-changed.ts @@ -11,6 +11,9 @@ export function filterForOnlyQueryParamsChanged return filterOutOnlyQueryParamsChanged(router) } +/** + * @deprecated Please import from \@onecx/ngrx-accelerator + */ export function filterOutOnlyQueryParamsChanged( router: Router ): MonoTypeOperatorFunction { diff --git a/libs/portal-integration-angular/ngrx/filter-for-query-params-changed.ts b/libs/portal-integration-angular/ngrx/filter-for-query-params-changed.ts index b53cef21..bd2c1d10 100644 --- a/libs/portal-integration-angular/ngrx/filter-for-query-params-changed.ts +++ b/libs/portal-integration-angular/ngrx/filter-for-query-params-changed.ts @@ -15,6 +15,9 @@ export function filterForQueryParamsChanged( return filterOutQueryParamsHaveNotChanged(router, queryParamsTypeDef, allowEmptyQueryParamsList) } +/** + * @deprecated Please import from \@onecx/ngrx-accelerator + */ export function filterOutQueryParamsHaveNotChanged( router: Router, queryParamsTypeDef: ZodType, diff --git a/nx.json b/nx.json index 3ba47634..ff794c37 100644 --- a/nx.json +++ b/nx.json @@ -4,32 +4,17 @@ "default": { "runner": "nx/tasks-runners/default", "options": { - "cacheableOperations": [ - "build", - "lint", - "test", - "e2e", - "build-storybook" - ] + "cacheableOperations": ["build", "lint", "test", "e2e", "build-storybook"] } } }, "targetDefaults": { "build": { - "dependsOn": [ - "^build" - ], - "inputs": [ - "production", - "^production" - ] + "dependsOn": ["^build"], + "inputs": ["production", "^production"] }, "test": { - "inputs": [ - "default", - "^production", - "{workspaceRoot}/jest.preset.js" - ] + "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"] }, "lint": { "inputs": [ @@ -40,19 +25,11 @@ ] }, "build-storybook": { - "inputs": [ - "default", - "^production", - "{projectRoot}/.storybook/**/*", - "{projectRoot}/tsconfig.storybook.json" - ] + "inputs": ["default", "^production", "{projectRoot}/.storybook/**/*", "{projectRoot}/tsconfig.storybook.json"] } }, "namedInputs": { - "default": [ - "{projectRoot}/**/*", - "sharedGlobals" - ], + "default": ["{projectRoot}/**/*", "sharedGlobals"], "production": [ "default", "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", @@ -83,4 +60,4 @@ "style": "scss" } } -} \ No newline at end of file +} diff --git a/package-lock.json b/package-lock.json index d6a24979..95b8df03 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,11 +78,13 @@ "@storybook/core-server": "^8.2.8", "@swc-node/register": "~1.10.0", "@swc/core": "~1.7.10", + "@swc/helpers": "~0.5.11", "@types/d3": "^7.4.3", "@types/jest": "^29.5.12", "@types/node": "~22.4.0", "@typescript-eslint/eslint-plugin": "7.17.0", "@typescript-eslint/parser": "7.18.0", + "@typescript-eslint/utils": "^7.16.0", "blob-polyfill": "^9.0.20240710", "conventional-changelog-conventionalcommits": "^8.0.0", "esbuild": "^0.19.2", @@ -9561,9 +9563,9 @@ "peer": true }, "node_modules/@pnpm/npm-conf": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.0.tgz", - "integrity": "sha512-DqrO+oXGR7HCuicNy6quk6ALJSDDPKI7RZz1bP5im8mSL8J2e+9w26LdkjuAfpAjOutYUJVbnXnx4IbTQeIgfw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@pnpm/npm-conf/-/npm-conf-2.3.1.tgz", + "integrity": "sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==", "dev": true, "peer": true, "dependencies": { @@ -10066,9 +10068,9 @@ } }, "node_modules/@semantic-release/github": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-10.1.3.tgz", - "integrity": "sha512-QVw7YT3J4VqyVjOnlRsFA3OCERAJHER4QbSPupbav3ER0fawrs2BAWbQFjsr24OAD4KTTKMZsVzF+GYFWCDtaQ==", + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/@semantic-release/github/-/github-10.1.4.tgz", + "integrity": "sha512-dg+JTNp1XHazwAx9HgIuVewStfpv5g7QqwBF09aZVqwVkdTXw4agR/nhWSD0yxDbsx0YCeJTcjUOj92gf8/0Jw==", "dev": true, "peer": true, "dependencies": { @@ -11847,6 +11849,15 @@ "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", "dev": true }, + "node_modules/@swc/helpers": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.12.tgz", + "integrity": "sha512-KMZNXiGibsW9kvZAO1Pam2JPTDBm+KSHMMHWdsyI/1DbIZjT2A6Gy3hblVXUMEDvUAKq+e0vL0X0o54owWji7g==", + "dev": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@swc/types": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/@swc/types/-/types-0.1.12.tgz", diff --git a/package.json b/package.json index 2d3d73d3..7466c5c6 100644 --- a/package.json +++ b/package.json @@ -77,11 +77,13 @@ "@storybook/core-server": "^8.2.8", "@swc-node/register": "~1.10.0", "@swc/core": "~1.7.10", + "@swc/helpers": "~0.5.11", "@types/d3": "^7.4.3", "@types/jest": "^29.5.12", "@types/node": "~22.4.0", "@typescript-eslint/eslint-plugin": "7.17.0", "@typescript-eslint/parser": "7.18.0", + "@typescript-eslint/utils": "^7.16.0", "blob-polyfill": "^9.0.20240710", "conventional-changelog-conventionalcommits": "^8.0.0", "esbuild": "^0.19.2", diff --git a/tsconfig.base.json b/tsconfig.base.json index eec484a8..fc6d9f85 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -27,6 +27,7 @@ "@onecx/angular-webcomponents": ["libs/angular-webcomponents/src/index.ts"], "@onecx/integration-interface": ["libs/integration-interface/src/index.ts"], "@onecx/keycloak-auth": ["libs/keycloak-auth/src/index.ts"], + "@onecx/ngrx-accelerator": ["libs/ngrx-accelerator/src/index.ts"], "@onecx/portal-integration-angular": ["libs/portal-integration-angular/src/index.ts"], "@onecx/portal-integration-angular/mocks": ["libs/portal-integration-angular/mocks/index.ts"], "@onecx/portal-integration-angular/testing": ["libs/portal-integration-angular/testing/index.ts"], From 622ed48221849c418e4f8c4a2f72ea139be30e17 Mon Sep 17 00:00:00 2001 From: Bastian Jakobi <55296998+bastianjakobi@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:29:16 +0200 Subject: [PATCH 13/24] feat: publish UI state change events for lib components (#395) * feat: emit componentStateChanged event for diagram components * feat: emit componentStateChanged event for search header component * feat: add component state publishing to all data components (WIP) * feat: add component state publishing to all data components (WIP) * fix: fix minor bugs and remove logs * fix: fix linter errors * fix: fix test error * fix: emit correct data from components to prevent accidental overwrites * fix: deprecate displayedColumns + add displayedColumnKeys input * fix: add displayedColumns$ BehaviorSubject for use in template * fix: fix pageSize emit error in data-list-grid --- .../column-group-selection.component.ts | 17 +++ .../custom-group-column-selector.component.ts | 42 ++++++- .../data-layout-selection.component.ts | 10 ++ .../data-list-grid-sorting.component.ts | 23 +++- .../data-list-grid.component.ts | 29 ++++- .../data-table/data-table.component.ts | 50 ++++++++- .../data-view/data-view.component.html | 4 + .../data-view/data-view.component.ts | 39 ++++++- .../components/diagram/diagram.component.ts | 9 ++ .../group-by-count-diagram.component.ts | 8 ++ .../interactive-data-view.component.html | 10 +- ...interactive-data-view.component.stories.ts | 16 ++- .../interactive-data-view.component.ts | 106 ++++++++++++++++-- .../search-header/search-header.component.ts | 12 ++ .../src/lib/utils/rxjs-utils.ts | 16 +++ 15 files changed, 367 insertions(+), 24 deletions(-) create mode 100644 libs/angular-accelerator/src/lib/utils/rxjs-utils.ts diff --git a/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.ts b/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.ts index e04e0959..7ca63afb 100644 --- a/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.ts +++ b/libs/angular-accelerator/src/lib/components/column-group-selection/column-group-selection.component.ts @@ -3,6 +3,10 @@ import { BehaviorSubject, combineLatest, map, Observable } from 'rxjs' import { DataTableColumn } from '../../model/data-table-column.model' export type GroupSelectionChangedEvent = { activeColumns: DataTableColumn[]; groupKey: string } +export interface ColumnGroupSelectionComponentState { + activeColumnGroupKey?: string + displayedColumns?: DataTableColumn[] +} @Component({ templateUrl: './column-group-selection.component.html', selector: 'ocx-column-group-selection', @@ -31,6 +35,7 @@ export class ColumnGroupSelectionComponent implements OnInit { @Input() customGroupKey = '' @Output() groupSelectionChanged: EventEmitter = new EventEmitter() + @Output() componentStateChanged: EventEmitter = new EventEmitter() allGroupKeys$: Observable | undefined @@ -46,6 +51,10 @@ export class ColumnGroupSelectionComponent implements OnInit { .filter((value, index, self) => self.indexOf(value) === index && value != null) ) ) + this.componentStateChanged.emit({ + activeColumnGroupKey: this.selectedGroupKey, + displayedColumns: this.columns, + }) } changeGroupSelection(event: { value: string }) { @@ -54,6 +63,10 @@ export class ColumnGroupSelectionComponent implements OnInit { } const activeColumns = this.columns.filter((c) => c.predefinedGroupKeys?.includes(event.value)) this.groupSelectionChanged.emit({ activeColumns, groupKey: event.value }) + this.componentStateChanged.emit({ + activeColumnGroupKey: event.value, + displayedColumns: activeColumns + }) } clearGroupSelection() { @@ -62,5 +75,9 @@ export class ColumnGroupSelectionComponent implements OnInit { activeColumns = this.columns.filter((column) => column.predefinedGroupKeys?.includes(this.defaultGroupKey)) } this.groupSelectionChanged.emit({ activeColumns, groupKey: this.defaultGroupKey }) + this.componentStateChanged.emit({ + activeColumnGroupKey: this.defaultGroupKey, + displayedColumns: activeColumns + }) } } diff --git a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts index 492819b9..75a6e59e 100644 --- a/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts +++ b/libs/angular-accelerator/src/lib/components/custom-group-column-selector/custom-group-column-selector.component.ts @@ -1,4 +1,4 @@ -import { Component, EventEmitter, Input, Output } from '@angular/core' +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { TranslateService } from '@ngx-translate/core' import { DataTableColumn } from '../../model/data-table-column.model' @@ -8,12 +8,21 @@ export type ActionColumnChangedEvent = { actionColumnPosition: 'left' | 'right' } +export interface CustomGroupColumnSelectorComponentState { + actionColumnConfig?: { + frozen: boolean + position: 'left' | 'right' + } + displayedColumns?: DataTableColumn[] + activeColumnGroupKey?: string +} + @Component({ selector: 'ocx-custom-group-column-selector', templateUrl: './custom-group-column-selector.component.html', styleUrls: ['./custom-group-column-selector.component.scss'], }) -export class CustomGroupColumnSelectorComponent { +export class CustomGroupColumnSelectorComponent implements OnInit { @Input() columns: DataTableColumn[] = [] @Input() displayedColumns: DataTableColumn[] = [] @Input() dialogTitle = '' @@ -27,6 +36,7 @@ export class CustomGroupColumnSelectorComponent { @Output() columnSelectionChanged: EventEmitter = new EventEmitter() @Output() actionColumnConfigChanged: EventEmitter = new EventEmitter() + @Output() componentStateChanged: EventEmitter = new EventEmitter() hiddenColumnsModel: DataTableColumn[] = [] displayedColumnsModel: DataTableColumn[] = [] @@ -57,6 +67,16 @@ export class CustomGroupColumnSelectorComponent { constructor(private translate: TranslateService) {} + ngOnInit(): void { + this.componentStateChanged.emit({ + actionColumnConfig: { + frozen: this.frozenActionColumn, + position: this.actionColumnPosition, + }, + displayedColumns: this.displayedColumns, + }) + } + onOpenCustomGroupColumnSelectionDialogClick() { this.displayedColumnsModel = [...this.displayedColumns] this.hiddenColumnsModel = this.columns.filter( @@ -72,9 +92,16 @@ export class CustomGroupColumnSelectorComponent { const colIdsBefore = this.displayedColumns.map((column) => column.id) const colIdsAfter = this.displayedColumnsModel.map((column) => column.id) - if ((!colIdsAfter.every((colId, i) => colId === colIdsBefore[i])) || - colIdsAfter.length != colIdsBefore.length) { + if (!colIdsAfter.every((colId, i) => colId === colIdsBefore[i]) || colIdsAfter.length != colIdsBefore.length) { this.columnSelectionChanged.emit({ activeColumns: [...this.displayedColumnsModel] }) + this.componentStateChanged.emit({ + displayedColumns: [...this.displayedColumnsModel], + actionColumnConfig: { + frozen: this.frozenActionColumnModel, + position: this.actionColumnPositionModel, + }, + activeColumnGroupKey: undefined + }) } if ( @@ -85,6 +112,13 @@ export class CustomGroupColumnSelectorComponent { frozenActionColumn: this.frozenActionColumnModel, actionColumnPosition: this.actionColumnPositionModel, }) + this.componentStateChanged.emit({ + displayedColumns: [...this.displayedColumnsModel], + actionColumnConfig: { + frozen: this.frozenActionColumnModel, + position: this.actionColumnPositionModel, + }, + }) } } diff --git a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts index a603799e..f1d89afd 100644 --- a/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-layout-selection/data-layout-selection.component.ts @@ -15,6 +15,9 @@ const ALL_VIEW_LAYOUTS: ViewingLayouts[] = [ { icon: PrimeIcons.TABLE, layout: 'table', titleKey: 'OCX_DATA_LAYOUT_SELECTION.LAYOUT.TABLE' }, ] +export interface DataLayoutSelectionComponentState { + layout?: 'grid' | 'list' | 'table' +} @Component({ selector: 'ocx-data-layout-selection', templateUrl: './data-layout-selection.component.html', @@ -31,15 +34,22 @@ export class DataLayoutSelectionComponent implements OnInit { } @Output() dataViewLayoutChange: EventEmitter<'grid' | 'list' | 'table'> = new EventEmitter() + @Output() componentStateChanged: EventEmitter = new EventEmitter() viewingLayouts: ViewingLayouts[] = [] selectedViewLayout: ViewingLayouts | undefined ngOnInit(): void { this.viewingLayouts = ALL_VIEW_LAYOUTS.filter((vl) => this.supportedViewLayouts.includes(vl.layout)) + this.componentStateChanged.emit({ + layout: this.layout + }) } onDataViewLayoutChange(event: { icon: PrimeIcon; layout: 'grid' | 'list' | 'table' }): void { this.dataViewLayoutChange.emit(event.layout) + this.componentStateChanged.emit({ + layout: event.layout + }) } } diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.ts b/libs/angular-accelerator/src/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.ts index 38ea19de..39d0c761 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-list-grid-sorting/data-list-grid-sorting.component.ts @@ -3,6 +3,12 @@ import { BehaviorSubject } from 'rxjs' import { DataSortDirection } from '../../model/data-sort-direction' import { DataColumnNameId } from '../../model/data-column-name-id.model' import { DataTableColumn } from '../../model/data-table-column.model' +import { DropdownChangeEvent } from 'primeng/dropdown' + +export type ListGridSort = { sortColumn: string; sortDirection: DataSortDirection } +export interface DataListGridSortingComponentState { + sorting?: ListGridSort +} @Component({ selector: 'ocx-data-list-grid-sorting', @@ -31,6 +37,7 @@ export class DataListGridSortingComponent implements OnInit { @Output() sortChange: EventEmitter = new EventEmitter() @Output() sortDirectionChange: EventEmitter = new EventEmitter() + @Output() componentStateChanged: EventEmitter = new EventEmitter() @Output() columnsChange: EventEmitter = new EventEmitter() selectedSortingOption: DataColumnNameId | undefined dropdownOptions: DataColumnNameId[] = [] @@ -38,22 +45,34 @@ export class DataListGridSortingComponent implements OnInit { ngOnInit(): void { this.columns.forEach((element) => this.dropdownOptions.push({ columnId: element.id, columnName: element.nameKey })) this.selectedSortingOption = this.dropdownOptions.find((e) => e.columnId === this?.sortField) + this.emitComponentStateChange() } - selectSorting(event: any): void { - this._sortField$.next(event.value) + selectSorting(event: DropdownChangeEvent): void { + this._sortField$.next(event.value.columnId) this.sortChange.emit(event.value.columnId) + this.emitComponentStateChange() } sortDirectionChanged(): void { const newSortDirection = this.nextSortDirection() this._sortDirection$.next(newSortDirection) this.sortDirectionChange.emit(newSortDirection) + this.emitComponentStateChange() } nextSortDirection() { return this.sortStates[(this.sortStates.indexOf(this.sortDirection) + 1) % this.sortStates.length] } + emitComponentStateChange() { + this.componentStateChanged.emit({ + sorting: { + sortColumn: this.sortField, + sortDirection: this.sortDirection + } + }) + } + sortIcon() { switch (this.sortDirection) { case DataSortDirection.ASCENDING: diff --git a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts index 84430e65..60921c66 100644 --- a/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-list-grid/data-list-grid.component.ts @@ -21,7 +21,7 @@ import { AppStateService, UserService } from '@onecx/angular-integration-interfa import { MfeInfo } from '@onecx/integration-interface' import { MenuItem, PrimeIcons, PrimeTemplate } from 'primeng/api' import { Menu } from 'primeng/menu' -import { BehaviorSubject, Observable, combineLatest, debounceTime, map, mergeMap } from 'rxjs' +import { BehaviorSubject, Observable, combineLatest, debounceTime, first, map, mergeMap } from 'rxjs' import { ColumnType } from '../../model/column-type.model' import { DataAction } from '../../model/data-action' import { DataSortDirection } from '../../model/data-sort-direction' @@ -42,6 +42,11 @@ export interface ListGridDataMenuItem extends MenuItem { permission: string } +export interface DataListGridComponentState { + activePage?: number + pageSize?: number +} + @Component({ selector: 'ocx-data-list-grid', templateUrl: './data-list-grid.component.html', @@ -244,6 +249,8 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe @Output() editItem = new EventEmitter() @Output() deleteItem = new EventEmitter() @Output() pageChanged = new EventEmitter() + @Output() pageSizeChanged = new EventEmitter() + @Output() componentStateChanged = new EventEmitter() get viewItemObserved(): boolean { const dv = this.injector.get('DataViewComponent', null) @@ -364,6 +371,8 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe (!!this.viewPermission && this.userService.hasPermission(this.viewPermission)) || (!!this.editPermission && this.userService.hasPermission(this.editPermission)) || (!!this.deletePermission && this.userService.hasPermission(this.deletePermission)) + + this.emitComponentStateChanged() } ngAfterContentInit() { @@ -507,15 +516,33 @@ export class DataListGridComponent extends DataSortBase implements OnInit, DoChe return ObjectUtils.resolveFieldData(object, key) } + emitComponentStateChanged(state: DataListGridComponentState = {}) { + this.displayedPageSize$.pipe(first()).subscribe((pageSize) => { + this.componentStateChanged.emit({ + pageSize, + activePage: this.page, + ...state + }) + }) + + } + onPageChange(event: any) { const page = event.first / event.rows this.page = page + this.pageSize = event.rows this.pageChanged.emit(page) + this.pageSizeChanged.emit(event.rows) + this.emitComponentStateChanged({ + activePage: page, + pageSize: event.rows + }) } resetPage() { this.page = 0 this.pageChanged.emit(this.page) + this.emitComponentStateChanged() } fieldIsTruthy(object: any, key: any) { diff --git a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts index b08aa666..614f1670 100644 --- a/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-table/data-table.component.ts @@ -20,7 +20,7 @@ import { isValidDate } from '@onecx/accelerator' import { UserService } from '@onecx/angular-integration-interface' import { MenuItem, PrimeTemplate, SelectItem } from 'primeng/api' import { Menu } from 'primeng/menu' -import { BehaviorSubject, Observable, combineLatest, debounceTime, map, mergeMap, of } from 'rxjs' +import { BehaviorSubject, Observable, combineLatest, debounceTime, first, map, mergeMap, of } from 'rxjs' import { ColumnType } from '../../model/column-type.model' import { DataAction } from '../../model/data-action' import { DataSortDirection } from '../../model/data-sort-direction' @@ -49,6 +49,14 @@ interface TemplatesData { export type Filter = { columnId: string; value: string } export type Sort = { sortColumn: string; sortDirection: DataSortDirection } +export interface DataTableComponentState { + filters?: Filter[] + sorting?: Sort + selectedRows?: Row[] + activePage?: number + pageSize?: number +} + @Component({ selector: 'ocx-data-table', templateUrl: './data-table.component.html', @@ -269,6 +277,8 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon @Output() deleteTableRow = new EventEmitter() @Output() selectionChanged = new EventEmitter() @Output() pageChanged = new EventEmitter() + @Output() pageSizeChanged = new EventEmitter() + @Output() componentStateChanged = new EventEmitter() displayedRows$: Observable | undefined selectedRows$: Observable | undefined @@ -422,6 +432,24 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon map((amounts) => Object.fromEntries(amounts)) ) this.mapSelectionToRows() + this.emitComponentStateChanged() + } + + emitComponentStateChanged(state: DataTableComponentState = {}) { + combineLatest([this.displayedPageSize$, this._selection$]).pipe(first()).subscribe(([pageSize, selectedRows]) => { + this.componentStateChanged.emit({ + filters: this.filters, + sorting: { + sortColumn: this.sortColumn, + sortDirection: this.sortDirection + }, + pageSize, + activePage: this.page, + selectedRows, + ...state + }) + }) + } ngAfterContentInit() { @@ -480,6 +508,12 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon this._sortDirection$.next(newSortDirection) this.sorted.emit({ sortColumn: sortColumn, sortDirection: newSortDirection }) + this.emitComponentStateChanged({ + sorting: { + sortColumn: sortColumn, + sortDirection: newSortDirection + } + }) } columnNextSortDirection(sortColumn: string) { @@ -517,6 +551,9 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon this.filters = filters } this.filtered.emit(filters) + this.emitComponentStateChanged({ + filters + }) this.resetPage() } @@ -554,18 +591,29 @@ export class DataTableComponent extends DataSortBase implements OnInit, AfterCon } onSelectionChange(event: Row[]) { + this.selectedRows = event; this.selectionChanged.emit(event) + this.emitComponentStateChanged({ + selectedRows: event + }) } onPageChange(event: any) { const page = event.first / event.rows this.page = page + this.pageSize = event.rows this.pageChanged.emit(page) + this.pageSizeChanged.emit(event.rows) + this.emitComponentStateChanged({ + activePage: page, + pageSize: event.rows + }) } resetPage() { this.page = 0 this.pageChanged.emit(this.page) + this.emitComponentStateChanged() } fieldIsTruthy(object: any, key: any) { diff --git a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html index d0a41d9f..bea326f1 100644 --- a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html +++ b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.html @@ -18,6 +18,8 @@ [paginator]="listGridPaginator" [page]="page" (pageChanged)="onPageChange($event)" + (pageSizeChanged)="onPageSizeChange($event)" + (componentStateChanged)="dataListGridComponentState$.next($event)" [emptyResultsMessage]="emptyResultsMessage" [layout]="layout" [deletePermission]="deletePermission" @@ -143,6 +145,8 @@ [paginator]="tablePaginator" [page]="page" (pageChanged)="onPageChange($event)" + (pageSizeChanged)="onPageSizeChange($event)" + (componentStateChanged)="dataTableComponentState$.next($event)" [selectedRows]="selectedRows" [frozenActionColumn]="frozenActionColumn" [actionColumnPosition]="actionColumnPosition" diff --git a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts index 065a6380..fe664b14 100644 --- a/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts +++ b/libs/angular-accelerator/src/lib/components/data-view/data-view.component.ts @@ -13,15 +13,19 @@ import { TemplateRef, ViewChild, } from '@angular/core' -import { DataListGridComponent, ListGridData } from '../data-list-grid/data-list-grid.component' -import { Row, Filter, Sort, DataTableComponent } from '../data-table/data-table.component' +import { DataListGridComponent, DataListGridComponentState, ListGridData } from '../data-list-grid/data-list-grid.component' +import { Row, Filter, Sort, DataTableComponent, DataTableComponentState } from '../data-table/data-table.component' import { DataTableColumn } from '../../model/data-table-column.model' import { DataSortDirection } from '../../model/data-sort-direction' import { DataAction } from '../../model/data-action' +import { BehaviorSubject, ReplaySubject, timestamp, combineLatest, map, Observable, startWith } from 'rxjs' +import { orderAndMergeValuesByTimestamp } from '../../utils/rxjs-utils' import { PrimeTemplate } from 'primeng/api' -import { BehaviorSubject, Observable, combineLatest, map } from 'rxjs' export type RowListGridData = ListGridData & Row + +export type DataViewComponentState = DataListGridComponentState & DataTableComponentState + @Component({ selector: 'ocx-data-view', templateUrl: './data-view.component.html', @@ -47,6 +51,9 @@ export class DataViewComponent implements DoCheck, OnInit, AfterContentInit { return this._dataTableComponent } + dataTableComponentState$ = new ReplaySubject(1) + dataListGridComponentState$ = new ReplaySubject(1) + @Input() deletePermission: string | undefined @Input() editPermission: string | undefined @Input() viewPermission: string | undefined @@ -318,6 +325,8 @@ export class DataViewComponent implements DoCheck, OnInit, AfterContentInit { @Output() editItem = new EventEmitter() @Output() selectionChanged = new EventEmitter() @Output() pageChanged = new EventEmitter() + @Output() pageSizeChanged = new EventEmitter() + @Output() componentStateChanged = new EventEmitter() isDeleteItemObserved: boolean | undefined isViewItemObserved: boolean | undefined IsEditItemObserved: boolean | undefined @@ -370,6 +379,25 @@ export class DataViewComponent implements DoCheck, OnInit, AfterContentInit { ngOnInit(): void { this.firstColumnId = this.columns[0]?.id + + let dataTableComponentState$: Observable> = this.dataTableComponentState$ + let dataListGridComponentState$: Observable> = this.dataListGridComponentState$ + if (this.layout === 'table') { + dataListGridComponentState$ = dataListGridComponentState$.pipe(startWith({})) + } else { + dataTableComponentState$ = dataTableComponentState$.pipe(startWith({})) + } + + combineLatest([ + dataTableComponentState$.pipe(timestamp()), + dataListGridComponentState$.pipe(timestamp()), + ]) + .pipe( + map((componentStates) => { + return orderAndMergeValuesByTimestamp(componentStates) + }) + ) + .subscribe((val) => {this.componentStateChanged.emit(val)}) } ngAfterContentInit() { @@ -571,4 +599,9 @@ export class DataViewComponent implements DoCheck, OnInit, AfterContentInit { this.page = event this.pageChanged.emit(event) } + + onPageSizeChange(event: number) { + this.pageSize = event + this.pageSizeChanged.emit(event) + } } diff --git a/libs/angular-accelerator/src/lib/components/diagram/diagram.component.ts b/libs/angular-accelerator/src/lib/components/diagram/diagram.component.ts index f429b374..e5b6b291 100644 --- a/libs/angular-accelerator/src/lib/components/diagram/diagram.component.ts +++ b/libs/angular-accelerator/src/lib/components/diagram/diagram.component.ts @@ -15,6 +15,10 @@ export interface DiagramLayouts { titleKey: string } +export interface DiagramComponentState { + activeDiagramType?: DiagramType +} + const allDiagramTypes: DiagramLayouts[] = [ { icon: PrimeIcons.CHART_PIE, layout: DiagramType.PIE, titleKey: 'OCX_DIAGRAM.SWITCH_DIAGRAM_TYPE.PIE' }, { @@ -60,6 +64,7 @@ export class DiagramComponent implements OnInit, OnChanges { } @Output() dataSelected: EventEmitter = new EventEmitter() @Output() diagramTypeChanged: EventEmitter = new EventEmitter() + @Output() componentStateChanged: EventEmitter = new EventEmitter() chartOptions: ChartOptions | undefined chartData: ChartData | undefined amountOfData: number | undefined | null @@ -128,12 +133,16 @@ export class DiagramComponent implements OnInit, OnChanges { dataClicked(event: []) { this.dataSelected.emit(event.length) + } onDiagramTypeChanged(event: any) { this.diagramType = event.value.layout this.generateChart(this.colorScale, this.colorRangeInfo) this.diagramTypeChanged.emit(event.value.layout) + this.componentStateChanged.emit({ + activeDiagramType: event.value.layout + }) } } function interpolateColors(amountOfData: number, colorScale: any, colorRangeInfo: any) { diff --git a/libs/angular-accelerator/src/lib/components/group-by-count-diagram/group-by-count-diagram.component.ts b/libs/angular-accelerator/src/lib/components/group-by-count-diagram/group-by-count-diagram.component.ts index d9065287..1080d795 100644 --- a/libs/angular-accelerator/src/lib/components/group-by-count-diagram/group-by-count-diagram.component.ts +++ b/libs/angular-accelerator/src/lib/components/group-by-count-diagram/group-by-count-diagram.component.ts @@ -7,6 +7,10 @@ import { ObjectUtils } from '../../utils/objectutils' import { DiagramData } from '../../model/diagram-data' import { DiagramType } from '../../model/diagram-type' +export interface GroupByCountDiagramComponentState { + activeDiagramType?: DiagramType +} + @Component({ selector: 'ocx-group-by-count-diagram', templateUrl: './group-by-count-diagram.component.html', @@ -64,6 +68,7 @@ export class GroupByCountDiagramComponent implements OnInit { @Output() dataSelected: EventEmitter = new EventEmitter() @Output() diagramTypeChanged: EventEmitter = new EventEmitter() + @Output() componentStateChanged: EventEmitter = new EventEmitter() constructor(private translateService: TranslateService) {} @@ -99,5 +104,8 @@ export class GroupByCountDiagramComponent implements OnInit { onDiagramTypeChanged(newDiagramType: DiagramType) { this.diagramType = newDiagramType this.diagramTypeChanged.emit(newDiagramType) + this.componentStateChanged.emit({ + activeDiagramType: newDiagramType + }) } } diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html index bc8d650e..718595c8 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html @@ -4,6 +4,7 @@ [supportedViewLayouts]="supportedViewLayouts" [layout]="layout" (dataViewLayoutChange)="onDataViewLayoutChange($event)" + (componentStateChanged)="dataLayoutComponentState$.next($event)" >
@@ -18,6 +19,7 @@ [sortStates]="sortStates" (sortChange)="onSortChange($event)" (sortDirectionChange)="onSortDirectionChange($event)" + (componentStateChanged)="dataListGridSortingComponentState$.next($event)" >
@@ -29,22 +31,24 @@ [customGroupKey]="customGroupKey" [placeholderKey]="groupSelectionNoGroupSelectedKey" (groupSelectionChanged)="onColumnGroupSelectionChange($event)" + (componentStateChanged)="columnGroupSelectionComponentState$.next($event)" >
diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.stories.ts b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.stories.ts index dfc00832..48b3c76a 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.stories.ts +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.stories.ts @@ -94,18 +94,22 @@ const defaultComponentArgs: InteractiveDataViewInputTypes = { columnType: ColumnType.STRING, nameKey: 'Product', sortable: false, + filterable: true, + predefinedGroupKeys: ['test'] }, { id: 'amount', columnType: ColumnType.NUMBER, nameKey: 'Amount', sortable: true, + predefinedGroupKeys: ['test', 'test1'] }, { id: 'available', columnType: ColumnType.STRING, nameKey: 'Available', sortable: false, + predefinedGroupKeys: ['test2'] }, ], data: [ @@ -135,11 +139,21 @@ const defaultComponentArgs: InteractiveDataViewInputTypes = { } export const WithMockData = { + argTypes: { + componentStateChanged: { action: 'componentStateChanged' }, + selectionChanged: { action: 'selectionChanged' }, + }, render: Template, - args: defaultComponentArgs, + args: { + ...defaultComponentArgs, + selectedRows: [], + }, } export const WithPageSizes = { + argTypes: { + componentStateChanged: { action: 'componentStateChanged' }, + }, render: Template, args: { ...defaultComponentArgs, diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts index 1e775996..496633cd 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.ts @@ -11,19 +11,31 @@ import { TemplateRef, ViewChild, } from '@angular/core' -import { PrimeTemplate } from 'primeng/api' +import { BehaviorSubject, Observable, ReplaySubject, combineLatest, map, startWith, timestamp } from 'rxjs' import { DataAction } from '../../model/data-action' import { DataSortDirection } from '../../model/data-sort-direction' import { DataTableColumn } from '../../model/data-table-column.model' -import { GroupSelectionChangedEvent } from '../column-group-selection/column-group-selection.component' +import { orderAndMergeValuesByTimestamp } from '../../utils/rxjs-utils' +import { + ColumnGroupSelectionComponentState, + GroupSelectionChangedEvent, +} from '../column-group-selection/column-group-selection.component' +import { PrimeTemplate } from 'primeng/api' import { ActionColumnChangedEvent, ColumnSelectionChangedEvent, + CustomGroupColumnSelectorComponentState, } from '../custom-group-column-selector/custom-group-column-selector.component' +import { DataLayoutSelectionComponentState } from '../data-layout-selection/data-layout-selection.component' +import { DataListGridSortingComponentState } from '../data-list-grid-sorting/data-list-grid-sorting.component' import { Filter, Row, Sort } from '../data-table/data-table.component' -import { DataViewComponent, RowListGridData } from '../data-view/data-view.component' -import { BehaviorSubject } from 'rxjs' +import { DataViewComponent, DataViewComponentState, RowListGridData } from '../data-view/data-view.component' +export type InteractiveDataViewComponentState = ColumnGroupSelectionComponentState & + CustomGroupColumnSelectorComponentState & + DataLayoutSelectionComponentState & + DataListGridSortingComponentState & + DataViewComponentState @Component({ selector: 'ocx-interactive-data-view', templateUrl: './interactive-data-view.component.html', @@ -40,6 +52,12 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { return this._dataViewComponent } + columnGroupSelectionComponentState$ = new ReplaySubject(1) + customGroupColumnSelectorComponentState$ = new ReplaySubject(1) + dataLayoutComponentState$ = new ReplaySubject(1) + dataListGridSortingComponentState$ = new ReplaySubject(1) + dataViewComponentState$ = new ReplaySubject(1) + @Input() deletePermission: string | undefined @Input() editPermission: string | undefined @Input() viewPermission: string | undefined @@ -80,7 +98,29 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { @Input() tablePaginator = true @Input() page = 0 @Input() selectedRows: Row[] = [] - @Input() displayedColumns: DataTableColumn[] = [] + displayedColumnKeys$ = new BehaviorSubject([]) + displayedColumns$: Observable | undefined + @Input() + get displayedColumnKeys(): string[] { + return this.displayedColumnKeys$.getValue() + } + set displayedColumnKeys(value: string[]) { + this.displayedColumnKeys$.next(value) + } + /** + * @deprecated Use `displayedColumnKeys` and pass in column ids instead of `DataTableColumn` objects + */ + @Input() + get displayedColumns(): DataTableColumn[] { + return ( + (this.displayedColumnKeys + .map((d) => this.columns.find((c) => c.id === d)) + .filter((d) => d) as DataTableColumn[]) ?? [] + ); + } + set displayedColumns(value: DataTableColumn[]) { + this.displayedColumnKeys$.next(value.map((d) => d.id)) + } @Input() frozenActionColumn = false @Input() actionColumnPosition: 'left' | 'right' = 'right' @ContentChild('tableCell') tableCell: TemplateRef | undefined @@ -154,10 +194,16 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { @Output() viewItem = new EventEmitter() @Output() editItem = new EventEmitter() @Output() dataViewLayoutChange = new EventEmitter<'grid' | 'list' | 'table'>() + // TODO: Remove following line once displayedColumns (deprecated) has been removed @Output() displayedColumnsChange = new EventEmitter() + @Output() displayedColumnKeysChange = new EventEmitter() @Output() selectionChanged: EventEmitter = new EventEmitter() @Output() pageChanged: EventEmitter = new EventEmitter() + @Output() pageSizeChanged = new EventEmitter() + + @Output() componentStateChanged = new EventEmitter() + selectedGroupKey = '' isDeleteItemObserved: boolean | undefined isViewItemObserved: boolean | undefined @@ -269,17 +315,47 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { ngOnInit(): void { this.selectedGroupKey = this.defaultGroupKey - this.displayedColumns = this.columns + if(!this.displayedColumns || this.displayedColumns.length === 0) { + this.displayedColumnKeys = this.columns.map((column) => column.id) + } if (this.defaultGroupKey) { - this.displayedColumns = this.columns.filter((column) => + this.displayedColumnKeys = this.columns.filter((column) => column.predefinedGroupKeys?.includes(this.defaultGroupKey) - ) + ).map((column) => column.id) } + this.displayedColumns$ = this.displayedColumnKeys$.pipe(map((columnKeys) => ( + (columnKeys + .map((key) => this.columns.find((col) => col.id === key)) + .filter((d) => d) as DataTableColumn[]) ?? [] + ))) + // TODO: Remove following line once displayedColumns (deprecated) has been removed this.displayedColumnsChange.emit(this.displayedColumns) + this.displayedColumnKeysChange.emit(this.displayedColumnKeys) if (!this.groupSelectionNoGroupSelectedKey) { this.groupSelectionNoGroupSelectedKey = 'OCX_INTERACTIVE_DATA_VIEW.NO_GROUP_SELECTED' } this.firstColumnId = this.columns[0]?.id + + let dataListGridSortingComponentState$: Observable> = + this.dataListGridSortingComponentState$ + if (this.layout === 'table') { + dataListGridSortingComponentState$ = dataListGridSortingComponentState$.pipe(startWith({})) + } + combineLatest([ + this.columnGroupSelectionComponentState$.pipe(timestamp()), + this.customGroupColumnSelectorComponentState$.pipe(timestamp()), + this.dataLayoutComponentState$.pipe(timestamp()), + dataListGridSortingComponentState$.pipe(timestamp()), + this.dataViewComponentState$.pipe(timestamp()), + ]) + .pipe( + map((componentStates) => { + return orderAndMergeValuesByTimestamp(componentStates) + }) + ) + .subscribe((val) => { + this.componentStateChanged.emit(val) + }) } ngAfterContentInit() { @@ -421,9 +497,11 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { } onColumnGroupSelectionChange(event: GroupSelectionChangedEvent) { - this.displayedColumns = event.activeColumns + this.displayedColumnKeys = event.activeColumns.map((col) => col.id) this.selectedGroupKey = event.groupKey + // TODO: Remove following line once displayedColumns (deprecated) has been removed this.displayedColumnsChange.emit(this.displayedColumns) + this.displayedColumnKeysChange.emit(this.displayedColumnKeys) } registerEventListenerForDataView() { @@ -461,9 +539,11 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { } onColumnSelectionChange(event: ColumnSelectionChangedEvent) { - this.displayedColumns = event.activeColumns + this.displayedColumnKeys = event.activeColumns.map((col) => col.id) this.selectedGroupKey = this.customGroupKey + // TODO: Remove following line once displayedColumns (deprecated) has been removed this.displayedColumnsChange.emit(this.displayedColumns) + this.displayedColumnKeysChange.emit(this.displayedColumnKeys) } onActionColumnConfigChange(event: ActionColumnChangedEvent) { @@ -481,4 +561,10 @@ export class InteractiveDataViewComponent implements OnInit, AfterContentInit { this.page = event this.pageChanged.emit(event) } + + onPageSizeChange(event: number) { + this.pageSize = event + this.pageSizeChanged.emit(event) + } + } diff --git a/libs/angular-accelerator/src/lib/components/search-header/search-header.component.ts b/libs/angular-accelerator/src/lib/components/search-header/search-header.component.ts index 9ed1ca80..55538fdb 100644 --- a/libs/angular-accelerator/src/lib/components/search-header/search-header.component.ts +++ b/libs/angular-accelerator/src/lib/components/search-header/search-header.component.ts @@ -12,6 +12,11 @@ import { import { Action } from '../page-header/page-header.component' import { SearchConfigInfo } from '../../model/search-config-info' +export interface SearchHeaderComponentState { + activeViewMode?: 'basic' | 'advanced' + selectedSearchConfig?: SearchConfigInfo +} + /** * To trigger the search when Enter key is pressed inside a search parameter field, * an EventListener for keyup enter event is added for HTML elements which have an input. @@ -55,6 +60,7 @@ export class SearchHeaderComponent implements AfterViewInit { @Output() resetted: EventEmitter = new EventEmitter() @Output() selectedSearchConfigChanged: EventEmitter = new EventEmitter() @Output() viewModeChanged: EventEmitter<'basic' | 'advanced'> = new EventEmitter() + @Output() componentStateChanged: EventEmitter = new EventEmitter() @ContentChild('additionalToolbarContent') additionalToolbarContent: TemplateRef | undefined @@ -80,6 +86,9 @@ export class SearchHeaderComponent implements AfterViewInit { toggleViewMode() { this.viewMode = this.viewMode === 'basic' ? 'advanced' : 'basic' this.viewModeChanged?.emit(this.viewMode) + this.componentStateChanged.emit({ + activeViewMode: this.viewMode + }) this.updateHeaderActions() setTimeout(() => this.addKeyUpEventListener()) } @@ -130,5 +139,8 @@ export class SearchHeaderComponent implements AfterViewInit { confirmSearchConfig(searchConfig: SearchConfigInfo) { this.selectedSearchConfigChanged?.emit(searchConfig) + this.componentStateChanged.emit({ + selectedSearchConfig: searchConfig + }) } } diff --git a/libs/angular-accelerator/src/lib/utils/rxjs-utils.ts b/libs/angular-accelerator/src/lib/utils/rxjs-utils.ts new file mode 100644 index 00000000..8986d478 --- /dev/null +++ b/libs/angular-accelerator/src/lib/utils/rxjs-utils.ts @@ -0,0 +1,16 @@ +import { Timestamp } from 'rxjs' + +export function orderValuesByTimestamp(valuesWithTimestamp: Timestamp[]) { + return valuesWithTimestamp.sort((a, b) => b.timestamp - a.timestamp).map((obj) => obj.value) +} + +function mergeValues(values: any[]) { + return values.reduce((acc, curr) => { + return { ...acc, ...curr } + }) +} + +export function orderAndMergeValuesByTimestamp(valuesWithTimestamp: Timestamp[]) { + const sortedValues = valuesWithTimestamp.sort((a, b) => a.timestamp - b.timestamp).map((obj) => obj.value) + return mergeValues(sortedValues) +} From 50c6c68eb26b81402a1c72bb50b09667ad0d8e50 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 26 Aug 2024 13:40:31 +0000 Subject: [PATCH 14/24] chore(release): -v5.9.0 [skip ci] ## [5.9.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.8.0...v5.9.0) (2024-08-26) ### Features * create ngrx-accelerator ([#399](https://github.com/onecx/onecx-portal-ui-libs/issues/399)) ([d3007a1](https://github.com/onecx/onecx-portal-ui-libs/commit/d3007a1a2ab5b743b00e5bfdf63aab6149809ea0)) * publish UI state change events for lib components ([#395](https://github.com/onecx/onecx-portal-ui-libs/issues/395)) ([622ed48](https://github.com/onecx/onecx-portal-ui-libs/commit/622ed48221849c418e4f8c4a2f72ea139be30e17)) --- CHANGELOG.md | 7 +++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/ngrx-accelerator/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 15 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50e00bef..68032797 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## [5.9.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.8.0...v5.9.0) (2024-08-26) + +### Features + +* create ngrx-accelerator ([#399](https://github.com/onecx/onecx-portal-ui-libs/issues/399)) ([d3007a1](https://github.com/onecx/onecx-portal-ui-libs/commit/d3007a1a2ab5b743b00e5bfdf63aab6149809ea0)) +* publish UI state change events for lib components ([#395](https://github.com/onecx/onecx-portal-ui-libs/issues/395)) ([622ed48](https://github.com/onecx/onecx-portal-ui-libs/commit/622ed48221849c418e4f8c4a2f72ea139be30e17)) + ## [5.8.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.7.0...v5.8.0) (2024-08-23) ### Features diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 337b68a5..66c98e3a 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 75488a71..be39f5f8 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 02050ced..f8075da6 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index 726f776c..487a7ecb 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index e3a09ad8..e65283fe 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index df86dbbd..a87397b3 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index 2bdf70f0..2948fc32 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index efd9ceb1..3c4d22e4 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index 26eec995..a901da5e 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json index 0dd4ae59..2515bc87 100644 --- a/libs/ngrx-accelerator/package.json +++ b/libs/ngrx-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/ngrx-accelerator", - "version": "5.3.2", + "version": "5.9.0", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/router": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 2399358f..41400fc4 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index 3b1b9ee7..e7de9b37 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index 7ed1eca0..d228eaeb 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", diff --git a/package.json b/package.json index 7466c5c6..d09541c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.8.0", + "version": "5.9.0", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From 90b43ab4c8b7aba11bd798f2d4747f226de04052 Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Wed, 28 Aug 2024 10:23:52 +0200 Subject: [PATCH 15/24] fix: add license file (#427) * fix: update angular versions * fix: add license file to other libs as well --------- Co-authored-by: kim.tran Co-authored-by: Annika Nowak <139357202+anninowak@users.noreply.github.com> Co-authored-by: markuczy <129275100+markuczy@users.noreply.github.com> --- libs/accelerator/LICENSE | 201 +++++++++++++++++++++ libs/angular-accelerator/LICENSE | 201 +++++++++++++++++++++ libs/angular-auth/LICENSE | 201 +++++++++++++++++++++ libs/angular-integration-interface/LICENSE | 201 +++++++++++++++++++++ libs/angular-remote-components/LICENSE | 201 +++++++++++++++++++++ libs/angular-testing/LICENSE | 201 +++++++++++++++++++++ libs/angular-webcomponents/LICENSE | 201 +++++++++++++++++++++ libs/integration-interface/LICENSE | 201 +++++++++++++++++++++ libs/keycloak-auth/LICENSE | 201 +++++++++++++++++++++ libs/ngrx-accelerator/LICENSE | 201 +++++++++++++++++++++ libs/portal-integration-angular/LICENSE | 201 +++++++++++++++++++++ libs/portal-layout-styles/LICENSE | 201 +++++++++++++++++++++ libs/shell-core/LICENSE | 201 +++++++++++++++++++++ 13 files changed, 2613 insertions(+) create mode 100644 libs/accelerator/LICENSE create mode 100644 libs/angular-accelerator/LICENSE create mode 100644 libs/angular-auth/LICENSE create mode 100644 libs/angular-integration-interface/LICENSE create mode 100644 libs/angular-remote-components/LICENSE create mode 100644 libs/angular-testing/LICENSE create mode 100644 libs/angular-webcomponents/LICENSE create mode 100644 libs/integration-interface/LICENSE create mode 100644 libs/keycloak-auth/LICENSE create mode 100644 libs/ngrx-accelerator/LICENSE create mode 100644 libs/portal-integration-angular/LICENSE create mode 100644 libs/portal-layout-styles/LICENSE create mode 100644 libs/shell-core/LICENSE diff --git a/libs/accelerator/LICENSE b/libs/accelerator/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/accelerator/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/angular-accelerator/LICENSE b/libs/angular-accelerator/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/angular-accelerator/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/angular-auth/LICENSE b/libs/angular-auth/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/angular-auth/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/angular-integration-interface/LICENSE b/libs/angular-integration-interface/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/angular-integration-interface/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/angular-remote-components/LICENSE b/libs/angular-remote-components/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/angular-remote-components/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/angular-testing/LICENSE b/libs/angular-testing/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/angular-testing/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/angular-webcomponents/LICENSE b/libs/angular-webcomponents/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/angular-webcomponents/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/integration-interface/LICENSE b/libs/integration-interface/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/integration-interface/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/keycloak-auth/LICENSE b/libs/keycloak-auth/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/keycloak-auth/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/ngrx-accelerator/LICENSE b/libs/ngrx-accelerator/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/ngrx-accelerator/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/portal-integration-angular/LICENSE b/libs/portal-integration-angular/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/portal-integration-angular/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/portal-layout-styles/LICENSE b/libs/portal-layout-styles/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/portal-layout-styles/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/libs/shell-core/LICENSE b/libs/shell-core/LICENSE new file mode 100644 index 00000000..261eeb9e --- /dev/null +++ b/libs/shell-core/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. From 3c3a24802cc2d2480e879bf839b49ac81863865a Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 28 Aug 2024 08:38:25 +0000 Subject: [PATCH 16/24] chore(release): -v5.9.1 [skip ci] ## [5.9.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.0...v5.9.1) (2024-08-28) ### Bug Fixes * add license file ([#427](https://github.com/onecx/onecx-portal-ui-libs/issues/427)) ([90b43ab](https://github.com/onecx/onecx-portal-ui-libs/commit/90b43ab4c8b7aba11bd798f2d4747f226de04052)) --- CHANGELOG.md | 6 ++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/ngrx-accelerator/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68032797..65802134 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [5.9.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.0...v5.9.1) (2024-08-28) + +### Bug Fixes + +* add license file ([#427](https://github.com/onecx/onecx-portal-ui-libs/issues/427)) ([90b43ab](https://github.com/onecx/onecx-portal-ui-libs/commit/90b43ab4c8b7aba11bd798f2d4747f226de04052)) + ## [5.9.0](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.8.0...v5.9.0) (2024-08-26) ### Features diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 66c98e3a..12a5fa37 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index be39f5f8..827c0ae0 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index f8075da6..b878c6de 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index 487a7ecb..ab00e65a 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index e65283fe..034e8b32 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index a87397b3..5147252d 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index 2948fc32..c7fc66a9 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 3c4d22e4..56aa69e6 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index a901da5e..538f3dc2 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json index 2515bc87..8803515b 100644 --- a/libs/ngrx-accelerator/package.json +++ b/libs/ngrx-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/ngrx-accelerator", - "version": "5.9.0", + "version": "5.9.1", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/router": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 41400fc4..5b87e498 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index e7de9b37..42e459ba 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index d228eaeb..34af228a 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", diff --git a/package.json b/package.json index d09541c3..3c8294d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.9.0", + "version": "5.9.1", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From 9e366733613341e09e77a026d666afdac94985f8 Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Wed, 28 Aug 2024 13:05:27 +0200 Subject: [PATCH 17/24] fix: connectRouter using fragment (#428) * fix: update angular versions * fix: change connectRouter to use router navigate with fragment * fix: lint issue --------- Co-authored-by: kim.tran Co-authored-by: Annika Nowak <139357202+anninowak@users.noreply.github.com> Co-authored-by: markuczy <129275100+markuczy@users.noreply.github.com> --- .../src/lib/utils/webcomponent-bootstrap.utils.ts | 8 +++++--- package-lock.json | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts index 45622390..7e84bb30 100644 --- a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts +++ b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts @@ -165,14 +165,16 @@ function connectMicroFrontendRouter(injector: Injector, warn = true): Subscripti function connectRouter(router: Router): Subscription { const initialUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}` - router.navigateByUrl(initialUrl) + router.navigate([initialUrl], { fragment: location.hash.substring(1) }) let lastUrl = initialUrl + let lastHash = location.hash const observer = new EventsTopic() return observer.pipe(filter((e) => e.type === 'navigated')).subscribe(() => { const routerUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}` - if (routerUrl !== lastUrl) { + if (routerUrl !== lastUrl || location.hash !== lastHash) { lastUrl = routerUrl - router.navigateByUrl(routerUrl) + lastHash = location.hash + router.navigate([routerUrl], { fragment: location.hash.substring(1) }) } }) } diff --git a/package-lock.json b/package-lock.json index 95b8df03..c52f7cec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.7.0", + "version": "5.9.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.7.0", + "version": "5.9.1", "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { @@ -117,7 +117,7 @@ }, "libs/portal-layout-styles": { "name": "@onecx/portal-layout-styles", - "version": "5.7.0", + "version": "5.9.1", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" From ac9d833731c3c18a58f9ec444d4573996bbc7a16 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 28 Aug 2024 11:10:40 +0000 Subject: [PATCH 18/24] chore(release): -v5.9.2 [skip ci] ## [5.9.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.1...v5.9.2) (2024-08-28) ### Bug Fixes * connectRouter using fragment ([#428](https://github.com/onecx/onecx-portal-ui-libs/issues/428)) ([9e36673](https://github.com/onecx/onecx-portal-ui-libs/commit/9e366733613341e09e77a026d666afdac94985f8)) --- CHANGELOG.md | 6 ++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/ngrx-accelerator/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65802134..cc47d6d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [5.9.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.1...v5.9.2) (2024-08-28) + +### Bug Fixes + +* connectRouter using fragment ([#428](https://github.com/onecx/onecx-portal-ui-libs/issues/428)) ([9e36673](https://github.com/onecx/onecx-portal-ui-libs/commit/9e366733613341e09e77a026d666afdac94985f8)) + ## [5.9.1](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.0...v5.9.1) (2024-08-28) ### Bug Fixes diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 12a5fa37..165479cc 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index 827c0ae0..d998f719 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index b878c6de..606e9a0b 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index ab00e65a..5e87b330 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index 034e8b32..42826543 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index 5147252d..3251e215 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index c7fc66a9..dfdb1038 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 56aa69e6..a8258130 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index 538f3dc2..30ec9c32 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json index 8803515b..d922d4c8 100644 --- a/libs/ngrx-accelerator/package.json +++ b/libs/ngrx-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/ngrx-accelerator", - "version": "5.9.1", + "version": "5.9.2", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/router": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 5b87e498..0e421368 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index 42e459ba..a859dccf 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index 34af228a..9ebc3b6c 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", diff --git a/package.json b/package.json index 3c8294d4..3c6c9328 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.9.1", + "version": "5.9.2", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From ab409fc4d017f3544985ba21564b777d91036dc4 Mon Sep 17 00:00:00 2001 From: Bastian Jakobi <55296998+bastianjakobi@users.noreply.github.com> Date: Fri, 30 Aug 2024 10:32:39 +0200 Subject: [PATCH 19/24] fix: fix change ngrx build output structure (#432) * fix: fix change ngrx build output structure * fix (lint): remove unused deps --- libs/ngrx-accelerator/package.json | 3 --- libs/ngrx-accelerator/project.json | 24 +++++++++++++------- libs/ngrx-accelerator/tsconfig.json | 6 ++++- libs/ngrx-accelerator/tsconfig.lib.json | 4 +++- libs/ngrx-accelerator/tsconfig.lib.prod.json | 12 ++++++++++ 5 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 libs/ngrx-accelerator/tsconfig.lib.prod.json diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json index d922d4c8..d3acee7b 100644 --- a/libs/ngrx-accelerator/package.json +++ b/libs/ngrx-accelerator/package.json @@ -11,11 +11,8 @@ "@ngrx/router-store": "^18.0.1", "@ngrx/store": "^18.0.1", "rxjs": "7.8.1", - "tslib": "^2.6.3", "zod": "^3.23.8" }, - "main": "./src/index.js", - "typings": "./src/index.d.ts", "publishConfig": { "access": "public" } diff --git a/libs/ngrx-accelerator/project.json b/libs/ngrx-accelerator/project.json index d2e0d49c..229415ef 100644 --- a/libs/ngrx-accelerator/project.json +++ b/libs/ngrx-accelerator/project.json @@ -2,19 +2,27 @@ "name": "ngrx-accelerator", "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "libs/ngrx-accelerator/src", - "prefix": "lib", + "prefix": "onecx", "projectType": "library", "tags": [], "targets": { "build": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], + "executor": "@nx/angular:package", + "outputs": [ + "{workspaceRoot}/dist/{projectRoot}" + ], "options": { - "outputPath": "dist/libs/ngrx-accelerator", - "main": "libs/ngrx-accelerator/src/index.ts", - "tsConfig": "libs/ngrx-accelerator/tsconfig.lib.json", - "assets": ["libs/ngrx-accelerator/*.md"] - } + "project": "libs/ngrx-accelerator/ng-package.json" + }, + "configurations": { + "production": { + "tsConfig": "libs/ngrx-accelerator/tsconfig.lib.prod.json" + }, + "development": { + "tsConfig": "libs/ngrx-accelerator/tsconfig.lib.json" + } + }, + "defaultConfiguration": "production" }, "test": { "executor": "@nx/jest:jest", diff --git a/libs/ngrx-accelerator/tsconfig.json b/libs/ngrx-accelerator/tsconfig.json index 56deb89f..aea1b44f 100644 --- a/libs/ngrx-accelerator/tsconfig.json +++ b/libs/ngrx-accelerator/tsconfig.json @@ -6,7 +6,8 @@ "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "esModuleInterop": true }, "files": [], "include": [], @@ -14,6 +15,9 @@ { "path": "./tsconfig.lib.json" }, + { + "path": "./tsconfig.lib.prod.json" + }, { "path": "./tsconfig.spec.json" } diff --git a/libs/ngrx-accelerator/tsconfig.lib.json b/libs/ngrx-accelerator/tsconfig.lib.json index 4cab05d4..49fa9058 100644 --- a/libs/ngrx-accelerator/tsconfig.lib.json +++ b/libs/ngrx-accelerator/tsconfig.lib.json @@ -5,7 +5,9 @@ "declaration": true, "declarationMap": true, "inlineSources": true, - "types": [] + "types": [], + "target": "es2022", + "useDefineForClassFields": false }, "exclude": ["src/**/*.spec.ts", "src/test-setup.ts", "jest.config.ts", "src/**/*.test.ts"], "include": ["src/**/*.ts"] diff --git a/libs/ngrx-accelerator/tsconfig.lib.prod.json b/libs/ngrx-accelerator/tsconfig.lib.prod.json new file mode 100644 index 00000000..8a121d2b --- /dev/null +++ b/libs/ngrx-accelerator/tsconfig.lib.prod.json @@ -0,0 +1,12 @@ +{ + "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false, + "target": "es2022", + "useDefineForClassFields": false + }, + "angularCompilerOptions": { + "compilationMode": "partial" + }, + "exclude": ["jest.config.ts"] +} From 4b980259e8a7f7de14739fedf8968696b00aee46 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 30 Aug 2024 08:39:41 +0000 Subject: [PATCH 20/24] chore(release): -v5.9.3 [skip ci] ## [5.9.3](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.2...v5.9.3) (2024-08-30) ### Bug Fixes * fix change ngrx build output structure ([#432](https://github.com/onecx/onecx-portal-ui-libs/issues/432)) ([ab409fc](https://github.com/onecx/onecx-portal-ui-libs/commit/ab409fc4d017f3544985ba21564b777d91036dc4)) --- CHANGELOG.md | 6 ++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/ngrx-accelerator/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc47d6d8..e5d9db2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [5.9.3](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.2...v5.9.3) (2024-08-30) + +### Bug Fixes + +* fix change ngrx build output structure ([#432](https://github.com/onecx/onecx-portal-ui-libs/issues/432)) ([ab409fc](https://github.com/onecx/onecx-portal-ui-libs/commit/ab409fc4d017f3544985ba21564b777d91036dc4)) + ## [5.9.2](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.1...v5.9.2) (2024-08-28) ### Bug Fixes diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index 165479cc..b4d68fc3 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index d998f719..e8441bd9 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 606e9a0b..5d0b4264 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index 5e87b330..ee932a3d 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index 42826543..b069f6b8 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index 3251e215..e5342eb1 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index dfdb1038..93d2a68b 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index a8258130..7abe2641 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index 30ec9c32..297d0de4 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json index d3acee7b..a663134f 100644 --- a/libs/ngrx-accelerator/package.json +++ b/libs/ngrx-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/ngrx-accelerator", - "version": "5.9.2", + "version": "5.9.3", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/router": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index 0e421368..aaa4390a 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index a859dccf..40cfb376 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index 9ebc3b6c..5bb37e3b 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", diff --git a/package.json b/package.json index 3c6c9328..2c596bd9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.9.2", + "version": "5.9.3", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From 06c2bdb3047cc97716b21574ce64822972256f6b Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Fri, 30 Aug 2024 10:55:09 +0200 Subject: [PATCH 21/24] fix: connectRouter fix (#433) * fix: update angular versions * fix: connectRouter fix --------- Co-authored-by: kim.tran Co-authored-by: Annika Nowak <139357202+anninowak@users.noreply.github.com> Co-authored-by: markuczy <129275100+markuczy@users.noreply.github.com> --- .../src/lib/utils/webcomponent-bootstrap.utils.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts index 7e84bb30..7c7dbe95 100644 --- a/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts +++ b/libs/angular-webcomponents/src/lib/utils/webcomponent-bootstrap.utils.ts @@ -164,17 +164,15 @@ function connectMicroFrontendRouter(injector: Injector, warn = true): Subscripti } function connectRouter(router: Router): Subscription { - const initialUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}` - router.navigate([initialUrl], { fragment: location.hash.substring(1) }) + const initialUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}${location.hash}` + router.navigateByUrl(initialUrl) let lastUrl = initialUrl - let lastHash = location.hash const observer = new EventsTopic() return observer.pipe(filter((e) => e.type === 'navigated')).subscribe(() => { - const routerUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}` - if (routerUrl !== lastUrl || location.hash !== lastHash) { + const routerUrl = `${location.pathname.substring(getLocation().deploymentPath.length)}${location.search}${location.hash}` + if (routerUrl !== lastUrl) { lastUrl = routerUrl - lastHash = location.hash - router.navigate([routerUrl], { fragment: location.hash.substring(1) }) + router.navigateByUrl(routerUrl) } }) } From 467c288311bd74cc38cfaea8dcd54db5e2eda084 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Fri, 30 Aug 2024 09:05:26 +0000 Subject: [PATCH 22/24] chore(release): -v5.9.4 [skip ci] ## [5.9.4](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.3...v5.9.4) (2024-08-30) ### Bug Fixes * connectRouter fix ([#433](https://github.com/onecx/onecx-portal-ui-libs/issues/433)) ([06c2bdb](https://github.com/onecx/onecx-portal-ui-libs/commit/06c2bdb3047cc97716b21574ce64822972256f6b)) --- CHANGELOG.md | 6 ++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/ngrx-accelerator/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5d9db2d..9767c229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [5.9.4](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.3...v5.9.4) (2024-08-30) + +### Bug Fixes + +* connectRouter fix ([#433](https://github.com/onecx/onecx-portal-ui-libs/issues/433)) ([06c2bdb](https://github.com/onecx/onecx-portal-ui-libs/commit/06c2bdb3047cc97716b21574ce64822972256f6b)) + ## [5.9.3](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.2...v5.9.3) (2024-08-30) ### Bug Fixes diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index b4d68fc3..e2b217db 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index e8441bd9..f4cb4e05 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 5d0b4264..83dbbb84 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index ee932a3d..73e8184e 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index b069f6b8..7c35844f 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index e5342eb1..f5f9d53e 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index 93d2a68b..d5dceec5 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index 7abe2641..fe9b5382 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index 297d0de4..dd16bf2c 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json index a663134f..a25c02b4 100644 --- a/libs/ngrx-accelerator/package.json +++ b/libs/ngrx-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/ngrx-accelerator", - "version": "5.9.3", + "version": "5.9.4", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/router": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index aaa4390a..df725234 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index 40cfb376..ac6c8970 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index 5bb37e3b..f15da5cc 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", diff --git a/package.json b/package.json index 2c596bd9..2b7fea98 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.9.3", + "version": "5.9.4", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css", From 33c0559710856c145a9da0bac807f36a0de8ce6c Mon Sep 17 00:00:00 2001 From: Kim Tran Date: Tue, 3 Sep 2024 14:48:36 +0200 Subject: [PATCH 23/24] fix: only show displayed columns in list grid sorting options (#436) Co-authored-by: kim.tran --- .../interactive-data-view.component.html | 2 +- package-lock.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html index 718595c8..1432dd9d 100644 --- a/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html +++ b/libs/angular-accelerator/src/lib/components/interactive-data-view/interactive-data-view.component.html @@ -15,7 +15,7 @@ Date: Tue, 3 Sep 2024 13:22:46 +0000 Subject: [PATCH 24/24] chore(release): -v5.9.5 [skip ci] ## [5.9.5](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.4...v5.9.5) (2024-09-03) ### Bug Fixes * only show displayed columns in list grid sorting options ([#436](https://github.com/onecx/onecx-portal-ui-libs/issues/436)) ([33c0559](https://github.com/onecx/onecx-portal-ui-libs/commit/33c0559710856c145a9da0bac807f36a0de8ce6c)) --- CHANGELOG.md | 6 ++++++ libs/accelerator/package.json | 2 +- libs/angular-accelerator/package.json | 2 +- libs/angular-auth/package.json | 2 +- libs/angular-integration-interface/package.json | 2 +- libs/angular-remote-components/package.json | 2 +- libs/angular-testing/package.json | 2 +- libs/angular-webcomponents/package.json | 2 +- libs/integration-interface/package.json | 2 +- libs/keycloak-auth/package.json | 2 +- libs/ngrx-accelerator/package.json | 2 +- libs/portal-integration-angular/package.json | 2 +- libs/portal-layout-styles/package.json | 2 +- libs/shell-core/package.json | 2 +- package.json | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9767c229..7568b3dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [5.9.5](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.4...v5.9.5) (2024-09-03) + +### Bug Fixes + +* only show displayed columns in list grid sorting options ([#436](https://github.com/onecx/onecx-portal-ui-libs/issues/436)) ([33c0559](https://github.com/onecx/onecx-portal-ui-libs/commit/33c0559710856c145a9da0bac807f36a0de8ce6c)) + ## [5.9.4](https://github.com/onecx/onecx-portal-ui-libs/compare/v5.9.3...v5.9.4) (2024-08-30) ### Bug Fixes diff --git a/libs/accelerator/package.json b/libs/accelerator/package.json index e2b217db..bcf65a55 100644 --- a/libs/accelerator/package.json +++ b/libs/accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/accelerator", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/angular-accelerator/package.json b/libs/angular-accelerator/package.json index f4cb4e05..ca6d5697 100644 --- a/libs/angular-accelerator/package.json +++ b/libs/angular-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-accelerator", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-auth/package.json b/libs/angular-auth/package.json index 83dbbb84..c21c089c 100644 --- a/libs/angular-auth/package.json +++ b/libs/angular-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-auth", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular-architects/module-federation": "18.0.4", diff --git a/libs/angular-integration-interface/package.json b/libs/angular-integration-interface/package.json index 73e8184e..77768bd1 100644 --- a/libs/angular-integration-interface/package.json +++ b/libs/angular-integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-integration-interface", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/angular-remote-components/package.json b/libs/angular-remote-components/package.json index 7c35844f..77e7f1ab 100644 --- a/libs/angular-remote-components/package.json +++ b/libs/angular-remote-components/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-remote-components", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/angular-testing/package.json b/libs/angular-testing/package.json index f5f9d53e..c7708769 100644 --- a/libs/angular-testing/package.json +++ b/libs/angular-testing/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-testing", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular/cdk": "^18.0.5", diff --git a/libs/angular-webcomponents/package.json b/libs/angular-webcomponents/package.json index d5dceec5..4afd2b26 100644 --- a/libs/angular-webcomponents/package.json +++ b/libs/angular-webcomponents/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/angular-webcomponents", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular/core": "^18.0.5", diff --git a/libs/integration-interface/package.json b/libs/integration-interface/package.json index fe9b5382..7f8590d0 100644 --- a/libs/integration-interface/package.json +++ b/libs/integration-interface/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/integration-interface", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3", diff --git a/libs/keycloak-auth/package.json b/libs/keycloak-auth/package.json index dd16bf2c..0e674972 100644 --- a/libs/keycloak-auth/package.json +++ b/libs/keycloak-auth/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/keycloak-auth", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/ngrx-accelerator/package.json b/libs/ngrx-accelerator/package.json index a25c02b4..630e2c14 100644 --- a/libs/ngrx-accelerator/package.json +++ b/libs/ngrx-accelerator/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/ngrx-accelerator", - "version": "5.9.4", + "version": "5.9.5", "peerDependencies": { "@angular/core": "^18.0.5", "@angular/router": "^18.0.5", diff --git a/libs/portal-integration-angular/package.json b/libs/portal-integration-angular/package.json index df725234..095cbb8b 100644 --- a/libs/portal-integration-angular/package.json +++ b/libs/portal-integration-angular/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-integration-angular", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "@angular/common": "^18.0.5", diff --git a/libs/portal-layout-styles/package.json b/libs/portal-layout-styles/package.json index ac6c8970..6c72c9ec 100644 --- a/libs/portal-layout-styles/package.json +++ b/libs/portal-layout-styles/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/portal-layout-styles", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "tslib": "^2.6.3" diff --git a/libs/shell-core/package.json b/libs/shell-core/package.json index f15da5cc..671b3d5d 100644 --- a/libs/shell-core/package.json +++ b/libs/shell-core/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/shell-core", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "peerDependencies": { "rxjs": "7.8.1", diff --git a/package.json b/package.json index 2b7fea98..06c03217 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@onecx/onecx-portal-ui-libs", - "version": "5.9.4", + "version": "5.9.5", "license": "Apache-2.0", "scripts": { "sass": "npx sass libs/portal-integration-angular/assets/styles.scss libs/portal-integration-angular/assets/output.css",