From 6a546289b7db89ab81cf763e7e928f3013f935dc Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Tue, 2 Oct 2018 12:26:13 +0100 Subject: [PATCH] [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 --- demo-shell/resources/i18n/en.json | 2 + .../app-layout/app-layout.component.html | 2 +- .../app-layout/app-layout.component.ts | 1 + .../config-editor.component.html | 64 +- .../config-editor.component.scss | 17 +- .../config-editor/config-editor.component.ts | 89 +- .../file-view/file-view.component.html | 17 + .../file-view/file-view.component.ts | 5 + .../app/components/files/files.component.html | 39 +- .../app/components/files/files.component.scss | 4 +- .../app/components/files/files.component.ts | 8 +- .../header-data/header-data.component.html | 14 + .../header-data/header-data.component.ts | 6 + .../header-data/header-data.service.ts | 5 + .../process-service.component.html | 8 + .../process-service.component.ts | 11 + .../comments/comment_component.e2e.ts | 2 +- .../document_list_component.e2e.ts | 2 +- e2e/content-services/tag_component.e2e.ts | 49 +- .../trashcan_pagination.e2e.ts | 3 +- .../upload/excluded_file.e2e.ts | 80 +- .../upload/uploader_component.e2e.ts | 145 ++-- .../upload/user_permission.e2e.ts | 18 +- .../{ => viewer}/viewer_component.e2e.ts | 24 +- .../viewer_content_services_component.e2e.ts | 16 +- .../viewer_integration_with_router.e2e.ts | 18 +- .../card-view/aspect-oriented-config.e2e.ts | 28 +- .../card-view/metadata-permissions.e2e.ts | 2 +- e2e/core/card-view/metadata-properties.e2e.ts | 2 +- .../card-view/metadata-smoke-tests.e2e.ts | 2 +- e2e/core/viewer_properties.e2e.ts | 2 +- e2e/lite-server-proxy.js | 2 - e2e/pages/adf/commentsPage.ts | 7 +- e2e/pages/adf/configEditorPage.ts | 22 +- e2e/pages/adf/contentServicesPage.js | 10 +- e2e/pages/adf/dialog/contentList.js | 27 +- e2e/pages/adf/dialog/uploadToggles.js | 111 --- e2e/pages/adf/dialog/uploadToggles.ts | 107 +++ .../formControllersPage.ts} | 21 +- e2e/pages/adf/material/tabsPage.ts | 35 + e2e/pages/adf/metadataViewPage.js | 13 - .../process_services/appNavigationBarPage.js | 5 + .../dialog/appSettingsToggles.js | 16 +- e2e/pages/adf/tagPage.js | 10 +- e2e/pages/adf/trashcanPage.js | 39 - e2e/pages/adf/trashcanPage.ts | 38 + e2e/pages/adf/versionManagerPage.ts | 93 +-- e2e/pages/adf/viewerPage.js | 777 ------------------ e2e/pages/adf/viewerPage.ts | 688 ++++++++++++++++ .../attach-file-widget.e2e.ts | 2 +- .../empty_process_list_component.e2e.ts | 2 +- .../process_attachmentList_actionMenu.e2e.ts | 2 +- .../start_task_custom_app.e2e.ts | 2 +- .../task_attachmentList_actionMenu.e2e.ts | 2 +- .../adf/allFileTypes/a_file_unsupported.docx | Bin 788835 -> 82991 bytes lib/core/services/upload.service.ts | 8 +- package-lock.json | 43 +- package.json | 2 +- 58 files changed, 1426 insertions(+), 1343 deletions(-) rename e2e/content-services/{ => viewer}/viewer_component.e2e.ts (94%) rename e2e/content-services/{ => viewer}/viewer_content_services_component.e2e.ts (97%) rename e2e/content-services/{ => viewer}/viewer_integration_with_router.e2e.ts (82%) delete mode 100644 e2e/pages/adf/dialog/uploadToggles.js create mode 100644 e2e/pages/adf/dialog/uploadToggles.ts rename e2e/pages/adf/{core/toggleState.js => material/formControllersPage.ts} (83%) create mode 100644 e2e/pages/adf/material/tabsPage.ts delete mode 100644 e2e/pages/adf/trashcanPage.js create mode 100644 e2e/pages/adf/trashcanPage.ts delete mode 100644 e2e/pages/adf/viewerPage.js create mode 100644 e2e/pages/adf/viewerPage.ts diff --git a/demo-shell/resources/i18n/en.json b/demo-shell/resources/i18n/en.json index 248c851d2c..3069dc9193 100644 --- a/demo-shell/resources/i18n/en.json +++ b/demo-shell/resources/i18n/en.json @@ -102,6 +102,7 @@ "DOCUMENT_LIST": { "MULTISELECT_CHECKBOXES": "Multiselect (with checkboxes)", "THUMBNAILS": "Enable Thumbnails", + "ALLOW_DROP_FILES": "Enable file drop support for rows", "MULTIPLE_FILE_UPLOAD": "Multiple File Upload", "FOLDER_UPLOAD": "Folder upload", "CUSTOM_FILTER": "Custom extensions filter", @@ -119,6 +120,7 @@ "COLUMNS": { "DISPLAY_NAME": "Display name", "IS_LOCKED": "Lock", + "NODE_ID": "Node id", "TAG": "Tag", "CREATED_BY": "Created by", "CREATED_ON": "Created on", diff --git a/demo-shell/src/app/components/app-layout/app-layout.component.html b/demo-shell/src/app/components/app-layout/app-layout.component.html index 24781cda59..b0b28fb9b8 100644 --- a/demo-shell/src/app/components/app-layout/app-layout.component.html +++ b/demo-shell/src/app/components/app-layout/app-layout.component.html @@ -19,7 +19,7 @@ -
+
this.redirectUrl = redirectUrl); this.headerService.tooltip.subscribe(tooltip => this.tooltip = tooltip); this.headerService.position.subscribe(position => this.position = position); + this.headerService.hideSidenav.subscribe(hideSidenav => this.hideSidenav = hideSidenav); } constructor( 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 fd2ede0d81..3f61f4d970 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 @@ -1,29 +1,41 @@ +
+ + + Metadata App config editor + + -

Metadata App config editor

+ + Search App config editor + + - + + Excluded config file + + +
- - - -
-
-
- -

Search App config editor

- - - - - - -
- -

Excluded File config editor

- - - - - - -
+
+ + +
+ + +
+
+
diff --git a/demo-shell/src/app/components/config-editor/config-editor.component.scss b/demo-shell/src/app/components/config-editor/config-editor.component.scss index 096ca654cb..904c629480 100644 --- a/demo-shell/src/app/components/config-editor/config-editor.component.scss +++ b/demo-shell/src/app/components/config-editor/config-editor.component.scss @@ -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; } 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 0de4c59baf..b1cbd5e75f 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 @@ -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); } + } diff --git a/demo-shell/src/app/components/file-view/file-view.component.html b/demo-shell/src/app/components/file-view/file-view.component.html index 85cee40a1a..8bb715b546 100644 --- a/demo-shell/src/app/components/file-view/file-view.component.html +++ b/demo-shell/src/app/components/file-view/file-view.component.html @@ -70,6 +70,7 @@ Custom preset

+

@@ -227,6 +228,16 @@

+

+ + Custom Toolbar + +

+