[no-issue] fix e2e uploader (#3840)

* fix e2e upload
move viewer subbfolder

* fix CS services e2e test

* add log for error in upload delete

* aysnc get node

* new tentative

* attempt 2

* attempt 3

* new demo shell test
travis change for test

* excluded file tslint fix

* remove desktop only class

* renable tests

* decrease time notification

* add process service multiselect demo test
fix e2e

* remove log

* add custom toolbar example
This commit is contained in:
Eugenio Romano
2018-10-02 12:26:13 +01:00
committed by GitHub
parent 77a6f1e902
commit 6a546289b7
58 changed files with 1426 additions and 1343 deletions

View File

@@ -26,8 +26,9 @@ import { AppConfigService, NotificationService } from '@alfresco/adf-core';
export class ConfigEditorComponent {
editor: any;
editorSearch: any;
editorExcludedFile: any;
code: any;
field = 'content-metadata';
invalidJson = false;
editorOptions = {
theme: 'vs-dark',
@@ -37,79 +38,59 @@ export class ConfigEditorComponent {
formatOnType: true
};
metadataConf: string;
searchConf: string;
excludedFileConf: string;
onInitMetadata(editor) {
onInit(editor) {
this.editor = editor;
setTimeout(() => {
this.editor.getAction('editor.action.formatDocument').run();
}, 1000);
}
onInitSearch(editor) {
this.editorSearch = editor;
setTimeout(() => {
this.editorSearch.getAction('editor.action.formatDocument').run();
}, 1000);
}
onInitExcludedFile(excludedFile) {
this.editorExcludedFile = excludedFile;
setTimeout(() => {
this.editorExcludedFile.getAction('editor.action.formatDocument').run();
}, 1000);
this.indentCode();
}
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']);
this.code = JSON.stringify(appConfig.config['content-metadata']);
}
onSaveMetadata() {
onSave() {
try {
this.appConfig.config['content-metadata'] = JSON.parse(this.editor.getValue());
this.appConfig.config[this.field] = JSON.parse(this.editor.getValue());
} catch (error) {
this.invalidJson = true;
this.notificationService.openSnackMessage(
'Wrong metadata configuration',
'Wrong Code configuration ' + error,
4000
);
} finally {
if (!this.invalidJson) {
this.notificationService.openSnackMessage(
'Saved'
);
}
}
}
onSaveSearch() {
try {
this.appConfig.config['search'] = JSON.parse(this.editorSearch.getValue());
} catch (error) {
this.notificationService.openSnackMessage(
'Wrong search configuration',
4000
);
}
onClear() {
this.code = '';
}
onSaveExcludedFile() {
try {
this.appConfig.config['files'] = JSON.parse(this.editorExcludedFile.getValue());
} catch (error) {
this.notificationService.openSnackMessage(
'Wrong exclude file configuration',
4000
);
}
fileConfClick() {
this.code = JSON.stringify(this.appConfig.config['files']);
this.field = 'files';
this.indentCode();
}
onClearMetadata() {
this.metadataConf = '';
searchConfClick() {
this.code = JSON.stringify(this.appConfig.config['search']);
this.field = 'search';
this.indentCode();
}
onClearSearch() {
this.searchConf = '';
metadataConfClick() {
this.code = JSON.stringify(this.appConfig.config['content-metadata']);
this.field = 'content-metadata';
this.indentCode();
}
onClearExcludedFile() {
this.searchConf = '';
indentCode() {
setTimeout(() => {
this.editor.getAction('editor.action.formatDocument').run();
}, 300);
}
}