fix mat datetime picker regression

This commit is contained in:
Eugenio Romano
2018-08-09 13:35:56 +01:00
parent f5e264d0fc
commit 6b8bd4685c
8 changed files with 58 additions and 7 deletions

View File

@@ -18,3 +18,12 @@
<button mat-raised-button id="adf-search-clear" (click)="onClearSearch()" color="primary">Clear Search configuration</button>
<br>
<h2>Excluded File config editor</h2>
<ngx-monaco-editor id="adf-excluded-file" class="adf-excluded-file-editor" [options]="editorOptions" [(ngModel)]="excludedFileConf" (onInit)="onInitExcludedFile($event)" ></ngx-monaco-editor>
<button mat-raised-button id="adf-excluded-file-save" (click)="onSaveExcludedFile()" color="primary">Save excluded file configuration</button>
<button mat-raised-button id="adf-excluded-file-clear" (click)="onClearExcludedFile()" color="primary">Clear excluded file configuration</button>
<br>

View File

@@ -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 = '';
}
}

View File

@@ -1,5 +1,15 @@
<h1>Overlay Viewer</h1>
<p class="toggle">
<mat-slide-toggle
id="adf-viewer-overlay"
[color]="'primary'"
(change)="toggleOverlay()"
[checked]="isOverlay">
Overlay
</mat-slide-toggle>
</p>
<adf-document-list
currentFolderId="-my-"
(preview)="showPreview($event)">
@@ -7,6 +17,6 @@
<adf-viewer
[(showViewer)]="showViewer"
[overlayMode]="true"
[overlayMode]="isOverlay"
[fileNodeId]="nodeId">
</adf-viewer>

View File

@@ -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) {

View File

@@ -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()

View File

@@ -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",

View File

@@ -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;

View File

@@ -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",