From 6da7152c84a0b19c578115a83a9ca05aee283048 Mon Sep 17 00:00:00 2001 From: Anukriti Singh <106949107+AnukritiGL@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:27:30 +0530 Subject: [PATCH] [MNT-23433] Close Preview button position (#3535) * [MNT-23433] preview button configure * [MNT-23433] e2e fix * [MNT-23433] e2e fix for protractor * [MNT-23433] default position set to right * [MNT-23433] close button added for e2e * [MNT-23433] documentation added * [MNT-23433] removed close button from toolbar * [MNT-23433] passing close button position * [MNT-23433] hide info icon * [MNT-23433] add property for info button * Upstream ADF-6.6.0-7386887320, Js-api-7.5.0-7386887320 version --- app/src/app.config.json | 3 +- package-lock.json | 72 +++++++++---------- package.json | 14 ++-- .../components/viewer/viewer.component.html | 2 + .../components/viewer/viewer.component.scss | 5 -- .../src/components/viewer/viewer.ts | 2 +- 6 files changed, 48 insertions(+), 50 deletions(-) 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/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); } }