mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-3384] Create automated tests for Version Component (#3631)
* fix version component restore and delete event * version manager actions * fix test * fix unit test * remove fdescribe * fix tslint * fix screenshot rewrite problem * remove fdescribe * multi instance try * remove fdescribe * try uncomment some test * error page * fix user preferences pagiantion * search page test include * fix type tslint e2e * restore code * default lang momentadapter * fix test * [ADF-3384] removed console log from test * [ADF-3384] adding some fixes for tests and code * [ADF-3384] fixed some test and code
This commit is contained in:
committed by
Eugenio Romano
parent
17074478e2
commit
a12662e7e2
@@ -7,3 +7,14 @@
|
||||
<button mat-raised-button id="adf-metadata-clear" (click)="onClearMetadata()" color="primary">Clear metadata configuration</button>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
|
||||
<h2>Search App config editor</h2>
|
||||
|
||||
<ngx-monaco-editor id="adf-search-editor" class="adf-search-editor" [options]="editorOptions" [(ngModel)]="searchConf" (onInit)="onInitSearch($event)" ></ngx-monaco-editor>
|
||||
|
||||
<button mat-raised-button id="adf-search-save" (click)="onSaveSearch()" color="primary">Save Search configuration</button>
|
||||
<button mat-raised-button id="adf-search-clear" (click)="onClearSearch()" color="primary">Clear Search configuration</button>
|
||||
|
||||
<br>
|
||||
|
@@ -26,6 +26,7 @@ import { AppConfigService, NotificationService } from '@alfresco/adf-core';
|
||||
export class ConfigEditorComponent {
|
||||
|
||||
editor: any;
|
||||
editorSearch: any;
|
||||
|
||||
editorOptions = {
|
||||
theme: 'vs-dark',
|
||||
@@ -36,6 +37,7 @@ export class ConfigEditorComponent {
|
||||
};
|
||||
|
||||
metadataConf: string;
|
||||
searchConf: string;
|
||||
|
||||
onInitMetadata(editor) {
|
||||
this.editor = editor;
|
||||
@@ -44,8 +46,16 @@ export class ConfigEditorComponent {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
onInitSearch(editor) {
|
||||
this.editorSearch = editor;
|
||||
setTimeout(() => {
|
||||
this.editorSearch.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']);
|
||||
}
|
||||
|
||||
onSaveMetadata() {
|
||||
@@ -59,7 +69,22 @@ export class ConfigEditorComponent {
|
||||
}
|
||||
}
|
||||
|
||||
onSaveSearch() {
|
||||
try {
|
||||
this.appConfig.config['search'] = JSON.parse(this.editor.getValue());
|
||||
} catch (error) {
|
||||
this.notificationService.openSnackMessage(
|
||||
'Wrong sSearch configuration',
|
||||
4000
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
onClearMetadata() {
|
||||
this.metadataConf = '';
|
||||
}
|
||||
|
||||
onClearSearch() {
|
||||
this.searchConf = '';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user