From 58f61fd836d166a79402488d763d15546d05e9a2 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Wed, 3 Oct 2018 11:29:55 +0100 Subject: [PATCH] [ADF-3643] Viewer shows both sidebar icons (#3852) * Viewer shows both sidebar icons * update readme * add config editor for start-process --- .../config-editor.component.html | 21 +++ .../config-editor/config-editor.component.ts | 18 ++ .../file-view/file-view.component.html | 13 +- .../file-view/file-view.component.ts | 5 + docs/core/viewer.component.md | 3 +- .../viewer/components/viewer.component.html | 4 +- .../components/viewer.component.spec.ts | 168 ++++++++++++------ .../viewer/components/viewer.component.ts | 8 +- 8 files changed, 179 insertions(+), 61 deletions(-) diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.html b/demo-shell/src/app/components/config-editor/config-editor.component.html index 3f61f4d970..8190537002 100644 --- a/demo-shell/src/app/components/config-editor/config-editor.component.html +++ b/demo-shell/src/app/components/config-editor/config-editor.component.html @@ -20,6 +20,27 @@ info + + + Task header + + + + + Process instance Header + + + + + Start process + +
diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.ts b/demo-shell/src/app/components/config-editor/config-editor.component.ts index b1cbd5e75f..ecdd090965 100644 --- a/demo-shell/src/app/components/config-editor/config-editor.component.ts +++ b/demo-shell/src/app/components/config-editor/config-editor.component.ts @@ -87,6 +87,24 @@ export class ConfigEditorComponent { this.indentCode(); } + taskHeaderConfClick() { + this.code = JSON.stringify(this.appConfig.config['adf-task-header']); + this.field = 'adf-task-header'; + this.indentCode(); + } + + processInstanceHeaderConfClick() { + this.code = JSON.stringify(this.appConfig.config['adf-process-instance-header']); + this.field = 'adf-process-instance-header'; + this.indentCode(); + } + + startProcessConfClick() { + this.code = JSON.stringify(this.appConfig.config['adf-start-process']); + this.field = 'adf-start-process'; + this.indentCode(); + } + indentCode() { setTimeout(() => { this.editor.getAction('editor.action.formatDocument').run(); diff --git a/demo-shell/src/app/components/file-view/file-view.component.html b/demo-shell/src/app/components/file-view/file-view.component.html index 8bb715b546..e470a96e5d 100644 --- a/demo-shell/src/app/components/file-view/file-view.component.html +++ b/demo-shell/src/app/components/file-view/file-view.component.html @@ -224,7 +224,17 @@ [color]="'primary'" (change)="toggleAllowSidebar()" [checked]="allowSidebar"> - Allow Sidebar + Allow Right Sidebar + +

+ +

+ + Allow Left Sidebar

@@ -268,6 +278,7 @@ [allowPrint]="allowPrint" [allowDownload]="allowDownload" [allowSidebar]="allowSidebar" + [allowLeftSidebar]="allowLeftSidebar" [urlFile]="urlFile" [sidebarLeftTemplate]="sidebarLeftTemplate" [sidebarTemplate]="sidebarRightTemplate"> diff --git a/demo-shell/src/app/components/file-view/file-view.component.ts b/demo-shell/src/app/components/file-view/file-view.component.ts index 51a06bf4d7..63e7c0c28c 100644 --- a/demo-shell/src/app/components/file-view/file-view.component.ts +++ b/demo-shell/src/app/components/file-view/file-view.component.ts @@ -45,6 +45,7 @@ export class FileViewComponent implements OnInit { allowPrint = true; allowShare = true; allowSidebar = true; + allowLeftSidebar = true; moreActions = true; customName = false; fileUrlSwitch = false; @@ -136,6 +137,10 @@ export class FileViewComponent implements OnInit { this.allowSidebar = !this.allowSidebar; } + toggleAllowLeftSidebar() { + this.allowLeftSidebar = !this.allowLeftSidebar; + } + toggleCustomName() { this.customName = !this.customName; diff --git a/docs/core/viewer.component.md b/docs/core/viewer.component.md index 3c75ce949e..9b1688a5b1 100644 --- a/docs/core/viewer.component.md +++ b/docs/core/viewer.component.md @@ -78,10 +78,11 @@ See the [Custom layout](#custom-layout) section for full details of all availabl | allowDownload | `boolean` | true | Toggles downloading. | | allowFullScreen | `boolean` | true | Toggles the 'Full Screen' feature. | | allowGoBack | `boolean` | true | Allows `back` navigation | +| allowLeftSidebar | `boolean` | false | Allow the left the sidebar. | | allowNavigate | `boolean` | false | Toggles before/next navigation. You can use the arrow buttons to navigate between documents in the collection. | | allowPrint | `boolean` | false | Toggles printing. | | allowShare | `boolean` | false | (**Deprecated:** 2.5.0 - inject the share button directive as custom button) Toggles sharing. | -| allowSidebar | `boolean` | false | Toggles the sidebar. | +| allowSidebar | `boolean` | false | (**Deprecated:** 2.5.0 - will be renamed allowRightSidebar in 3.0.0) Allow the right sidebar. | | allowThumbnails | `boolean` | true | Toggles PDF thumbnails. | | blobFile | [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob) | | Loads a [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) File | | canNavigateBefore | `boolean` | true | Toggles the "before" ("<") button. Requires `allowNavigate` to be enabled. | diff --git a/lib/core/viewer/components/viewer.component.html b/lib/core/viewer/components/viewer.component.html index f29a082b3e..cb3c350204 100644 --- a/lib/core/viewer/components/viewer.component.html +++ b/lib/core/viewer/components/viewer.component.html @@ -10,7 +10,7 @@ - +