Skip to content

Commit

Permalink
[MNT-23433] removed close button from toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
AnukritiGL committed Dec 7, 2023
1 parent 0e09321 commit 187bff8
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 194 deletions.
1 change: 0 additions & 1 deletion docs/extending/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ The button will be visible only when the linked rule evaluates to `true`.
| 1.8.0 | user.isAdmin | Checks if user is admin. |
| 1.9.0 | app.canShowLogout | Whether logout action should be present or not. |
| 1.12.0 | app.isLibraryManager | Checks if user is library manager. |
| 4.4.0 | canClosePreview | Conditionally show/hide the right side viewer close button. |

## Navigation Evaluators

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1058,23 +1058,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,23 +986,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down
17 changes: 0 additions & 17 deletions e2e/protractor/resources/extensibility-configs/header-ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1013,23 +1013,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,23 +986,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,23 +986,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down
17 changes: 0 additions & 17 deletions e2e/protractor/resources/extensibility-configs/metadata-ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -986,23 +986,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down
17 changes: 0 additions & 17 deletions e2e/protractor/resources/extensibility-configs/viewer-ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -1012,23 +1012,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down
43 changes: 22 additions & 21 deletions projects/aca-content/assets/app.extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1177,23 +1177,6 @@
}
}
]
},
{
"id": "app.viewer.separator.1",
"type": "separator",
"order": 11000
},
{
"id": "app.viewer.close",
"order": 12000,
"title": "APP.ACTIONS.CLOSE",
"icon": "close",
"actions": {
"click": "CLOSE_PREVIEW"
},
"rules": {
"visible": "canClosePreview"
}
}
],
"shared": {
Expand Down Expand Up @@ -1512,6 +1495,9 @@
"allowOnlyPredefinedValues": true,
"field": "TAG"
}
},
"rules": {
"visible": "app.areTagsEnabled"
}
},
{
Expand All @@ -1526,6 +1512,9 @@
"allowOnlyPredefinedValues": true,
"field": "cm:categories"
}
},
"rules": {
"visible": "app.areCategoriesEnabled"
}
}
]
Expand Down Expand Up @@ -2177,7 +2166,10 @@
"type": "text",
"sortable": false,
"desktopOnly": true,
"order": 60
"order": 60,
"rules": {
"visible": "app.areTagsEnabled"
}
}
],
"libraries": [
Expand Down Expand Up @@ -2374,7 +2366,10 @@
"type": "text",
"sortable": false,
"desktopOnly": true,
"order": 80
"order": 80,
"rules": {
"visible": "app.areTagsEnabled"
}
}
],
"recent": [
Expand Down Expand Up @@ -2439,7 +2434,10 @@
"type": "text",
"sortable": false,
"desktopOnly": true,
"order": 60
"order": 60,
"rules": {
"visible": "app.areTagsEnabled"
}
}
],
"favorites": [
Expand Down Expand Up @@ -2514,7 +2512,10 @@
"type": "text",
"sortable": false,
"desktopOnly": true,
"order": 70
"order": 70,
"rules": {
"visible": "app.areTagsEnabled"
}
}
],
"trashcan": [
Expand Down
3 changes: 1 addition & 2 deletions projects/aca-content/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,7 @@
"LEAVE": "Leave Library",
"EDIT_OFFLINE": "Edit Offline",
"EDIT_OFFLINE_CANCEL": "Cancel Editing",
"CHANGE_ASPECT": "Edit Aspects",
"CLOSE": "Close"
"CHANGE_ASPECT": "Edit Aspects"
},
"DIALOGS": {
"CONFIRM_PURGE": {
Expand Down
5 changes: 3 additions & 2 deletions projects/aca-content/src/lib/aca-content.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ export class ContentServiceExtensionModule {
canEditAspects: rules.canEditAspects,
canInfoPreview: rules.canInfoPreview,
showInfoSelectionButton: rules.showInfoSelectionButton,
canClosePreview: rules.canClosePreview,

'app.selection.canDelete': rules.canDeleteSelection,
'app.selection.file.canUnlock': rules.canUnlockFile,
Expand Down Expand Up @@ -245,7 +244,9 @@ export class ContentServiceExtensionModule {
'app.isContentServiceEnabled': rules.isContentServiceEnabled,
'app.isUploadSupported': rules.isUploadSupported,
'app.canCreateLibrary': rules.canCreateLibrary,
'app.isSearchSupported': rules.isSearchSupported
'app.isSearchSupported': rules.isSearchSupported,
'app.areTagsEnabled': rules.areTagsEnabled,
'app.areCategoriesEnabled': rules.areCategoriesEnabled
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[allowDownload]="false"
[allowFullScreen]="false"
[overlayMode]="true"
[allowGoBack]="'viewer.isCloseButtonOnLeft' | adfAppConfig: true"
[allowGoBack]="'viewer.isCloseButtonOnLeft' | adfAppConfig: false"
(showViewerChange)="onViewerVisibilityChanged()"
[canNavigateBefore]="!!previousNodeId"
[canNavigateNext]="!!nextNodeId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@
}
}

.adf-viewer-close-button {
padding-left: 12px;
}

// todo: remove this when viewer supports extensions
.adf-viewer-toolbar > * > button:last-child {
.adf-viewer-toolbar > * > button:nth-last-child(3) {
display: none;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class ViewerComponent extends BaseComponent {
private static rootElement = 'adf-viewer';

private viewerLocator = this.getChild('.adf-viewer-render-layout-content');
public closeButtonLocator = this.getChild('button[title="Close"]');
public closeButtonLocator = this.getChild('.adf-viewer-close-button');
public fileTitleButtonLocator = this.getChild('.adf-viewer__file-title');
public pdfViewerContentPages = this.getChild('.adf-pdf-viewer__content .page');
public shareButton = this.getChild('button[id="share-action-button"]');
Expand Down
Loading

0 comments on commit 187bff8

Please sign in to comment.