From 0bc3d7c45f5f16a20344b7da4ce226ef3fa1f80a Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 16 Aug 2021 16:33:31 +0200 Subject: [PATCH] improve compatibility (#2256) * improve compatibility * fix * fix * fix * fix --- package-lock.json | 100 +++++++++--------- package.json | 12 +-- projects/aca-shared/README.md | 3 +- projects/aca-shared/karma.conf.js | 2 +- .../info-drawer/info-drawer.component.html | 19 +--- .../toolbar-action.component.html | 19 +--- .../src/lib/services/content-api.service.ts | 74 +++++++++---- .../aca-shared/store/src/bootstrap-effect.ts | 52 --------- projects/aca-shared/store/src/public-api.ts | 1 - projects/aca-shared/tsconfig.lib.prod.json | 2 +- .../toggle-shared.component.html | 6 +- .../context-menu-item.component.html | 16 +-- .../context-menu/context-menu.component.html | 2 +- .../create-menu/create-menu.component.html | 28 +---- .../components/details/details.component.html | 35 ++---- .../components/details/details.component.scss | 50 ++++----- .../favorites/favorites.component.html | 5 +- .../components/header/header.component.html | 3 +- .../library-metadata-form.component.ts | 10 +- .../search-action-menu.component.html | 24 +++-- .../search-input-control.component.html | 11 +- .../search-input/search-input.component.html | 26 +---- .../search-libraries-query-builder.service.ts | 11 +- .../search-libraries-results.component.html | 57 ++-------- .../search-results.component.html | 48 ++++----- .../shared-link-view.component.html | 12 +-- .../components/expand-menu.component.html | 4 +- src/app/components/viewer/viewer.component.ts | 10 +- src/app/services/node-actions.service.ts | 10 +- src/app/services/node-template.service.ts | 11 +- src/app/store/app-store.module.ts | 11 +- src/app/store/effects/template.effects.ts | 10 +- 32 files changed, 267 insertions(+), 417 deletions(-) delete mode 100644 projects/aca-shared/store/src/bootstrap-effect.ts diff --git a/package-lock.json b/package-lock.json index b123e8c64..72a7e55d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,10 +10,10 @@ "hasInstallScript": true, "license": "LGPL-3.0", "dependencies": { - "@alfresco/adf-content-services": "4.6.0-33212", - "@alfresco/adf-core": "4.6.0-33212", - "@alfresco/adf-extensions": "4.6.0-33212", - "@alfresco/js-api": "4.6.0-3694", + "@alfresco/adf-content-services": "4.6.0-33262", + "@alfresco/adf-core": "4.6.0-33262", + "@alfresco/adf-extensions": "4.6.0-33262", + "@alfresco/js-api": "4.6.0-3780", "@angular/animations": "10.0.4", "@angular/cdk": "^10.0.2", "@angular/common": "10.0.4", @@ -42,8 +42,8 @@ "zone.js": "~0.10.2" }, "devDependencies": { - "@alfresco/adf-cli": "4.6.0-33212", - "@alfresco/adf-testing": "4.6.0-33212", + "@alfresco/adf-cli": "4.6.0-33262", + "@alfresco/adf-testing": "4.6.0-33262", "@angular-custom-builders/lite-serve": "^0.2.3", "@angular-devkit/build-angular": "^0.1002.0", "@angular-devkit/build-ng-packagr": "^0.1002.0", @@ -100,12 +100,12 @@ } }, "node_modules/@alfresco/adf-cli": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-4.6.0-33212.tgz", - "integrity": "sha512-vnBkFg7gTDsoseMbeADq1N6vJir9UbwTu+5DCXud0rNFSvG35BFa/0W3YTrMdei2xQ5FeoVyWCBxRsCgFobMpw==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-4.6.0-33262.tgz", + "integrity": "sha512-5KLtw9Hdk9RzBfWlTw6GKRPKMfjA3ETC7TrYQlU50wf83p0XVSLLh31z+3YDq6bD8gkyGRtGh34xfg5jS/hXbw==", "dev": true, "dependencies": { - "@alfresco/js-api": "4.6.0-3694", + "@alfresco/js-api": "4.6.0-3780", "commander": "^4.0.0", "ejs": "^2.6.1", "license-checker": "^25.0.1", @@ -130,15 +130,15 @@ } }, "node_modules/@alfresco/adf-content-services": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-4.6.0-33212.tgz", - "integrity": "sha512-B8wulX9axEHw/DyxhGFAeeiy7R+gJw3HF+j2WuBJfIfF2me5q2c89wySltqH0jjcn6P3zkHBfYVabC8XdDwNLQ==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-4.6.0-33262.tgz", + "integrity": "sha512-C8UJERqiTyeEC8b89VI/3Ts6BLWj3/fkahTpcA6nhANxdx2hRLqTfrunIDhBcnYmI7L97lnhFPXUzELdyCjo6A==", "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { - "@alfresco/adf-core": "4.6.0-33212", - "@alfresco/js-api": "4.6.0-3694", + "@alfresco/adf-core": "4.6.0-33262", + "@alfresco/js-api": "4.6.0-3780", "@angular/animations": ">=10.0.2", "@angular/cdk": ">=10.0.1", "@angular/common": ">10.0.2", @@ -152,16 +152,16 @@ } }, "node_modules/@alfresco/adf-core": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-4.6.0-33212.tgz", - "integrity": "sha512-RQ7S5UGFc5G1cgUWclPfejpbnWfly0v2qgijFT0OK/J1vUQ5Pt6YvwsZ3P54Uk8LxJf41lqpYWAFFR0kDtjPwQ==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-4.6.0-33262.tgz", + "integrity": "sha512-vOSReILvIXlEL9MkUHJmskQCbQ2FU2YxLIip7i22Yq9I1wHpK1Oj1bNwfPE3qoZo4XyS3CW+mk/7kypi3ZVylQ==", "dependencies": { "cropperjs": "1.5.11", "tslib": "^2.0.0" }, "peerDependencies": { - "@alfresco/adf-extensions": "4.6.0-33212", - "@alfresco/js-api": "4.6.0-3694", + "@alfresco/adf-extensions": "4.6.0-33262", + "@alfresco/js-api": "4.6.0-3780", "@angular/animations": ">=10.0.2", "@angular/cdk": ">=10.0.1", "@angular/common": ">=10.0.2", @@ -180,34 +180,34 @@ } }, "node_modules/@alfresco/adf-extensions": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-4.6.0-33212.tgz", - "integrity": "sha512-pR46X55aEDINhLNwH/+JB/yJvDLrQ18MR4XFlVlrKZbr5/695CJ9ksGeL0JuEZZmp2ZaEq7bjnF9VG3sUox6yA==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-4.6.0-33262.tgz", + "integrity": "sha512-KTCE/6iDZcnIbv+81XufddGQizyv/cmrw+gcc2F1OD6fFj2b+Gnj4JECCAaNhSc0akJxXrY1BHWhL9So5oeuyA==", "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { - "@alfresco/js-api": "4.6.0-3694", + "@alfresco/js-api": "4.6.0-3780", "@angular/common": ">=10.0.2", "@angular/core": ">=10.0.2" } }, "node_modules/@alfresco/adf-testing": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-4.6.0-33212.tgz", - "integrity": "sha512-Ke/xigVpBuTqHyF+7MfJ5n03/V4+cgFpJwcsTdom2nRsZsklfMs6SZ28AUZkrT3NPvxfz0iqbvwb24ZglQXxbQ==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-4.6.0-33262.tgz", + "integrity": "sha512-yDAY82OxIBM3qj14G+l1IoNWEU4GLq4t49dhzY7+37lQwlfIVNlHkSRN0R2nvjZ4zfLxZtMDTQPEXO+IGguFwg==", "dev": true, "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { - "@alfresco/js-api": "4.6.0-3694" + "@alfresco/js-api": "4.6.0-3780" } }, "node_modules/@alfresco/js-api": { - "version": "4.6.0-3694", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-4.6.0-3694.tgz", - "integrity": "sha512-fgK2csttJMqK4zH7CL7I7+u2IbfFepCQSdYXeLoxjjtP8zG7uzIs6H5AXxsTEXUPo+x7sOihtymlckG3tuYzvg==", + "version": "4.6.0-3780", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-4.6.0-3780.tgz", + "integrity": "sha512-/D5BbxXIh0GMpQh+ALGTPXDMOYi9yzBtLIfvpVgD6nHGbMwxVgZ0k5+zHM+fA3x4+OT/brXRZRkfDwTHsiwn6Q==", "dependencies": { "event-emitter": "^0.3.5", "minimatch": "3.0.4", @@ -21407,12 +21407,12 @@ }, "dependencies": { "@alfresco/adf-cli": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-4.6.0-33212.tgz", - "integrity": "sha512-vnBkFg7gTDsoseMbeADq1N6vJir9UbwTu+5DCXud0rNFSvG35BFa/0W3YTrMdei2xQ5FeoVyWCBxRsCgFobMpw==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-4.6.0-33262.tgz", + "integrity": "sha512-5KLtw9Hdk9RzBfWlTw6GKRPKMfjA3ETC7TrYQlU50wf83p0XVSLLh31z+3YDq6bD8gkyGRtGh34xfg5jS/hXbw==", "dev": true, "requires": { - "@alfresco/js-api": "4.6.0-3694", + "@alfresco/js-api": "4.6.0-3780", "commander": "^4.0.0", "ejs": "^2.6.1", "license-checker": "^25.0.1", @@ -21432,43 +21432,43 @@ } }, "@alfresco/adf-content-services": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-4.6.0-33212.tgz", - "integrity": "sha512-B8wulX9axEHw/DyxhGFAeeiy7R+gJw3HF+j2WuBJfIfF2me5q2c89wySltqH0jjcn6P3zkHBfYVabC8XdDwNLQ==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-4.6.0-33262.tgz", + "integrity": "sha512-C8UJERqiTyeEC8b89VI/3Ts6BLWj3/fkahTpcA6nhANxdx2hRLqTfrunIDhBcnYmI7L97lnhFPXUzELdyCjo6A==", "requires": { "tslib": "^2.0.0" } }, "@alfresco/adf-core": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-4.6.0-33212.tgz", - "integrity": "sha512-RQ7S5UGFc5G1cgUWclPfejpbnWfly0v2qgijFT0OK/J1vUQ5Pt6YvwsZ3P54Uk8LxJf41lqpYWAFFR0kDtjPwQ==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-4.6.0-33262.tgz", + "integrity": "sha512-vOSReILvIXlEL9MkUHJmskQCbQ2FU2YxLIip7i22Yq9I1wHpK1Oj1bNwfPE3qoZo4XyS3CW+mk/7kypi3ZVylQ==", "requires": { "cropperjs": "1.5.11", "tslib": "^2.0.0" } }, "@alfresco/adf-extensions": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-4.6.0-33212.tgz", - "integrity": "sha512-pR46X55aEDINhLNwH/+JB/yJvDLrQ18MR4XFlVlrKZbr5/695CJ9ksGeL0JuEZZmp2ZaEq7bjnF9VG3sUox6yA==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-4.6.0-33262.tgz", + "integrity": "sha512-KTCE/6iDZcnIbv+81XufddGQizyv/cmrw+gcc2F1OD6fFj2b+Gnj4JECCAaNhSc0akJxXrY1BHWhL9So5oeuyA==", "requires": { "tslib": "^2.0.0" } }, "@alfresco/adf-testing": { - "version": "4.6.0-33212", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-4.6.0-33212.tgz", - "integrity": "sha512-Ke/xigVpBuTqHyF+7MfJ5n03/V4+cgFpJwcsTdom2nRsZsklfMs6SZ28AUZkrT3NPvxfz0iqbvwb24ZglQXxbQ==", + "version": "4.6.0-33262", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-4.6.0-33262.tgz", + "integrity": "sha512-yDAY82OxIBM3qj14G+l1IoNWEU4GLq4t49dhzY7+37lQwlfIVNlHkSRN0R2nvjZ4zfLxZtMDTQPEXO+IGguFwg==", "dev": true, "requires": { "tslib": "^2.0.0" } }, "@alfresco/js-api": { - "version": "4.6.0-3694", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-4.6.0-3694.tgz", - "integrity": "sha512-fgK2csttJMqK4zH7CL7I7+u2IbfFepCQSdYXeLoxjjtP8zG7uzIs6H5AXxsTEXUPo+x7sOihtymlckG3tuYzvg==", + "version": "4.6.0-3780", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-4.6.0-3780.tgz", + "integrity": "sha512-/D5BbxXIh0GMpQh+ALGTPXDMOYi9yzBtLIfvpVgD6nHGbMwxVgZ0k5+zHM+fA3x4+OT/brXRZRkfDwTHsiwn6Q==", "requires": { "event-emitter": "^0.3.5", "minimatch": "3.0.4", diff --git a/package.json b/package.json index e4b09e73b..4a0a2d0f9 100644 --- a/package.json +++ b/package.json @@ -24,10 +24,10 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": "4.6.0-33212", - "@alfresco/adf-core": "4.6.0-33212", - "@alfresco/adf-extensions": "4.6.0-33212", - "@alfresco/js-api": "4.6.0-3694", + "@alfresco/adf-content-services": "4.6.0-33262", + "@alfresco/adf-core": "4.6.0-33262", + "@alfresco/adf-extensions": "4.6.0-33262", + "@alfresco/js-api": "4.6.0-3780", "@angular/animations": "10.0.4", "@angular/cdk": "^10.0.2", "@angular/common": "10.0.4", @@ -56,8 +56,8 @@ "zone.js": "~0.10.2" }, "devDependencies": { - "@alfresco/adf-cli": "4.6.0-33212", - "@alfresco/adf-testing": "4.6.0-33212", + "@alfresco/adf-cli": "4.6.0-33262", + "@alfresco/adf-testing": "4.6.0-33262", "@angular-custom-builders/lite-serve": "^0.2.3", "@angular-devkit/build-angular": "^0.1002.0", "@angular-devkit/build-ng-packagr": "^0.1002.0", diff --git a/projects/aca-shared/README.md b/projects/aca-shared/README.md index 336cad5cd..25422e1a0 100644 --- a/projects/aca-shared/README.md +++ b/projects/aca-shared/README.md @@ -5,7 +5,8 @@ This library was generated with [Angular CLI](https://github.com/angular/angular ## Code scaffolding Run `ng generate component component-name --project aca-shared` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project aca-shared`. -> Note: Don't forget to add `--project aca-shared` or else it will be added to the default project in your `angular.json` file. + +> Note: Don't forget to add `--project aca-shared` or else it will be added to the default project in your `angular.json` file. ## Build diff --git a/projects/aca-shared/karma.conf.js b/projects/aca-shared/karma.conf.js index f0a6d45f5..0b3d8ad44 100644 --- a/projects/aca-shared/karma.conf.js +++ b/projects/aca-shared/karma.conf.js @@ -1,7 +1,7 @@ // Karma configuration file, see link for more information // https://karma-runner.github.io/1.0/config/configuration-file.html -module.exports = function(config) { +module.exports = function (config) { config.set({ basePath: '', frameworks: ['jasmine', '@angular-devkit/build-angular'], diff --git a/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.html b/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.html index 605f04724..8cc64ea86 100644 --- a/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.html +++ b/projects/aca-shared/src/lib/components/info-drawer/info-drawer.component.html @@ -2,28 +2,15 @@ - + - - - + + diff --git a/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.html b/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.html index 9b2f5f8a2..5e3854181 100644 --- a/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.html +++ b/projects/aca-shared/src/lib/components/tool-bar/toolbar-action/toolbar-action.component.html @@ -1,28 +1,19 @@ - - + - - + - + - - + - + diff --git a/projects/aca-shared/src/lib/services/content-api.service.ts b/projects/aca-shared/src/lib/services/content-api.service.ts index dd95f910e..174b85e22 100644 --- a/projects/aca-shared/src/lib/services/content-api.service.ts +++ b/projects/aca-shared/src/lib/services/content-api.service.ts @@ -58,28 +58,62 @@ import { map } from 'rxjs/operators'; providedIn: 'root' }) export class ContentApiService { - private nodesApi: NodesApi; - private trashcanApi: TrashcanApi; - private sharedLinksApi: SharedlinksApi; - private discoveryApi: DiscoveryApi; - private favoritesApi: FavoritesApi; - private contentApi: ContentApi; - private sitesApi: SitesApi; - private searchApi: SearchApi; - private peopleApi: PeopleApi; - - constructor(private api: AlfrescoApiService, private preferences: UserPreferencesService) { - this.nodesApi = new NodesApi(this.api.getInstance()); - this.trashcanApi = new TrashcanApi(this.api.getInstance()); - this.sharedLinksApi = new SharedlinksApi(this.api.getInstance()); - this.discoveryApi = new DiscoveryApi(this.api.getInstance()); - this.favoritesApi = new FavoritesApi(this.api.getInstance()); - this.contentApi = new ContentApi(this.api.getInstance()); - this.sitesApi = new SitesApi(this.api.getInstance()); - this.searchApi = new SearchApi(this.api.getInstance()); - this.peopleApi = new PeopleApi(this.api.getInstance()); + _nodesApi: NodesApi; + get nodesApi(): NodesApi { + this._nodesApi = this._nodesApi ?? new NodesApi(this.api.getInstance()); + return this._nodesApi; } + _trashcanApi: TrashcanApi; + get trashcanApi(): TrashcanApi { + this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.api.getInstance()); + return this._trashcanApi; + } + + _sharedLinksApi: SharedlinksApi; + get sharedLinksApi(): SharedlinksApi { + this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.api.getInstance()); + return this._sharedLinksApi; + } + + _discoveryApi: DiscoveryApi; + get discoveryApi(): DiscoveryApi { + this._discoveryApi = this._discoveryApi ?? new DiscoveryApi(this.api.getInstance()); + return this._discoveryApi; + } + + _favoritesApi: FavoritesApi; + get favoritesApi(): FavoritesApi { + this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.api.getInstance()); + return this._favoritesApi; + } + + _contentApi: ContentApi; + get contentApi(): ContentApi { + this._contentApi = this._contentApi ?? new ContentApi(this.api.getInstance()); + return this._contentApi; + } + + _sitesApi: SitesApi; + get sitesApi(): SitesApi { + this._sitesApi = this._sitesApi ?? new SitesApi(this.api.getInstance()); + return this._sitesApi; + } + + _searchApi: SearchApi; + get searchApi(): SearchApi { + this._searchApi = this._searchApi ?? new SearchApi(this.api.getInstance()); + return this._searchApi; + } + + _peopleApi: PeopleApi; + get peopleApi(): PeopleApi { + this._peopleApi = this._peopleApi ?? new PeopleApi(this.api.getInstance()); + return this._peopleApi; + } + + constructor(private api: AlfrescoApiService, private preferences: UserPreferencesService) {} + /** * Moves a node to the trashcan. * @param nodeId ID of the target node diff --git a/projects/aca-shared/store/src/bootstrap-effect.ts b/projects/aca-shared/store/src/bootstrap-effect.ts deleted file mode 100644 index ecc52aa29..000000000 --- a/projects/aca-shared/store/src/bootstrap-effect.ts +++ /dev/null @@ -1,52 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2020 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -import { APP_BOOTSTRAP_LISTENER, InjectionToken, Inject, Type } from '@angular/core'; -import { EffectSources } from '@ngrx/effects'; - -export const BOOTSTRAP_EFFECTS = new InjectionToken('Bootstrap Effects'); - -export function bootstrapEffects(effects: Type[], sources: EffectSources) { - return () => { - effects.forEach((effect) => sources.addEffects(effect)); - }; -} - -export function createInstances(...instances: any[]) { - return instances; -} - -export function provideBootstrapEffects(effects: Type[]) { - return [ - effects, - { provide: BOOTSTRAP_EFFECTS, deps: effects, useFactory: createInstances }, - { - provide: APP_BOOTSTRAP_LISTENER, - multi: true, - useFactory: bootstrapEffects, - deps: [[new Inject(BOOTSTRAP_EFFECTS)], EffectSources] - } - ]; -} diff --git a/projects/aca-shared/store/src/public-api.ts b/projects/aca-shared/store/src/public-api.ts index a8c37c45c..3b6ce971a 100644 --- a/projects/aca-shared/store/src/public-api.ts +++ b/projects/aca-shared/store/src/public-api.ts @@ -49,4 +49,3 @@ export * from './selectors/app.selectors'; export * from './states/app.state'; export * from './store.module'; -export * from './bootstrap-effect'; diff --git a/projects/aca-shared/tsconfig.lib.prod.json b/projects/aca-shared/tsconfig.lib.prod.json index b1d501abb..cbae79422 100644 --- a/projects/aca-shared/tsconfig.lib.prod.json +++ b/projects/aca-shared/tsconfig.lib.prod.json @@ -3,4 +3,4 @@ "angularCompilerOptions": { "enableIvy": false } -} \ No newline at end of file +} diff --git a/src/app/components/common/toggle-shared/toggle-shared.component.html b/src/app/components/common/toggle-shared/toggle-shared.component.html index cc718ef1d..da886269b 100644 --- a/src/app/components/common/toggle-shared/toggle-shared.component.html +++ b/src/app/components/common/toggle-shared/toggle-shared.component.html @@ -1,10 +1,6 @@ - - + @@ -20,19 +18,11 @@ - + - diff --git a/src/app/components/context-menu/context-menu.component.html b/src/app/components/context-menu/context-menu.component.html index 55622c7cf..0c6c5c564 100644 --- a/src/app/components/context-menu/context-menu.component.html +++ b/src/app/components/context-menu/context-menu.component.html @@ -1,5 +1,5 @@
-
+
diff --git a/src/app/components/create-menu/create-menu.component.html b/src/app/components/create-menu/create-menu.component.html index 3d388a428..ef0aa9994 100644 --- a/src/app/components/create-menu/create-menu.component.html +++ b/src/app/components/create-menu/create-menu.component.html @@ -1,16 +1,7 @@ - @@ -23,20 +14,11 @@ #createMenu="matMenuTrigger" title="{{ 'APP.NEW_MENU.TOOLTIP' | translate }}" > - queue + queue - +
diff --git a/src/app/components/details/details.component.html b/src/app/components/details/details.component.html index b4f9d9585..605657cca 100644 --- a/src/app/components/details/details.component.html +++ b/src/app/components/details/details.component.html @@ -1,9 +1,6 @@ - - + @@ -15,45 +12,33 @@
-
- {{node.name}} +
+ {{ node.name }} - - {{'APP.INFO_DRAWER.TITLE' | translate}} + {{ 'APP.INFO_DRAWER.TITLE' | translate }}
-
- + - - + - - + - + -
- - + diff --git a/src/app/components/details/details.component.scss b/src/app/components/details/details.component.scss index d77d6f62b..c67c6ae44 100644 --- a/src/app/components/details/details.component.scss +++ b/src/app/components/details/details.component.scss @@ -1,41 +1,41 @@ .acs-details-container { - background-color: var(--theme-card-background-color); - width: 100%; + background-color: var(--theme-card-background-color); + width: 100%; } .adw-details-tabs { - margin-top: 40px; - height: calc(100% - 80px); + margin-top: 40px; + height: calc(100% - 80px); - .mat-tab-body-wrapper { - height: 100%; - } + .mat-tab-body-wrapper { + height: 100%; + } - .mat-tab-labels { - text-transform: uppercase; - } + .mat-tab-labels { + text-transform: uppercase; + } } .acs-details-title { - width: 100%; - display: flex; - align-items: center; - justify-content: space-between; + width: 100%; + display: flex; + align-items: center; + justify-content: space-between; - .acs-close-members-container { - margin-right: 15px; - } + .acs-close-members-container { + margin-right: 15px; + } } .acs-details-breadcrumb { - font-size: 18px; - margin-left: 20px; + font-size: 18px; + margin-left: 20px; - .acs-details-breadcrumb-library { - font-weight: 900; - } + .acs-details-breadcrumb-library { + font-weight: 900; + } - .acs-details-breadcrumb-item { - font-weight: 100; - } + .acs-details-breadcrumb-item { + font-weight: 100; + } } diff --git a/src/app/components/favorites/favorites.component.html b/src/app/components/favorites/favorites.component.html index be3bb9743..4770e1d67 100644 --- a/src/app/components/favorites/favorites.component.html +++ b/src/app/components/favorites/favorites.component.html @@ -26,10 +26,7 @@ (name-click)="handleNodeClick($event)" > - + diff --git a/src/app/components/header/header.component.html b/src/app/components/header/header.component.html index 4189bcf05..1fb0aef2b 100644 --- a/src/app/components/header/header.component.html +++ b/src/app/components/header/header.component.html @@ -14,7 +14,6 @@ - - + diff --git a/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts b/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts index 7f9d2e856..271fdc4be 100644 --- a/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts +++ b/src/app/components/info-drawer/library-metadata-tab/library-metadata-form.component.ts @@ -45,7 +45,11 @@ export class InstantErrorStateMatcher implements ErrorStateMatcher { templateUrl: './library-metadata-form.component.html' }) export class LibraryMetadataFormComponent implements OnInit, OnChanges, OnDestroy { - private queriesApi: QueriesApi; + _queriesApi: QueriesApi; + get queriesApi(): QueriesApi { + this._queriesApi = this._queriesApi ?? new QueriesApi(this.alfrescoApiService.getInstance()); + return this._queriesApi; + } @Input() node: SiteEntry; @@ -70,9 +74,7 @@ export class LibraryMetadataFormComponent implements OnInit, OnChanges, OnDestro onDestroy$: Subject = new Subject(); - constructor(private alfrescoApiService: AlfrescoApiService, protected store: Store) { - this.queriesApi = new QueriesApi(this.alfrescoApiService.getInstance()); - } + constructor(private alfrescoApiService: AlfrescoApiService, protected store: Store) {} get canUpdateLibrary() { return this.node && this.node.entry && this.node.entry.role === 'SiteManager'; diff --git a/src/app/components/search/search-action-menu/search-action-menu.component.html b/src/app/components/search/search-action-menu/search-action-menu.component.html index 0ce03dcd7..301a8d6b7 100644 --- a/src/app/components/search/search-action-menu/search-action-menu.component.html +++ b/src/app/components/search/search-action-menu/search-action-menu.component.html @@ -3,24 +3,30 @@ - + - - - + + - diff --git a/src/app/components/search/search-input-control/search-input-control.component.html b/src/app/components/search/search-input-control/search-input-control.component.html index 2b8201aca..af40db79b 100644 --- a/src/app/components/search/search-input-control/search-input-control.component.html +++ b/src/app/components/search/search-input-control/search-input-control.component.html @@ -6,9 +6,7 @@ (click)="searchSubmit(searchTerm)" [title]="'SEARCH.BUTTON.TOOLTIP' | translate" > - search + search
- clear + clear
diff --git a/src/app/components/search/search-input/search-input.component.html b/src/app/components/search/search-input/search-input.component.html index 9ad8367f3..b9a0ab48f 100644 --- a/src/app/components/search/search-input/search-input.component.html +++ b/src/app/components/search/search-input/search-input.component.html @@ -4,15 +4,8 @@ (menuOpened)="onMenuOpened()" (menuClosed)="syncInputValues()" > -
- -
+ +
- {{ - 'SEARCH.INPUT.HINT' | translate - }} + {{ 'SEARCH.INPUT.HINT' | translate }}
= new Subject(); executed: Subject = new Subject(); @@ -57,9 +62,7 @@ export class SearchLibrariesQueryBuilderService { this._userQuery = value ? value.trim() : ''; } - constructor(private alfrescoApiService: AlfrescoApiService) { - this.queriesApi = new QueriesApi(this.alfrescoApiService.getInstance()); - } + constructor(private alfrescoApiService: AlfrescoApiService) {} update(): void { const query = this.buildQuery(); diff --git a/src/app/components/search/search-libraries-results/search-libraries-results.component.html b/src/app/components/search/search-libraries-results/search-libraries-results.component.html index 2b799581e..9cc0b6ce1 100644 --- a/src/app/components/search/search-libraries-results/search-libraries-results.component.html +++ b/src/app/components/search/search-libraries-results/search-libraries-results.component.html @@ -12,34 +12,14 @@
- - -
+ +
-
- {{ - 'APP.BROWSE.SEARCH_LIBRARIES.FOUND_RESULTS' - | translate: { number: totalResults } - }} +
+ {{ 'APP.BROWSE.SEARCH_LIBRARIES.FOUND_RESULTS' | translate: { number: totalResults } }}
-
- {{ - 'APP.BROWSE.SEARCH_LIBRARIES.FOUND_ONE_RESULT' - | translate: { number: totalResults } - }} +
+ {{ 'APP.BROWSE.SEARCH_LIBRARIES.FOUND_ONE_RESULT' | translate: { number: totalResults } }}
@@ -58,11 +38,7 @@ > - + - - + - + - +
diff --git a/src/app/components/search/search-results/search-results.component.html b/src/app/components/search/search-results/search-results.component.html index 3de04bb59..d070c8720 100644 --- a/src/app/components/search/search-results/search-results.component.html +++ b/src/app/components/search/search-results/search-results.component.html @@ -12,12 +12,7 @@
- - +
@@ -25,7 +20,7 @@ - +
@@ -44,19 +39,11 @@ (node-dblclick)="handleNodeClick($event)" > - - + - + @@ -72,20 +59,22 @@ - +
- + [ngClass]=" + (infoDrawerPreview$ | async) === true ? 'adf-search-results--right_panel_section-extended' : 'adf-search-results--right_panel_section' + " + *ngIf="infoDrawerOpened$ | async" + > +
@@ -94,7 +83,12 @@
-
diff --git a/src/app/components/viewer/viewer.component.ts b/src/app/components/viewer/viewer.component.ts index 5ff52714f..fb60700a9 100644 --- a/src/app/components/viewer/viewer.component.ts +++ b/src/app/components/viewer/viewer.component.ts @@ -54,7 +54,11 @@ import { Actions, ofType } from '@ngrx/effects'; host: { class: 'app-viewer' } }) export class AppViewerComponent implements OnInit, OnDestroy { - private versionsApi: VersionsApi; + _versionsApi: VersionsApi; + get versionsApi(): VersionsApi { + this._versionsApi = this._versionsApi ?? new VersionsApi(this.apiService.getInstance()); + return this._versionsApi; + } onDestroy$ = new Subject(); @@ -115,9 +119,7 @@ export class AppViewerComponent implements OnInit, OnDestroy { private apiService: AlfrescoApiService, private uploadService: UploadService, private appHookService: AppHookService - ) { - this.versionsApi = new VersionsApi(apiService.getInstance()); - } + ) {} ngOnInit() { this.infoDrawerOpened$ = this.store.select(isInfoDrawerOpened); diff --git a/src/app/services/node-actions.service.ts b/src/app/services/node-actions.service.ts index 2a274f67d..0430c595b 100644 --- a/src/app/services/node-actions.service.ts +++ b/src/app/services/node-actions.service.ts @@ -57,7 +57,11 @@ export class NodeActionsService { moveDeletedEntries: any[] = []; isSitesDestinationAvailable = false; - private nodesApi: NodesApi; + _nodesApi: NodesApi; + get nodesApi(): NodesApi { + this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance()); + return this._nodesApi; + } constructor( private contentService: ContentService, @@ -67,9 +71,7 @@ export class NodeActionsService { private apiService: AlfrescoApiService, private translation: TranslationService, private thumbnailService: ThumbnailService - ) { - this.nodesApi = new NodesApi(this.apiService.getInstance()); - } + ) {} /** * Copy node list diff --git a/src/app/services/node-template.service.ts b/src/app/services/node-template.service.ts index d200dd97b..9a7db03fb 100644 --- a/src/app/services/node-template.service.ts +++ b/src/app/services/node-template.service.ts @@ -45,16 +45,19 @@ export interface TemplateDialogConfig { export class NodeTemplateService { private currentTemplateConfig: TemplateDialogConfig = null; private rootNode: ResultNode; - private searchApi: SearchApi; + + _searchApi: SearchApi; + get searchApi(): SearchApi { + this._searchApi = this._searchApi ?? new SearchApi(this.alfrescoApiService.getInstance()); + return this._searchApi; + } constructor( private store: Store, private alfrescoApiService: AlfrescoApiService, private translation: TranslationService, public dialog: MatDialog - ) { - this.searchApi = new SearchApi(this.alfrescoApiService.getInstance()); - } + ) {} selectTemplateDialog(config: TemplateDialogConfig): Subject { this.currentTemplateConfig = config; diff --git a/src/app/store/app-store.module.ts b/src/app/store/app-store.module.ts index 59d0af74b..904aa096e 100644 --- a/src/app/store/app-store.module.ts +++ b/src/app/store/app-store.module.ts @@ -30,7 +30,7 @@ import { StoreRouterConnectingModule, DefaultRouterStateSerializer } from '@ngrx import { EffectsModule } from '@ngrx/effects'; import { environment } from '../../environments/environment'; import { StoreDevtoolsModule } from '@ngrx/store-devtools'; -import { provideBootstrapEffects, SharedStoreModule } from '@alfresco/aca-shared/store'; +import { SharedStoreModule } from '@alfresco/aca-shared/store'; import { AppEffects, NodeEffects, @@ -62,11 +62,7 @@ import { INITIAL_STATE } from './initial-state'; stateKey: 'router' }), SharedStoreModule, - EffectsModule.forRoot([]), - !environment.production ? StoreDevtoolsModule.instrument({ maxAge: 25 }) : [] - ], - providers: [ - provideBootstrapEffects([ + EffectsModule.forRoot([ AppEffects, NodeEffects, DownloadEffects, @@ -77,7 +73,8 @@ import { INITIAL_STATE } from './initial-state'; FavoriteEffects, TemplateEffects, ContextMenuEffects - ]) + ]), + !environment.production ? StoreDevtoolsModule.instrument({ maxAge: 25 }) : [] ] }) export class AppStoreModule {} diff --git a/src/app/store/effects/template.effects.ts b/src/app/store/effects/template.effects.ts index d8cfb5c48..b24628ce7 100644 --- a/src/app/store/effects/template.effects.ts +++ b/src/app/store/effects/template.effects.ts @@ -46,7 +46,11 @@ import { MatDialog } from '@angular/material/dialog'; @Injectable() export class TemplateEffects { - private nodesApi: NodesApi; + _nodesApi: NodesApi; + get nodesApi(): NodesApi { + this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance()); + return this._nodesApi; + } constructor( private matDialog: MatDialog, @@ -55,9 +59,7 @@ export class TemplateEffects { private apiService: AlfrescoApiService, private actions$: Actions, private nodeTemplateService: NodeTemplateService - ) { - this.nodesApi = new NodesApi(this.apiService.getInstance()); - } + ) {} @Effect({ dispatch: false }) fileFromTemplate$ = this.actions$.pipe(