From 6b8bd4685c6ecfaa4290ab15758e2e4924459476 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Thu, 9 Aug 2018 13:35:56 +0100 Subject: [PATCH] fix mat datetime picker regression --- .../config-editor.component.html | 9 ++++++ .../config-editor/config-editor.component.ts | 29 +++++++++++++++++-- .../overlay-viewer.component.html | 12 +++++++- .../overlay-viewer.component.ts | 5 ++++ lib/core/info-drawer/info-drawer.component.ts | 2 +- lib/core/package.json | 2 ++ .../viewer/components/viewer.component.ts | 2 +- package.json | 4 +-- 8 files changed, 58 insertions(+), 7 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 4635729609..fd2ede0d81 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 @@ -18,3 +18,12 @@
+ +

Excluded File config editor

+ + + + + + +
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 df7426f481..0de4c59baf 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 @@ -27,6 +27,7 @@ export class ConfigEditorComponent { editor: any; editorSearch: any; + editorExcludedFile: any; editorOptions = { theme: 'vs-dark', @@ -38,6 +39,7 @@ export class ConfigEditorComponent { metadataConf: string; searchConf: string; + excludedFileConf: string; onInitMetadata(editor) { this.editor = editor; @@ -53,9 +55,17 @@ export class ConfigEditorComponent { }, 1000); } + onInitExcludedFile(excludedFile) { + this.editorExcludedFile = excludedFile; + setTimeout(() => { + this.editorExcludedFile.getAction('editor.action.formatDocument').run(); + }, 1000); + } + constructor(private appConfig: AppConfigService, private notificationService: NotificationService) { this.metadataConf = JSON.stringify(appConfig.config['content-metadata']); this.searchConf = JSON.stringify(appConfig.config['search']); + this.excludedFileConf = JSON.stringify(appConfig.config['files']); } onSaveMetadata() { @@ -71,10 +81,21 @@ export class ConfigEditorComponent { onSaveSearch() { try { - this.appConfig.config['search'] = JSON.parse(this.editor.getValue()); + this.appConfig.config['search'] = JSON.parse(this.editorSearch.getValue()); } catch (error) { this.notificationService.openSnackMessage( - 'Wrong sSearch configuration', + 'Wrong search configuration', + 4000 + ); + } + } + + onSaveExcludedFile() { + try { + this.appConfig.config['files'] = JSON.parse(this.editorExcludedFile.getValue()); + } catch (error) { + this.notificationService.openSnackMessage( + 'Wrong exclude file configuration', 4000 ); } @@ -87,4 +108,8 @@ export class ConfigEditorComponent { onClearSearch() { this.searchConf = ''; } + + onClearExcludedFile() { + this.searchConf = ''; + } } diff --git a/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.html b/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.html index 75acdca195..a1378f7d86 100644 --- a/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.html +++ b/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.html @@ -1,5 +1,15 @@

Overlay Viewer

+

+ + Overlay + +

+ @@ -7,6 +17,6 @@ diff --git a/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.ts b/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.ts index e7498177e5..39abfb7eb1 100644 --- a/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.ts +++ b/demo-shell/src/app/components/overlay-viewer/overlay-viewer.component.ts @@ -26,6 +26,11 @@ export class OverlayViewerComponent { showViewer = false; nodeId: string; + isOverlay = true; + + toggleOverlay() { + this.isOverlay = !this.isOverlay; + } showPreview(event) { if (event.value.entry.isFile) { diff --git a/lib/core/info-drawer/info-drawer.component.ts b/lib/core/info-drawer/info-drawer.component.ts index aa093b8b96..b623e8e169 100644 --- a/lib/core/info-drawer/info-drawer.component.ts +++ b/lib/core/info-drawer/info-drawer.component.ts @@ -24,7 +24,7 @@ import { MatTabChangeEvent } from '@angular/material'; export class InfoDrawerTabComponent { /** The title of the tab. */ @Input() - label: string = 'Main tab'; + label: string = ''; /** Icon to render for the tab. */ @Input() diff --git a/lib/core/package.json b/lib/core/package.json index a0d6da5817..f380be1923 100644 --- a/lib/core/package.json +++ b/lib/core/package.json @@ -25,6 +25,8 @@ "@angular/platform-browser": ">=5.1.1", "@angular/platform-browser-dynamic": ">=5.1.1", "@angular/router": ">=5.1.1", + "@mat-datetimepicker/core": "1.0.4", + "@mat-datetimepicker/moment": "1.0.4", "alfresco-js-api": "2.5.0-beta2", "rxjs": ">=6.2.2", "@ngx-translate/core": "^10.0.2", diff --git a/lib/core/viewer/components/viewer.component.ts b/lib/core/viewer/components/viewer.component.ts index 375b19f2f6..5b4c06438d 100644 --- a/lib/core/viewer/components/viewer.component.ts +++ b/lib/core/viewer/components/viewer.component.ts @@ -348,7 +348,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy { this.mimeType = data.content.mimeType; } - this.displayName = data.name; + this.displayName = this.getDisplayName(data.name); this.urlFileContent = this.apiService.contentApi.getContentUrl(data.id); this.urlFileContent = this.cacheBusterNumber ? this.urlFileContent + '&' + this.cacheBusterNumber : this.urlFileContent; diff --git a/package.json b/package.json index c147cd453f..1659f1549d 100644 --- a/package.json +++ b/package.json @@ -72,8 +72,8 @@ "@angular/platform-browser": "6.1.0", "@angular/platform-browser-dynamic": "6.1.0", "@angular/router": "6.1.0", - "@mat-datetimepicker/core": "2.0.1", - "@mat-datetimepicker/moment": "2.0.1", + "@mat-datetimepicker/core": "1.0.4", + "@mat-datetimepicker/moment": "1.0.4", "@ngx-translate/core": "10.0.2", "@nrwl/schematics": "^1.0.3", "@schematics/angular": "^0.6.8",