diff --git a/app/src/app.config.json b/app/src/app.config.json index a81a4f88e5..d865a996c1 100644 --- a/app/src/app.config.json +++ b/app/src/app.config.json @@ -1137,6 +1137,7 @@ "downloadPromptDelay": 50, "downloadPromptReminderDelay": 30, "enableFileAutoDownload": true, - "fileAutoDownloadSizeThresholdInMB": 15 + "fileAutoDownloadSizeThresholdInMB": 15, + "closeButtonPosition": "right" } } diff --git a/package-lock.json b/package-lock.json index 9f9c696fb4..2fb5a54c35 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,11 @@ "hasInstallScript": true, "license": "LGPL-3.0", "dependencies": { - "@alfresco/adf-content-services": "6.6.0-7307998972", - "@alfresco/adf-core": "6.6.0-7307998972", - "@alfresco/adf-extensions": "6.6.0-7307998972", - "@alfresco/eslint-plugin-eslint-angular": "6.6.0-7307998972", - "@alfresco/js-api": "7.5.0-7307998972", + "@alfresco/adf-content-services": ">=6.6.0-7386887320", + "@alfresco/adf-core": ">=6.6.0-7386887320", + "@alfresco/adf-extensions": ">=6.6.0-7386887320", + "@alfresco/eslint-plugin-eslint-angular": ">=6.6.0-7386887320", + "@alfresco/js-api": ">=7.5.0-7386887320", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", "@angular/common": "14.1.3", @@ -42,8 +42,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": "6.6.0-7307998972", - "@alfresco/adf-testing": "6.6.0-7307998972", + "@alfresco/adf-cli": ">=6.6.0-7386887320", + "@alfresco/adf-testing": ">=6.6.0-7386887320", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", @@ -115,12 +115,12 @@ "dev": true }, "node_modules/@alfresco/adf-cli": { - "version": "6.6.0-7307998972", - "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.6.0-7307998972.tgz", - "integrity": "sha512-qPQ3TyYubGEl4u7tETLGv8hLoT40mUuGC7PDUuthfTXlqHRgjLb6MffA7L4bXYwdJ131DWYNJwaZstgjF6rGYw==", + "version": "6.6.0-7386887320", + "resolved": "https://registry.npmjs.org/@alfresco/adf-cli/-/adf-cli-6.6.0-7386887320.tgz", + "integrity": "sha512-3fpcTnJj7GwAJOYlKZ1WrH8zevCU/ZI18+O+03d2dvW2RLb+S6m3weUS/eXXGDpP134E1HNZhu4mYCByZja41w==", "dev": true, "dependencies": { - "@alfresco/js-api": ">=7.5.0-7307998972", + "@alfresco/js-api": ">=7.5.0-7386887320", "commander": "^6.2.1", "ejs": "^3.1.9", "license-checker": "^25.0.1", @@ -135,15 +135,15 @@ } }, "node_modules/@alfresco/adf-content-services": { - "version": "6.6.0-7307998972", - "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.6.0-7307998972.tgz", - "integrity": "sha512-BddL7j4H0nL7WAuoiaLAJspI8LubCWLsMOIBrkru9CYeYFZ+xiYwv5F3F88Njtyj7SX2Hm2OV0NkFDjsjDkaIw==", + "version": "6.6.0-7386887320", + "resolved": "https://registry.npmjs.org/@alfresco/adf-content-services/-/adf-content-services-6.6.0-7386887320.tgz", + "integrity": "sha512-Tue8NA82jUxjfS8SLoNo3lxoH122xL13J37xrpnSPgMlTA1Y8aqp5DAl+wQC1N/wQgIBR2t+4XXVyPvChazXSQ==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-core": ">=6.6.0-7307998972", - "@alfresco/js-api": ">=7.5.0-7307998972", + "@alfresco/adf-core": ">=6.6.0-7386887320", + "@alfresco/js-api": ">=7.5.0-7386887320", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", "@angular/common": ">=14.1.3", @@ -158,9 +158,9 @@ } }, "node_modules/@alfresco/adf-core": { - "version": "6.6.0-7307998972", - "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.6.0-7307998972.tgz", - "integrity": "sha512-Z25eAzXPyhFBr9qxBA4cFtZ1HPr+ZnNtzlr9NJ9ZCz38vJHPvpny+6F+B1LVjxhZIfzEWzPGmKAByvYW5vM8/A==", + "version": "6.6.0-7386887320", + "resolved": "https://registry.npmjs.org/@alfresco/adf-core/-/adf-core-6.6.0-7386887320.tgz", + "integrity": "sha512-VhCZOy5s0K3Ny2Z/dh7khPZjSn5k/EYg9W+pzjeJSfzKdG74/ODq2xV7ZfQniNa7q/PgIMF+RBKPkVVLBBfUZw==", "dependencies": { "angular-oauth2-oidc": "^13.0.1", "angular-oauth2-oidc-jwks": "^13.0.1", @@ -168,8 +168,8 @@ "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/adf-extensions": ">=6.6.0-7307998972", - "@alfresco/js-api": ">=7.5.0-7307998972", + "@alfresco/adf-extensions": ">=6.6.0-7386887320", + "@alfresco/js-api": ">=7.5.0-7386887320", "@angular/animations": ">=14.1.3", "@angular/cdk": ">=14.1.2", "@angular/common": ">=14.1.3", @@ -184,25 +184,25 @@ } }, "node_modules/@alfresco/adf-extensions": { - "version": "6.6.0-7307998972", - "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.6.0-7307998972.tgz", - "integrity": "sha512-NsESA4GUB2eG6oUfHGSERFR/pUIjSOssFw3Kb/LzK7HeQpwc9xkNZrn0J3SZJZK3wPA6b9/C5ZPWVnlpCV8kNw==", + "version": "6.6.0-7386887320", + "resolved": "https://registry.npmjs.org/@alfresco/adf-extensions/-/adf-extensions-6.6.0-7386887320.tgz", + "integrity": "sha512-6t6VgJBnfApedmrTE7lzIkYqEpikFNVkf/pSY9rmGX87TyB4Zw2nFKuShGEGybc1/XYzgj+iD4YXi5yzueAqqw==", "dependencies": { "tslib": "^2.3.0" }, "peerDependencies": { - "@alfresco/js-api": ">=7.5.0-7307998972", + "@alfresco/js-api": ">=7.5.0-7386887320", "@angular/common": ">=14.1.3", "@angular/core": ">=14.1.3" } }, "node_modules/@alfresco/adf-testing": { - "version": "6.6.0-7307998972", - "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.6.0-7307998972.tgz", - "integrity": "sha512-lm+IoORPR/Sl8j0gX8QQ7KgO0vD7niBpfW9cYwZRd/KQz7mwimN1byXLk5fLpX3UcgbHMTZr13ppyVDwJ2fAsg==", + "version": "6.6.0-7386887320", + "resolved": "https://registry.npmjs.org/@alfresco/adf-testing/-/adf-testing-6.6.0-7386887320.tgz", + "integrity": "sha512-1U0VnKyAI9NL/BRS9NchPsKnopXhqqfiOlwF/z7mnClSEOOMD68KiOtrqozqUCqNR8KC0TabO1XEYlmxXbmICg==", "dev": true, "dependencies": { - "@alfresco/js-api": ">=7.5.0-7307998972", + "@alfresco/js-api": ">=7.5.0-7386887320", "@angular/compiler": "14.1.3", "@angular/core": "14.1.3", "date-fns": "^2.30.0", @@ -213,18 +213,18 @@ "zone.js": "~0.11.4" }, "peerDependencies": { - "@alfresco/js-api": ">=7.5.0-7307998972" + "@alfresco/js-api": ">=7.5.0-7386887320" } }, "node_modules/@alfresco/eslint-plugin-eslint-angular": { - "version": "6.6.0-7307998972", - "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.6.0-7307998972.tgz", - "integrity": "sha512-rUDFEffr1e8yeYlA+e8SCSJGtgzrjwcWz7cE5kHoJ2UGq9L93My6NhThEs3FQWUXkROo83I4fFlGEk43XXdaww==" + "version": "6.6.0-7386887320", + "resolved": "https://registry.npmjs.org/@alfresco/eslint-plugin-eslint-angular/-/eslint-plugin-eslint-angular-6.6.0-7386887320.tgz", + "integrity": "sha512-Y2/tzkWHCbmJXvm9g0t7dJHzyljvWed3sHqAqDnysP6CiKYDLQDpQ7siRQjec5Zmf8XpH++VEEqMKCmxwbnvFA==" }, "node_modules/@alfresco/js-api": { - "version": "7.5.0-7307998972", - "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.5.0-7307998972.tgz", - "integrity": "sha512-pWI8/MzcE5qPkFw/hqu5oMXUXuEUkIeBUgZf4lufFvd69VNS9hyIRcAgGpRQ+gPxyuvS4OTC1Dze5LjzAZO73Q==", + "version": "7.5.0-7386887320", + "resolved": "https://registry.npmjs.org/@alfresco/js-api/-/js-api-7.5.0-7386887320.tgz", + "integrity": "sha512-HlysaYW8RUx/PmAV3lrXA332XtCZjWlmll1CQmC5wHWYKcRaQ7OFaT05Ji+2CdhNcY5wVsOmTksuqVjOV/726w==", "dependencies": { "event-emitter": "^0.3.5", "superagent": "^8.0.9", diff --git a/package.json b/package.json index face59e95a..2b0cf240af 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,11 @@ }, "private": true, "dependencies": { - "@alfresco/adf-content-services": ">=6.6.0-7307998972", - "@alfresco/adf-core": ">=6.6.0-7307998972", - "@alfresco/adf-extensions": ">=6.6.0-7307998972", - "@alfresco/eslint-plugin-eslint-angular": ">=6.6.0-7307998972", - "@alfresco/js-api": ">=7.5.0-7307998972", + "@alfresco/adf-content-services": ">=6.6.0-7386887320", + "@alfresco/adf-core": ">=6.6.0-7386887320", + "@alfresco/adf-extensions": ">=6.6.0-7386887320", + "@alfresco/eslint-plugin-eslint-angular": ">=6.6.0-7386887320", + "@alfresco/js-api": ">=7.5.0-7386887320", "@angular/animations": "14.1.3", "@angular/cdk": "14.1.3", "@angular/common": "14.1.3", @@ -65,8 +65,8 @@ "zone.js": "0.11.8" }, "devDependencies": { - "@alfresco/adf-cli": ">=6.6.0-7307998972", - "@alfresco/adf-testing": ">=6.6.0-7307998972", + "@alfresco/adf-cli": ">=6.6.0-7386887320", + "@alfresco/adf-testing": ">=6.6.0-7386887320", "@angular-devkit/build-angular": "14.2.11", "@angular-devkit/core": "14.1.2", "@angular-devkit/schematics": "14.1.2", diff --git a/projects/aca-content/src/lib/components/details/details.component.html b/projects/aca-content/src/lib/components/details/details.component.html index fcc9101aa7..d0c1bc6d56 100644 --- a/projects/aca-content/src/lib/components/details/details.component.html +++ b/projects/aca-content/src/lib/components/details/details.component.html @@ -9,7 +9,7 @@
- {{ 'APP.INFO_DRAWER.ICON' | translate }} + {{ 'APP.INFO_DRAWER.ICON' | translate }} {{ node.name }}
@@ -36,7 +36,7 @@ - + diff --git a/projects/aca-content/src/lib/components/details/details.component.spec.ts b/projects/aca-content/src/lib/components/details/details.component.spec.ts index 3856abecc9..591fd64b09 100644 --- a/projects/aca-content/src/lib/components/details/details.component.spec.ts +++ b/projects/aca-content/src/lib/components/details/details.component.spec.ts @@ -30,7 +30,7 @@ import { BehaviorSubject, of, Subject } from 'rxjs'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { Store } from '@ngrx/store'; import { ContentApiService } from '@alfresco/aca-shared'; -import { STORE_INITIAL_APP_DATA, SetSelectedNodesAction, NavigateToFolder } from '@alfresco/aca-shared/store'; +import { NavigateToFolder, SetSelectedNodesAction, STORE_INITIAL_APP_DATA } from '@alfresco/aca-shared/store'; import { NodeEntry, PathElement } from '@alfresco/js-api'; import { RouterTestingModule } from '@angular/router/testing'; import { AuthenticationService, PageTitleService } from '@alfresco/adf-core'; @@ -201,4 +201,45 @@ describe('DetailsComponent', () => { fail(`An error occurred: ${error}`); }); }); + + it('should disable the permissions tab for smart folders based on aspects', () => { + node.entry.isFolder = true; + node.entry.aspectNames = ['smf:customConfigSmartFolder']; + fixture.detectChanges(); + component.ngOnInit(); + expect(component.canManagePermissions).toBeFalse(); + expect(component.activeTab).not.toBe(2); + }); + + it('should enable the permissions tab for regular folders based on aspects', () => { + node.entry.isFolder = true; + node.entry.aspectNames = []; + fixture.detectChanges(); + component.ngOnInit(); + + expect(component.canManagePermissions).toBeTrue(); + }); + + it('should change active tab based on canManagePermissions and tabName', () => { + component.nodeId = 'someNodeId'; + component.activeTab = 0; + + node.entry.isFolder = true; + node.entry.aspectNames = []; + + fixture.detectChanges(); + component.ngOnInit(); + + component.setActiveTab('permissions'); + expect(component.activeTab).toBe(2); + + node.entry.isFolder = true; + node.entry.aspectNames = ['smf:customConfigSmartFolder']; + + fixture.detectChanges(); + component.ngOnInit(); + + component.setActiveTab('permissions'); + expect(component.activeTab).not.toBe(2); + }); }); diff --git a/projects/aca-content/src/lib/components/details/details.component.ts b/projects/aca-content/src/lib/components/details/details.component.ts index 95ebbb1c19..245cf3b122 100644 --- a/projects/aca-content/src/lib/components/details/details.component.ts +++ b/projects/aca-content/src/lib/components/details/details.component.ts @@ -22,7 +22,7 @@ * from Hyland Software. If not, see . */ -import { Component, OnInit, ViewEncapsulation, OnDestroy } from '@angular/core'; +import { Component, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { ContentApiService, PageComponent, PageLayoutComponent, ToolbarComponent } from '@alfresco/aca-shared'; import { NavigateToFolder, NavigateToPreviousPage, SetSelectedNodesAction } from '@alfresco/aca-shared/store'; @@ -68,6 +68,7 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy activeTab = 1; aspectActions: Array = []; nodeIcon: string; + canManagePermissions = true; constructor(private route: ActivatedRoute, private contentApi: ContentApiService, private contentService: ContentService) { super(); @@ -79,7 +80,6 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy const { route } = this; const { data } = route.snapshot; this.title = data.title; - this.route.params.subscribe((params) => { this.isLoading = true; this.setActiveTab(params.activeTab); @@ -87,6 +87,8 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy this.contentApi.getNode(this.nodeId).subscribe((node) => { this.node = node.entry; this.isLoading = false; + this.canManagePermissions = !this.isSmartFolder(); + this.setActiveTab(params.activeTab); this.store.dispatch(new SetSelectedNodesAction([{ entry: this.node }])); this.nodeIcon = this.contentService.getNodeIcon(this.node); }); @@ -105,6 +107,10 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy this.activeTab = 1; break; case 'permissions': + if (!this.canManagePermissions) { + this.activeTab = 0; + break; + } this.activeTab = 2; break; case 'metadata': @@ -126,4 +132,12 @@ export class DetailsComponent extends PageComponent implements OnInit, OnDestroy this.onDestroy$.next(); this.onDestroy$.complete(); } + + private isSmartFolder(): boolean { + if (!this.node?.isFolder) { + return false; + } + const nodeAspects = this.node.aspectNames ?? []; + return nodeAspects.includes('smf:customConfigSmartFolder') || nodeAspects.includes('smf:systemConfigSmartFolder'); + } } diff --git a/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.html b/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.html index 62b2ac4c9e..da74769ac2 100644 --- a/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.html +++ b/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.html @@ -13,6 +13,8 @@ [allowDownload]="false" [allowFullScreen]="false" [overlayMode]="true" + [hideInfoButton]="true" + [closeButtonPosition]="'viewer.closeButtonPosition' | adfAppConfig: 'right'" (showViewerChange)="onViewerVisibilityChanged()" [canNavigateBefore]="!!previousNodeId" [canNavigateNext]="!!nextNodeId" diff --git a/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.scss b/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.scss index 31ae358f5d..cc70ed5e2d 100644 --- a/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.scss +++ b/projects/aca-content/viewer/src/lib/components/viewer/viewer.component.scss @@ -16,11 +16,6 @@ } } - // todo: remove this when viewer supports extensions - .adf-viewer-toolbar > * > button:last-child { - display: none; - } - .adf-alfresco-viewer.aca-right_side--hide .adf-viewer__sidebar__right { width: 0; } diff --git a/projects/aca-testing-shared/src/components/viewer/viewer.ts b/projects/aca-testing-shared/src/components/viewer/viewer.ts index 54d0467dda..0d04617c4f 100755 --- a/projects/aca-testing-shared/src/components/viewer/viewer.ts +++ b/projects/aca-testing-shared/src/components/viewer/viewer.ts @@ -103,7 +103,7 @@ export class Viewer extends Component { } async clickCloseButton(): Promise { - const closeButton: ElementFinder = element(by.css('button[data-automation-id="adf-toolbar-back"]')); + const closeButton: ElementFinder = element(by.css('button.adf-viewer-close-button')); await BrowserActions.click(closeButton); } }