mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[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:
@@ -1,29 +1,41 @@
|
||||
<div>
|
||||
<mat-nav-list class="adf-list-confgurations">
|
||||
<mat-list-item (click)="metadataConfClick()">
|
||||
<a matLine id="adf-metadata-conf">Metadata App config editor</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
|
||||
<h2>Metadata App config editor</h2>
|
||||
<mat-list-item (click)="searchConfClick()">
|
||||
<a matLine id="adf-search-conf" >Search App config editor</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
|
||||
<ngx-monaco-editor id="adf-metadata-editor" class="adf-metadata-editor" [options]="editorOptions" [(ngModel)]="metadataConf" (onInit)="onInitMetadata($event)" ></ngx-monaco-editor>
|
||||
<mat-list-item (click)="fileConfClick()">
|
||||
<a matLine id="adf-file-conf" >Excluded config file</a>
|
||||
<button mat-icon-button>
|
||||
<mat-icon>info</mat-icon>
|
||||
</button>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
||||
<button mat-raised-button id="adf-metadata-save" (click)="onSaveMetadata()" color="primary">Save metadata configuration</button>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<div>
|
||||
<ngx-monaco-editor id="adf-code-configuration-editor"
|
||||
class="adf-file-editor"
|
||||
[options]="editorOptions"
|
||||
[(ngModel)]="code"
|
||||
(onInit)="onInit($event)">
|
||||
</ngx-monaco-editor>
|
||||
<div class="adf-list-confgurations-buttons">
|
||||
<button mat-raised-button id="adf-configuration-save" (click)="onSave()" color="primary">
|
||||
Save
|
||||
</button>
|
||||
<button mat-raised-button id="adf-configuration-clear" (click)="onClear()" color="primary">
|
||||
Clear
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,3 +1,16 @@
|
||||
.adf-metadata-editor {
|
||||
height: 300px;
|
||||
.adf-file-editor {
|
||||
height: 500px;
|
||||
width: 65%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.adf-list-confgurations {
|
||||
float: left;
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.adf-list-confgurations-buttons {
|
||||
width: 200px;
|
||||
margin-left: 30%;
|
||||
float: left;
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user