From a7a48e8b2b839b0d9a4ff8631c5f263b6228ca30 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 25 Mar 2019 12:19:33 +0000 Subject: [PATCH] enable prefer-const rule for tslint, fix issues (#4409) * enable prefer-const rule for tslint, fix issues * Update content-node-selector.component.spec.ts * Update content-node-selector.component.spec.ts * fix const * fix lint issues * update tests * update tests * update tests * fix code * fix page class --- .../nested-menu-position.directive.ts | 2 +- .../src/app/components/form/form.component.ts | 4 +- .../process-list-demo.component.ts | 2 +- .../task-list-demo.component.ts | 4 +- e2e/actions/ACS/node.actions.ts | 2 +- e2e/actions/ACS/upload.actions.ts | 16 +- e2e/actions/APS-cloud/roles.ts | 2 +- e2e/actions/APS-cloud/tasks.ts | 2 +- e2e/actions/APS/apps.actions.ts | 34 +- e2e/actions/APS/appsRuntime.actions.ts | 2 +- e2e/actions/drop.actions.ts | 32 +- e2e/actions/users.actions.ts | 16 +- .../comments/comment-component.e2e.ts | 18 +- .../directives/create-folder-directive.e2e.ts | 24 +- .../create-library-directive.e2e.ts | 60 +-- .../document-list-actions.e2e.ts | 12 +- .../document-list-component.e2e.ts | 84 ++-- .../document-list-pagination.e2e.ts | 32 +- e2e/content-services/lock-file.e2e.ts | 26 +- .../notifications-component.e2e.ts | 6 +- .../permissions/permissions-component.e2e.ts | 24 +- .../permissions/site-permissions.e2e.ts | 20 +- .../share-file/share-file.e2e.ts | 8 +- .../share-file/unshare-file.e2e.ts | 10 +- e2e/content-services/tag-component.e2e.ts | 30 +- .../trashcan-pagination.e2e.ts | 26 +- .../tree-view-component.e2e.ts | 6 +- .../upload/cancel-upload.e2e.ts | 22 +- .../upload/excluded-file.e2e.ts | 26 +- e2e/content-services/upload/upload-dialog.ts | 30 +- .../upload/uploader-component.e2e.ts | 44 +- .../upload/user-permission.e2e.ts | 28 +- .../version/version-actions.e2e.ts | 10 +- .../version/version-permissions.e2e.ts | 42 +- .../version/version-properties.e2e.ts | 10 +- .../version/version-smoke-tests.e2e.ts | 14 +- .../card-view/aspect-oriented-config.e2e.ts | 16 +- e2e/core/card-view/card-view-component.e2e.ts | 26 +- .../card-view/metadata-permissions.e2e.ts | 10 +- e2e/core/card-view/metadata-properties.e2e.ts | 18 +- .../card-view/metadata-smoke-tests.e2e.ts | 10 +- .../data-table-component-selection.e2e.ts | 10 +- e2e/core/error-component.e2e.ts | 6 +- e2e/core/header-component.e2e.ts | 12 +- e2e/core/icons-component.e2e.ts | 8 +- e2e/core/infinite-scrolling.e2e.ts | 17 +- e2e/core/login/login-component.e2e.ts | 26 +- e2e/core/login/login-sso/login-sso.e2e.ts | 4 +- e2e/core/login/redirection.e2e.ts | 18 +- e2e/core/login/remember-me.e2e.ts | 4 +- e2e/core/pagination-empty-current-page.e2e.ts | 36 +- e2e/core/settings-component.e2e.ts | 2 +- e2e/core/user-info-component.e2e.ts | 14 +- e2e/core/viewer/viewer-component.e2e.ts | 36 +- .../viewer-content-services-component.e2e.ts | 40 +- .../viewer-custom-toolbar-info-drawer.e2e.ts | 12 +- e2e/core/viewer/viewer-properties.e2e.ts | 20 +- e2e/insights/analytics-component.e2e.ts | 16 +- e2e/models/ACS/fileModel.ts | 4 +- e2e/pages/adf/cardViewComponentPage.ts | 28 +- e2e/pages/adf/configEditorPage.ts | 22 +- .../adf/content-services/documentListPage.ts | 10 +- .../search/components/dateRangeFilterPage.ts | 2 +- .../search/components/search-checkList.ts | 26 +- .../search/components/search-radio.ts | 6 +- .../components/search-sortingPicker.page.ts | 10 +- .../search/search-categories.ts | 2 +- .../adf/content-services/treeViewPage.ts | 12 +- e2e/pages/adf/contentServicesPage.ts | 64 +-- e2e/pages/adf/core/headerPage.ts | 8 +- e2e/pages/adf/dataTableComponentPage.ts | 42 +- e2e/pages/adf/demo-shell/customSourcesPage.ts | 6 +- e2e/pages/adf/demo-shell/dataTablePage.ts | 14 +- .../process-services/processListDemoPage.ts | 6 +- .../process-services/taskListDemoPage.ts | 8 +- .../process-services/tasksCloudDemoPage.ts | 2 +- e2e/pages/adf/dialog/createLibraryDialog.ts | 2 +- .../adf/dialog/editProcessFilterDialog.ts | 4 +- e2e/pages/adf/dialog/editTaskFilterDialog.ts | 4 +- e2e/pages/adf/dialog/shareDialog.ts | 2 +- e2e/pages/adf/dialog/uploadDialog.ts | 12 +- e2e/pages/adf/dialog/uploadToggles.ts | 10 +- e2e/pages/adf/filePreviewPage.ts | 48 +- e2e/pages/adf/material/datePickerPage.ts | 10 +- e2e/pages/adf/metadataViewPage.ts | 32 +- e2e/pages/adf/navigationBarPage.ts | 10 +- e2e/pages/adf/notificationPage.ts | 8 +- e2e/pages/adf/paginationPage.ts | 12 +- e2e/pages/adf/permissionsPage.ts | 14 +- .../editProcessFilterCloudComponent.ts | 34 +- .../editTaskFilterCloudComponent.ts | 18 +- .../adf/process-cloud/groupCloudComponent.ts | 6 +- .../adf/process-cloud/peopleCloudComponent.ts | 6 +- .../processFiltersCloudComponent.ts | 2 +- .../taskFiltersCloudComponent.ts | 2 +- .../process-cloud/taskListCloudComponent.ts | 4 +- .../adf/process-services/analyticsPage.ts | 2 +- .../process-services/attachmentListPage.ts | 6 +- .../dialog/startTaskDialog.ts | 4 +- e2e/pages/adf/process-services/filtersPage.ts | 2 +- e2e/pages/adf/process-services/formFields.ts | 26 +- .../process-services/processDetailsPage.ts | 2 +- .../process-services/processFiltersPage.ts | 14 +- .../process-services/processServicesPage.ts | 16 +- .../adf/process-services/startProcessPage.ts | 8 +- .../adf/process-services/taskDetailsPage.ts | 20 +- .../adf/process-services/taskFiltersPage.ts | 2 +- e2e/pages/adf/process-services/tasksPage.ts | 10 +- .../process-services/widgets/amountWidget.ts | 8 +- .../widgets/attachFileWidget.ts | 10 +- .../widgets/checkboxWidget.ts | 2 +- .../widgets/dateTimeWidget.ts | 14 +- .../process-services/widgets/dateWidget.ts | 10 +- .../widgets/dropdownWidget.ts | 2 +- .../widgets/dynamicTableWidget.ts | 12 +- .../widgets/hyperlinkWidget.ts | 2 +- .../process-services/widgets/numberWidget.ts | 6 +- .../process-services/widgets/peopleWidget.ts | 6 +- .../widgets/radioButtonsWidget.ts | 12 +- .../editTaskFilterCloudComponent.ts | 8 +- e2e/pages/adf/searchResultsPage.ts | 14 +- e2e/pages/adf/tagPage.ts | 30 +- e2e/pages/adf/versionManagerPage.ts | 22 +- e2e/pages/adf/viewerPage.ts | 20 +- .../edit-process-filters-component.e2e.ts | 6 +- .../edit-task-filters-component.e2e.ts | 4 +- .../process-custom-filters.e2e.ts | 20 +- .../process-filters-cloud.e2e.ts | 12 +- .../processList-cloud-component.e2e.ts | 8 +- .../start-task-custom-app-cloud.e2e.ts | 2 +- .../task-details-cloud.e2e.ts | 12 +- .../task-filters-cloud.e2e.ts | 8 +- .../task-list-properties.e2e.ts | 18 +- .../task-list-selection.e2e.ts | 9 +- .../tasks-custom-filters.e2e.ts | 19 +- e2e/process-services/apps-section.e2e.ts | 24 +- .../attach-file-widget.e2e.ts | 20 +- .../attach-form-component.e2e.ts | 22 +- .../checklist-component.e2e.ts | 22 +- .../comment-component-processes.e2e.ts | 30 +- .../comment-component-tasks.e2e.ts | 34 +- .../custom-process-filters-sorting.e2e.ts | 54 +- .../custom-process-filters.e2e.ts | 14 +- .../custom-tasks-filters.e2e.ts | 54 +- .../dynamic-table-date-picker.e2e.ts | 28 +- .../empty-process-list-component.e2e.ts | 22 +- e2e/process-services/form-component.e2e.ts | 6 +- .../form-people-widget.e2e.ts | 32 +- .../form-widgets-component.e2e.ts | 32 +- ...ination-processlist-addingProcesses.e2e.ts | 18 +- .../pagination-tasklist-addingTasks.e2e.ts | 20 +- e2e/process-services/people-component.e2e.ts | 20 +- .../process-attachmentList-actionMenu.e2e.ts | 28 +- .../process-filters-component.e2e.ts | 34 +- .../processList-component.e2e.ts | 18 +- .../processlist-pagination.e2e.ts | 28 +- .../sort-tasklist-pagination.e2e.ts | 21 +- e2e/process-services/standalone-task.e2e.ts | 20 +- .../start-process-component.e2e.ts | 32 +- .../start-task-custom-app.e2e.ts | 30 +- .../start-task-task-app.e2e.ts | 32 +- .../task-attachmentList-actionMenu.e2e.ts | 34 +- e2e/process-services/task-audit.e2e.ts | 20 +- e2e/process-services/task-details-form.e2e.ts | 24 +- .../task-details-no-form.e2e.ts | 16 +- e2e/process-services/task-details.e2e.ts | 60 +-- .../task-filters-component.e2e.ts | 80 +-- .../task-filters-sorting.e2e.ts | 56 +-- .../task-list-pagination.e2e.ts | 22 +- .../widgets/amount-widget.e2e.ts | 16 +- .../widgets/attach-folder-widget.e2e.ts | 16 +- .../widgets/checkbox-widget.e2e.ts | 16 +- .../widgets/date-time-widget.e2e.ts | 16 +- .../widgets/date-widget.e2e.ts | 16 +- .../widgets/document-template-widget.e2e.ts | 16 +- .../widgets/dropdown-widget.e2e.ts | 16 +- .../widgets/dynamic-table-widget.e2e.ts | 24 +- .../widgets/header-widget.e2e.ts | 16 +- .../widgets/hyperlink-widget.e2e.ts | 16 +- .../widgets/multi-line-widget.e2e.ts | 20 +- .../widgets/number-widget.e2e.ts | 16 +- .../widgets/people-widget.e2e.ts | 20 +- .../widgets/radio-buttons-widget.e2e.ts | 16 +- .../widgets/text-widget.e2e.ts | 20 +- e2e/search/components/search-checkList.e2e.ts | 14 +- .../components/search-date-range.e2e.ts | 34 +- .../components/search-number-range.e2e.ts | 66 +-- e2e/search/components/search-radio.e2e.ts | 14 +- e2e/search/components/search-slider.e2e.ts | 26 +- .../components/search-sorting-picker.e2e.ts | 24 +- e2e/search/components/search-text.e2e.ts | 12 +- e2e/search/search-component.e2e.ts | 38 +- e2e/search/search-filters.e2e.ts | 50 +- e2e/search/search-multiselect.e2e.ts | 34 +- e2e/search/search-page-component.e2e.ts | 29 +- e2e/util/util.ts | 43 +- .../breadcrumb/breadcrumb.component.spec.ts | 6 +- .../breadcrumb/breadcrumb.component.ts | 2 +- .../dropdown-breadcrumb.component.spec.ts | 10 +- .../dropdown-breadcrumb.component.ts | 2 +- .../content-metadata-card.component.spec.ts | 2 +- .../content-metadata.component.spec.ts | 2 +- .../config/layout-oriented-config.service.ts | 4 +- .../property-groups-translator.service.ts | 2 +- .../content-node-dialog.service.spec.ts | 2 +- .../content-node-dialog.service.ts | 2 +- ...tent-node-selector-panel.component.spec.ts | 32 +- .../content-node-selector.component.spec.ts | 12 +- .../content-node-selector.service.ts | 2 +- .../content-node-share.dialog.spec.ts | 2 +- .../dialogs/folder.dialog.spec.ts | 2 +- lib/content-services/dialogs/folder.dialog.ts | 4 +- .../dialogs/node-lock.dialog.spec.ts | 2 +- .../dialogs/node-lock.dialog.ts | 2 +- .../content-action-list.component.spec.ts | 8 +- .../content-action.component.spec.ts | 60 +-- .../content-column-list.component.spec.ts | 10 +- .../content-column-list.component.ts | 2 +- .../content-column.component.spec.ts | 8 +- .../document-list.component.spec.ts | 190 +++---- .../components/document-list.component.ts | 24 +- .../data/share-datatable-adapter.spec.ts | 220 ++++---- .../data/share-datatable-adapter.ts | 24 +- .../services/custom-resources.service.ts | 10 +- .../services/document-actions.service.spec.ts | 62 ++- .../services/document-actions.service.ts | 8 +- .../services/document-list.service.spec.ts | 14 +- .../services/document-list.service.ts | 12 +- .../services/folder-actions.service.spec.ts | 64 +-- .../services/folder-actions.service.ts | 8 +- .../services/node-actions.service.spec.ts | 2 +- .../add-permission-dialog.component.spec.ts | 2 +- .../add-permission-panel.component.spec.ts | 2 +- .../add-permission.component.spec.ts | 2 +- .../inherited-button.directive.spec.ts | 2 +- .../permission-list.component.spec.ts | 6 +- .../permission-list.component.ts | 10 +- .../node-permission-dialog.service.spec.ts | 2 +- .../node-permission-dialog.service.ts | 2 +- .../services/node-permission.service.spec.ts | 4 +- .../services/node-permission.service.ts | 14 +- .../search-control.component.spec.ts | 74 +-- .../components/search-control.component.ts | 6 +- .../search-date-range.component.spec.ts | 4 +- .../models/search-filter-list.model.ts | 2 +- .../search-filter.component.spec.ts | 2 +- .../search-filter/search-filter.component.ts | 6 +- .../components/search-trigger.directive.ts | 4 +- .../components/search.component.spec.ts | 10 +- .../search/search-query-builder.service.ts | 2 +- .../sites-dropdown.component.spec.ts | 12 +- .../site-dropdown/sites-dropdown.component.ts | 6 +- .../social/like.component.spec.ts | 4 +- .../social/rating.component.spec.ts | 2 +- .../social/rating.component.ts | 2 +- .../social/services/rating.service.spec.ts | 8 +- .../social/services/rating.service.ts | 2 +- .../tag/services/tag.service.ts | 2 +- .../tag/tag-actions.component.spec.ts | 16 +- .../tag/tag-list.component.spec.ts | 4 +- .../tag/tag-node-list.component.spec.ts | 10 +- .../components/tree-view.component.spec.ts | 22 +- .../services/tree-view.service.spec.ts | 4 +- .../components/base-upload/upload-base.ts | 2 +- .../file-uploading-dialog.component.ts | 2 +- .../file-uploading-list-row.component.spec.ts | 2 +- .../upload-button.component.spec.ts | 20 +- .../components/upload-button.component.ts | 8 +- .../upload-drag-area.component.spec.ts | 38 +- .../components/upload-drag-area.component.ts | 4 +- .../file-draggable.directive.spec.ts | 4 +- .../version-list.component.spec.ts | 28 +- .../version-manager.component.spec.ts | 6 +- .../webscript/webscript.component.spec.ts | 6 +- .../webscript/webscript.component.ts | 2 +- .../buttons-menu.component.spec.ts | 2 +- .../card-view-boolitem.component.spec.ts | 28 +- .../card-view-dateitem.component.spec.ts | 28 +- .../card-view-dateitem.component.ts | 2 +- ...d-view-keyvaluepairsitem.component.spec.ts | 10 +- .../card-view-mapitem.component.spec.ts | 16 +- .../card-view-textitem.component.spec.ts | 38 +- .../card-view/card-view.component.spec.ts | 22 +- .../comments/comment-list.component.spec.ts | 30 +- lib/core/comments/comments.component.spec.ts | 56 +-- lib/core/comments/comments.component.ts | 4 +- .../context-menu-holder.component.spec.ts | 4 +- .../datatable/datatable.component.spec.ts | 84 ++-- .../datatable/datatable.component.ts | 28 +- .../data/object-datatable-adapter.spec.ts | 86 ++-- .../data/object-datatable-adapter.ts | 12 +- lib/core/dialogs/download-zip.dialog.spec.ts | 6 +- ...heck-allowable-operation.directive.spec.ts | 4 +- .../check-allowable-operation.directive.ts | 2 +- .../node-favorite.directive.spec.ts | 12 +- lib/core/directives/node-restore.directive.ts | 2 +- lib/core/directives/upload.directive.spec.ts | 14 +- lib/core/directives/upload.directive.ts | 8 +- .../form-field/form-field.component.spec.ts | 12 +- .../form-field/form-field.component.ts | 22 +- .../form/components/form.component.spec.ts | 130 ++--- .../form.component.visibility.spec.ts | 36 +- .../form/components/start-form.component.ts | 4 +- .../container/container-column.model.spec.ts | 4 +- .../container/container.widget.model.spec.ts | 8 +- .../container/container.widget.spec.ts | 16 +- .../widgets/container/container.widget.ts | 2 +- .../widgets/content/content.widget.spec.ts | 36 +- .../widgets/core/container.model.spec.ts | 4 +- .../widgets/core/error-message.model.ts | 2 +- .../widgets/core/form-field-validator.spec.ts | 132 ++--- .../widgets/core/form-field-validator.ts | 22 +- .../widgets/core/form-field.model.spec.ts | 90 ++-- .../widgets/core/form-field.model.ts | 28 +- .../widgets/core/form-outcome.model.spec.ts | 12 +- .../widgets/core/form-widget.model.spec.ts | 8 +- .../widgets/core/form.model.spec.ts | 62 +-- .../components/widgets/core/form.model.ts | 34 +- .../components/widgets/core/tab.model.spec.ts | 20 +- .../date-time/date-time.widget.spec.ts | 16 +- .../widgets/date-time/date-time.widget.ts | 2 +- .../widgets/date/date.widget.spec.ts | 18 +- .../components/widgets/date/date.widget.ts | 2 +- .../widgets/dropdown/dropdown.widget.spec.ts | 20 +- .../widgets/dropdown/dropdown.widget.ts | 4 +- .../date-cell-validator-model.ts | 4 +- .../dynamic-table.widget.model.ts | 14 +- .../dynamic-table.widget.spec.ts | 64 +-- .../dynamic-table/dynamic-table.widget.ts | 6 +- .../editors/boolean/boolean.editor.spec.ts | 6 +- .../editors/boolean/boolean.editor.ts | 2 +- .../editors/date/date.editor.spec.ts | 4 +- .../dynamic-table/editors/date/date.editor.ts | 4 +- .../editors/datetime/datetime.editor.spec.ts | 4 +- .../editors/datetime/datetime.editor.ts | 2 +- .../editors/dropdown/dropdown.editor.spec.ts | 10 +- .../editors/dropdown/dropdown.editor.ts | 2 +- .../editors/text/text.editor.spec.ts | 6 +- .../dynamic-table/editors/text/text.editor.ts | 2 +- .../number-cell-validator.model.ts | 2 +- .../required-cell-validator.model.ts | 2 +- .../functional-group.widget.spec.ts | 24 +- .../functional-group.widget.ts | 8 +- .../widgets/people/people.widget.spec.ts | 22 +- .../widgets/people/people.widget.ts | 10 +- .../radio-buttons.widget.spec.ts | 16 +- .../widgets/tabs/tabs.widget.spec.ts | 6 +- .../widgets/text/text-mask.component.ts | 38 +- .../widgets/text/text.widget.spec.ts | 14 +- .../typeahead/typeahead.widget.spec.ts | 34 +- .../widgets/typeahead/typeahead.widget.ts | 18 +- .../upload-folder/upload-folder.widget.ts | 4 +- .../widgets/upload/upload.widget.spec.ts | 44 +- .../widgets/upload/upload.widget.ts | 4 +- .../widgets/widget.component.spec.ts | 8 +- lib/core/form/models/form-definition.model.ts | 4 +- .../services/activiti-alfresco.service.ts | 8 +- .../form/services/ecm-model.service.spec.ts | 18 +- lib/core/form/services/ecm-model.service.ts | 8 +- .../services/form-rendering.service.spec.ts | 24 +- lib/core/form/services/form.service.spec.ts | 24 +- lib/core/form/services/form.service.ts | 20 +- lib/core/form/services/node.service.spec.ts | 16 +- lib/core/form/services/node.service.ts | 14 +- .../services/process-content.service.spec.ts | 20 +- .../widget-visibility.service.spec.ts | 112 ++--- .../services/widget-visibility.service.ts | 20 +- .../info-drawer/info-drawer.component.spec.ts | 16 +- .../login/components/login.component.spec.ts | 4 +- lib/core/login/components/login.component.ts | 8 +- lib/core/mock/event.mock.ts | 4 +- .../infinite-pagination.component.spec.ts | 22 +- lib/core/pipes/format-space.pipe.spec.ts | 14 +- lib/core/pipes/node-name-tooltip.pipe.spec.ts | 16 +- lib/core/pipes/time-ago.pipe.spec.ts | 6 +- lib/core/pipes/user-initial.pipe.spec.ts | 10 +- lib/core/pipes/user-initial.pipe.ts | 2 +- lib/core/services/alfresco-api.service.ts | 2 +- .../services/auth-guard-sso-role.service.ts | 2 +- .../services/authentication.service.spec.ts | 28 +- lib/core/services/authentication.service.ts | 4 +- .../services/comment-process.service.spec.ts | 2 +- lib/core/services/comment-process.service.ts | 8 +- lib/core/services/content.service.spec.ts | 32 +- lib/core/services/content.service.ts | 8 +- .../services/discovery-api.service.spec.ts | 6 +- .../dynamic-component-mapper.service.ts | 4 +- .../services/external-alfresco-api.service.ts | 4 +- lib/core/services/jwt-helper.service.ts | 4 +- lib/core/services/log.service.ts | 4 +- .../services/login-dialog.service.spec.ts | 3 +- .../services/notification.service.spec.ts | 26 +- .../services/people-process.service.spec.ts | 2 +- lib/core/services/people-process.service.ts | 6 +- lib/core/services/renditions.service.ts | 4 +- .../services/search-configuration.service.ts | 2 +- lib/core/services/search.service.spec.ts | 4 +- lib/core/services/sites.service.spec.ts | 2 +- lib/core/services/sites.service.ts | 2 +- lib/core/services/storage.service.ts | 2 +- lib/core/services/thumbnail.service.ts | 4 +- lib/core/services/translate-loader.service.ts | 6 +- lib/core/services/translate-loader.spec.ts | 2 +- lib/core/services/translation.service.ts | 2 +- lib/core/services/upload.service.spec.ts | 56 +-- lib/core/services/upload.service.ts | 10 +- lib/core/services/user-preferences.service.ts | 4 +- lib/core/settings/host-settings.component.ts | 4 +- .../components/user-info.component.spec.ts | 78 +-- .../services/bpm-user.service.spec.ts | 2 +- .../services/ecm-user.service.spec.ts | 6 +- .../userinfo/services/ecm-user.service.ts | 2 +- .../services/identity-user.service.spec.ts | 2 +- lib/core/utils/file-utils.ts | 8 +- lib/core/utils/momentDateAdapter.ts | 10 +- lib/core/utils/object-utils.spec.ts | 8 +- lib/core/utils/object-utils.ts | 6 +- .../components/imgViewer.component.spec.ts | 8 +- .../viewer/components/imgViewer.component.ts | 2 +- .../components/mediaPlayer.component.spec.ts | 6 +- .../components/mediaPlayer.component.ts | 2 +- .../components/pdfViewer.component.spec.ts | 22 +- .../viewer/components/pdfViewer.component.ts | 20 +- .../components/txtViewer.component.spec.ts | 8 +- .../viewer/components/txtViewer.component.ts | 8 +- .../components/viewer.component.spec.ts | 30 +- .../viewer/components/viewer.component.ts | 12 +- .../services/rendering-queue.services.ts | 14 +- .../src/lib/services/extension.service.ts | 2 +- .../analytics-generator.component.ts | 2 +- ...nalytics-report-heat-map.component.spec.ts | 20 +- .../analytics-report-list.component.spec.ts | 8 +- .../analytics-report-list.component.ts | 2 +- ...lytics-report-parameters.component.spec.ts | 104 ++-- .../analytics-report-parameters.component.ts | 12 +- .../widgets/date-range/date-range.widget.ts | 16 +- .../widgets/dropdown/dropdown.widget.ts | 2 +- .../widgets/duration/duration.widget.ts | 4 +- .../components/widgets/widget.component.ts | 2 +- .../services/analytics.service.ts | 20 +- .../diagram.component.activities.spec.ts | 474 +++++++++--------- .../diagram.component.boundary.spec.ts | 262 +++++----- .../diagram.component.catching.events.spec.ts | 210 ++++---- .../diagram.component.events.spec.ts | 210 ++++---- .../diagram.component.flows.spec.ts | 14 +- .../diagram.component.gateways.spec.ts | 154 +++--- .../diagram.component.structural.spec.ts | 50 +- .../components/diagram.component.swim.spec.ts | 30 +- .../diagram.component.throw.spec.ts | 254 +++++----- .../diagram/components/diagram.component.ts | 4 +- ...raphael-icon-alfresco-publish.component.ts | 10 +- .../raphael-icon-box-publish.component.ts | 2 +- .../raphael-icon-business-rule.component.ts | 2 +- .../icons/raphael-icon-camel.component.ts | 2 +- .../icons/raphael-icon-error.component.ts | 2 +- ...ael-icon-google-drive-publish.component.ts | 2 +- .../icons/raphael-icon-manual.component.ts | 2 +- .../icons/raphael-icon-message.component.ts | 2 +- .../icons/raphael-icon-mule.component.ts | 2 +- .../icons/raphael-icon-receive.component.ts | 2 +- .../icons/raphael-icon-rest-call.component.ts | 2 +- .../icons/raphael-icon-script.component.ts | 2 +- .../icons/raphael-icon-send.component.ts | 2 +- .../icons/raphael-icon-service.component.ts | 2 +- .../icons/raphael-icon-signal.component.ts | 2 +- .../icons/raphael-icon-timer.component.ts | 2 +- .../icons/raphael-icon-user.component.ts | 2 +- .../raphael/raphael-circle.component.ts | 6 +- .../raphael/raphael-cross.component.ts | 6 +- .../raphael/raphael-flow-arrow.component.ts | 16 +- .../raphael-multiline-text.component.ts | 17 +- .../raphael/raphael-pentagon.component.ts | 2 +- .../raphael/raphael-plus.component.ts | 4 +- .../raphael/raphael-rect.component.ts | 4 +- .../raphael/raphael-rhombus.component.ts | 4 +- .../raphael/raphael-text.component.ts | 2 +- .../components/raphael/raphael.service.ts | 2 +- .../tooltip/diagram-tooltip.component.spec.ts | 22 +- .../tooltip/diagram-tooltip.component.ts | 6 +- .../diagram/models/chart/barChart.model.ts | 4 +- .../models/report/reportDefinition.model.ts | 2 +- .../diagram/services/diagram-color.service.ts | 4 +- .../diagram/services/diagrams.service.spec.ts | 2 +- .../components/group-cloud.component.spec.ts | 20 +- .../lib/group/pipe/group-initial.pipe.spec.ts | 4 +- .../edit-process-filter-cloud.component.ts | 2 +- ...cess-filter-dialog-cloud.component.spec.ts | 10 +- .../process-filters-cloud.component.spec.ts | 50 +- .../services/process-filter-cloud.service.ts | 4 +- .../services/process-header-cloud.service.ts | 2 +- .../process-list-cloud.component.spec.ts | 6 +- .../process-list-cloud.component.ts | 4 +- .../process-list-cloud.service.spec.ts | 10 +- .../services/process-list-cloud.service.ts | 12 +- .../start-process-cloud.component.spec.ts | 52 +- .../start-process-cloud.component.ts | 2 +- .../services/start-process-cloud.service.ts | 4 +- .../lib/task/services/task-cloud.service.ts | 8 +- .../people-cloud.component.spec.ts | 24 +- .../people-cloud/people-cloud.component.ts | 2 +- .../start-task-cloud.component.spec.ts | 36 +- .../components/start-task-cloud.component.ts | 2 +- .../services/start-task-cloud.service.ts | 2 +- .../edit-task-filter-cloud.component.spec.ts | 96 ++-- .../edit-task-filter-cloud.component.ts | 2 +- ...task-filter-dialog-cloud.component.spec.ts | 10 +- .../task-filters-cloud.component.spec.ts | 46 +- .../services/task-filter-cloud.service.ts | 14 +- .../task-header-cloud.component.spec.ts | 16 +- .../task-list-cloud.component.spec.ts | 6 +- .../components/task-list-cloud.component.ts | 4 +- .../services/task-list-cloud.service.spec.ts | 10 +- .../services/task-list-cloud.service.ts | 12 +- .../app-list/apps-list.component.spec.ts | 12 +- .../app-list/apps-list.component.ts | 2 +- .../select-apps-dialog-component.spec.ts | 2 +- ...reate-process-attachment.component.spec.ts | 14 +- .../create-process-attachment.component.ts | 8 +- .../create-task-attachment.component.spec.ts | 12 +- .../create-task-attachment.component.ts | 8 +- .../process-attachment-list.component.spec.ts | 38 +- .../process-attachment-list.component.ts | 12 +- .../task-attachment-list.component.spec.ts | 34 +- .../task-attachment-list.component.ts | 14 +- ...ttach-file-widget-dialog.component.spec.ts | 12 +- .../attach-file-widget-dialog.service.spec.ts | 3 +- .../attach-file-widget-dialog.service.ts | 2 +- .../attach-file-widget.component.ts | 10 +- .../attach-file-widget.components.spec.ts | 18 +- .../attach-folder-widget.component.ts | 2 +- .../mock/process/process.model.mock.ts | 2 +- .../people-list/people-list.component.spec.ts | 10 +- .../people-list/people-list.component.ts | 6 +- .../people-search-field.component.spec.ts | 4 +- .../people-search.component.spec.ts | 10 +- .../people/people.component.spec.ts | 12 +- .../process-comments.component.spec.ts | 16 +- .../process-comments.component.ts | 6 +- .../process-audit.directive.spec.ts | 12 +- .../process-filters.component.spec.ts | 38 +- ...process-instance-details.component.spec.ts | 14 +- .../process-instance-details.component.ts | 4 +- .../process-instance-header.component.spec.ts | 26 +- .../process-instance-tasks.component.spec.ts | 18 +- .../process-instance-tasks.component.ts | 6 +- .../components/process-list.component.spec.ts | 30 +- .../components/process-list.component.ts | 22 +- .../start-process.component.spec.ts | 54 +- .../components/start-process.component.ts | 12 +- .../services/process-filter.service.spec.ts | 2 +- .../services/process-filter.service.ts | 18 +- .../services/process.service.spec.ts | 14 +- .../process-list/services/process.service.ts | 6 +- .../components/attach-form.component.spec.ts | 6 +- .../components/checklist.component.spec.ts | 14 +- .../components/checklist.component.ts | 4 +- .../no-task-detail-template.directive.spec.ts | 2 +- .../components/start-task.component.spec.ts | 82 +-- .../components/task-audit.directive.spec.ts | 12 +- .../components/task-details.component.spec.ts | 18 +- .../components/task-details.component.ts | 6 +- .../components/task-filters.component.spec.ts | 58 +-- .../components/task-filters.component.ts | 2 +- .../components/task-header.component.spec.ts | 54 +- .../components/task-list.component.spec.ts | 52 +- .../components/task-list.component.ts | 8 +- .../task-list/models/task-details.model.ts | 4 +- .../services/process-upload.service.ts | 6 +- .../services/task-filter.service.spec.ts | 6 +- .../task-list/services/task-filter.service.ts | 18 +- .../task-list/services/task-upload.service.ts | 6 +- .../services/tasklist.service.spec.ts | 22 +- .../task-list/services/tasklist.service.ts | 10 +- .../src/lib/core/browser-visibility.ts | 2 +- lib/testing/src/lib/core/pages/header.page.ts | 8 +- .../src/lib/core/pages/user-info.page.ts | 6 +- lib/testing/src/lib/material/tabs.page.ts | 4 +- .../actions/testing-alfresco-api.service.ts | 2 +- .../app/app-list-cloud.page.ts | 6 +- .../pages/form-fields.page.ts | 26 +- tslint.json | 2 +- 581 files changed, 5435 insertions(+), 5402 deletions(-) diff --git a/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts b/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts index a823a6c2c4..9c803d6486 100644 --- a/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts +++ b/demo-shell/src/app/components/app-layout/cloud/directives/nested-menu-position.directive.ts @@ -30,7 +30,7 @@ export class NestedMenuPositionDirective { @HostListener('click', ['$event']) onClick() { - let overlayContainer = (document.querySelector('.cdk-overlay-connected-position-bounding-box') as HTMLElement); + const overlayContainer = (document.querySelector('.cdk-overlay-connected-position-bounding-box') as HTMLElement); (document.querySelector('.cdk-overlay-pane') as HTMLElement).style.width = '100%'; if (!this.menuMinimized) { diff --git a/demo-shell/src/app/components/form/form.component.ts b/demo-shell/src/app/components/form/form.component.ts index 2ad4c117c5..f56a72baec 100644 --- a/demo-shell/src/app/components/form/form.component.ts +++ b/demo-shell/src/app/components/form/form.component.ts @@ -99,9 +99,9 @@ export class FormComponent implements OnInit, OnDestroy { } onConfigAdded($event: any): void { - let file = $event.currentTarget.files[0]; + const file = $event.currentTarget.files[0]; - let fileReader = new FileReader(); + const fileReader = new FileReader(); fileReader.onload = () => { this.formConfig = fileReader.result; }; diff --git a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts index 3d1fd144e8..76d46f6892 100644 --- a/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts +++ b/demo-shell/src/app/components/process-list-demo/process-list-demo.component.ts @@ -112,7 +112,7 @@ export class ProcessListDemoComponent implements OnInit { this.size = parseInt(processFilter.processSize, 10); } if (processFilter.processPage) { - let pageValue = parseInt(processFilter.processPage, 10); + const pageValue = parseInt(processFilter.processPage, 10); this.page = pageValue > 0 ? pageValue - 1 : pageValue; } else { this.page = 0; diff --git a/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts b/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts index d3a44ca4c3..4bc4c16907 100644 --- a/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts +++ b/demo-shell/src/app/components/task-list-demo/task-list-demo.component.ts @@ -140,7 +140,7 @@ export class TaskListDemoComponent implements OnInit { } if (taskFilter.taskPage) { - let pageValue = parseInt(taskFilter.taskPage, 10); + const pageValue = parseInt(taskFilter.taskPage, 10); this.page = pageValue > 0 ? pageValue - 1 : pageValue; } else { this.page = 0; @@ -150,7 +150,7 @@ export class TaskListDemoComponent implements OnInit { } setDueAfterFilter(date): string { - let dueDateFilter = moment(date); + const dueDateFilter = moment(date); dueDateFilter.set({ hour: 23, minute: 59, diff --git a/e2e/actions/ACS/node.actions.ts b/e2e/actions/ACS/node.actions.ts index 493cda365d..37291abc24 100644 --- a/e2e/actions/ACS/node.actions.ts +++ b/e2e/actions/ACS/node.actions.ts @@ -27,7 +27,7 @@ export class NodeActions { async getNodesDisplayed(alfrescoJsApi, idList, numberOfElements) { - let promises = []; + const promises = []; let nodeList; for (let i = 0; i < (numberOfElements - 1); i++) { diff --git a/e2e/actions/ACS/upload.actions.ts b/e2e/actions/ACS/upload.actions.ts index 7b0da1536a..ae6495f050 100644 --- a/e2e/actions/ACS/upload.actions.ts +++ b/e2e/actions/ACS/upload.actions.ts @@ -22,8 +22,8 @@ import TestConfig = require('../../test.config'); export class UploadActions { async uploadFile(alfrescoJsApi, fileLocation, fileName, parentFolderId) { - let pathFile = path.join(TestConfig.main.rootPath + fileLocation); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + fileLocation); + const file = fs.createReadStream(pathFile); return alfrescoJsApi.upload.uploadFile( file, @@ -39,10 +39,10 @@ export class UploadActions { } async createEmptyFiles(alfrescoJsApi, emptyFileNames: string[], parentFolderId) { - let filesRequest = []; + const filesRequest = []; for (let i = 0; i < emptyFileNames.length; i++) { - let jsonItem = {}; + const jsonItem = {}; jsonItem['name'] = emptyFileNames[i]; jsonItem['nodeType'] = 'cm:content'; filesRequest.push(jsonItem); @@ -65,15 +65,15 @@ export class UploadActions { } async uploadFolder(alfrescoJsApi, sourcePath, folder) { - let absolutePath = '../../' + sourcePath; - let files = fs.readdirSync(path.join(__dirname, absolutePath)); + const absolutePath = '../../' + sourcePath; + const files = fs.readdirSync(path.join(__dirname, absolutePath)); let uploadedFiles; - let promises = []; + const promises = []; if (files && files.length > 0) { for (const fileName of files) { - let pathFile = path.join(sourcePath, fileName); + const pathFile = path.join(sourcePath, fileName); promises.push(this.uploadFile(alfrescoJsApi, pathFile, fileName, folder)); } uploadedFiles = await Promise.all(promises); diff --git a/e2e/actions/APS-cloud/roles.ts b/e2e/actions/APS-cloud/roles.ts index 3f0893c19c..3ee27fd39e 100644 --- a/e2e/actions/APS-cloud/roles.ts +++ b/e2e/actions/APS-cloud/roles.ts @@ -32,7 +32,7 @@ export class Roles { const queryParams = {}, postBody = {}; const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); - for (let key in data) { + for (const key in data) { if (data[key].name === roleName) { roleId = data[key].id; } diff --git a/e2e/actions/APS-cloud/tasks.ts b/e2e/actions/APS-cloud/tasks.ts index b22bf3e6e2..972955ab00 100644 --- a/e2e/actions/APS-cloud/tasks.ts +++ b/e2e/actions/APS-cloud/tasks.ts @@ -73,7 +73,7 @@ export class Tasks { } async createAndCompleteTask (taskName, appName) { - let task = await this.createStandaloneTask(taskName, appName); + const task = await this.createStandaloneTask(taskName, appName); await this.claimTask(task.entry.id, appName); await this.completeTask(task.entry.id, appName); return task; diff --git a/e2e/actions/APS/apps.actions.ts b/e2e/actions/APS/apps.actions.ts index 99459acb8c..c80c731280 100644 --- a/e2e/actions/APS/apps.actions.ts +++ b/e2e/actions/APS/apps.actions.ts @@ -25,7 +25,7 @@ import { browser } from 'protractor'; export class AppsActions { async getProcessTaskId(alfrescoJsApi, processId) { - let taskList = await alfrescoJsApi.activiti.taskApi.listTasks({}); + const taskList = await alfrescoJsApi.activiti.taskApi.listTasks({}); let taskId = -1; taskList.data.forEach((task) => { @@ -38,7 +38,7 @@ export class AppsActions { } async getAppDefinitionId(alfrescoJsApi, appModelId) { - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); let appDefinitionId = -1; appDefinitions.data.forEach((appDefinition) => { @@ -51,9 +51,9 @@ export class AppsActions { } async importPublishDeployApp(alfrescoJsApi, appFileLocation) { - let appCreated = await this.importApp(alfrescoJsApi, appFileLocation); + const appCreated = await this.importApp(alfrescoJsApi, appFileLocation); - let publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appCreated.id, new AppPublish()); + const publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appCreated.id, new AppPublish()); await alfrescoJsApi.activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] }); @@ -63,8 +63,8 @@ export class AppsActions { async importApp(alfrescoJsApi, appFileLocation) { browser.setFileDetector(new remote.FileDetector()); - let pathFile = path.join(TestConfig.main.rootPath + appFileLocation); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + appFileLocation); + const file = fs.createReadStream(pathFile); return await alfrescoJsApi.activiti.appsApi.importAppDefinition(file); } @@ -72,7 +72,7 @@ export class AppsActions { async publishDeployApp(alfrescoJsApi, appId) { browser.setFileDetector(new remote.FileDetector()); - let publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appId, new AppPublish()); + const publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appId, new AppPublish()); await alfrescoJsApi.activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] }); @@ -82,12 +82,12 @@ export class AppsActions { async importNewVersionAppDefinitionPublishDeployApp(alfrescoJsApi, appFileLocation, modelId) { browser.setFileDetector(new remote.FileDetector()); - let pathFile = path.join(TestConfig.main.rootPath + appFileLocation); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + appFileLocation); + const file = fs.createReadStream(pathFile); - let appCreated = await alfrescoJsApi.activiti.appsApi.importNewAppDefinition(modelId, file); + const appCreated = await alfrescoJsApi.activiti.appsApi.importNewAppDefinition(modelId, file); - let publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appCreated.id, new AppPublish()); + const publishApp = await alfrescoJsApi.activiti.appsApi.publishAppDefinition(appCreated.id, new AppPublish()); await alfrescoJsApi.activiti.appsApi.deployAppDefinitions({ appDefinitions: [{ id: publishApp.appDefinition.id }] }); @@ -97,21 +97,21 @@ export class AppsActions { async startProcess(alfrescoJsApi, app, processName?: string) { browser.setFileDetector(new remote.FileDetector()); - let appDefinitionsList = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitionsList = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); - let appDefinition = appDefinitionsList.data.filter((currentApp) => { + const appDefinition = appDefinitionsList.data.filter((currentApp) => { return currentApp.name === app.name; }); - let processDefinitionList = await alfrescoJsApi.activiti.processApi.getProcessDefinitions({ deploymentId: appDefinition.deploymentId }); + const processDefinitionList = await alfrescoJsApi.activiti.processApi.getProcessDefinitions({ deploymentId: appDefinition.deploymentId }); - let chosenProcess = processDefinitionList.data.find( (processDefinition) => { + const chosenProcess = processDefinitionList.data.find( (processDefinition) => { return processDefinition.name === processName; }); - let processDefinitionIdToStart = chosenProcess ? chosenProcess.id : processDefinitionList.data[0].id; + const processDefinitionIdToStart = chosenProcess ? chosenProcess.id : processDefinitionList.data[0].id; - let startProcessOptions: any = { processDefinitionId: processDefinitionIdToStart }; + const startProcessOptions: any = { processDefinitionId: processDefinitionIdToStart }; if (typeof processName !== 'undefined') { startProcessOptions.name = processName; diff --git a/e2e/actions/APS/appsRuntime.actions.ts b/e2e/actions/APS/appsRuntime.actions.ts index 745128ccbb..32249c1aa5 100644 --- a/e2e/actions/APS/appsRuntime.actions.ts +++ b/e2e/actions/APS/appsRuntime.actions.ts @@ -19,7 +19,7 @@ export class AppsRuntimeActions { async getRuntimeAppByName(alfrescoJsApi, appName) { - let runtimeApps = await this.getRuntimeAppDefinitions(alfrescoJsApi); + const runtimeApps = await this.getRuntimeAppDefinitions(alfrescoJsApi); let desiredApp; for (let i = 0; i < runtimeApps.data.length; i++) { diff --git a/e2e/actions/drop.actions.ts b/e2e/actions/drop.actions.ts index 5b49f6428b..c1732346a3 100644 --- a/e2e/actions/drop.actions.ts +++ b/e2e/actions/drop.actions.ts @@ -22,20 +22,20 @@ import path = require('path'); import TestConfig = require('../test.config'); import remote = require('selenium-webdriver/remote'); -let JS_BIND_INPUT = function (target) { - let input = document.createElement('input'); +const JS_BIND_INPUT = function (target) { + const input = document.createElement('input'); input.type = 'file'; input.style.display = 'none'; input.addEventListener('change', function (event) { target.scrollIntoView(true); - let rect = target.getBoundingClientRect(); - let x = rect.left + (rect.width >> 1); - let y = rect.top + (rect.height >> 1); - let data = { files: input.files }; + const rect = target.getBoundingClientRect(); + const x = rect.left + (rect.width >> 1); + const y = rect.top + (rect.height >> 1); + const data = { files: input.files }; ['dragenter', 'dragover', 'drop'].forEach(function (name) { - let mouseEvent: any = document.createEvent('MouseEvent'); + const mouseEvent: any = document.createEvent('MouseEvent'); mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null); mouseEvent.dataTransfer = data; target.dispatchEvent(mouseEvent); @@ -48,8 +48,8 @@ let JS_BIND_INPUT = function (target) { return input; }; -let JS_BIND_INPUT_FOLDER = function (target) { - let input: any = document.createElement('input'); +const JS_BIND_INPUT_FOLDER = function (target) { + const input: any = document.createElement('input'); input.type = 'file'; input.style.display = 'none'; input.multiple = true; @@ -57,13 +57,13 @@ let JS_BIND_INPUT_FOLDER = function (target) { input.addEventListener('change', function (event) { target.scrollIntoView(true); - let rect = target.getBoundingClientRect(); - let x = rect.left + (rect.width >> 1); - let y = rect.top + (rect.height >> 1); - let data = { files: input.files }; + const rect = target.getBoundingClientRect(); + const x = rect.left + (rect.width >> 1); + const y = rect.top + (rect.height >> 1); + const data = { files: input.files }; ['dragenter', 'dragover', 'drop'].forEach(function (name) { - let mouseEvent: any = document.createEvent('MouseEvent'); + const mouseEvent: any = document.createEvent('MouseEvent'); mouseEvent.initMouseEvent(name, !0, !0, window, 0, 0, 0, x, y, !1, !1, !1, !1, 0, null); mouseEvent.dataTransfer = data; target.dispatchEvent(mouseEvent); @@ -81,7 +81,7 @@ export class DropActions { dropFile(dropArea, filePath) { browser.setFileDetector(new remote.FileDetector()); - let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, filePath)); + const absolutePath = path.resolve(path.join(TestConfig.main.rootPath, filePath)); fs.accessSync(absolutePath, fs.constants.F_OK); return dropArea.getWebElement().then((element) => { @@ -95,7 +95,7 @@ export class DropActions { dropFolder(dropArea, folderPath) { browser.setFileDetector(new remote.FileDetector()); - let absolutePath = path.resolve(path.join(TestConfig.main.rootPath, folderPath)); + const absolutePath = path.resolve(path.join(TestConfig.main.rootPath, folderPath)); fs.accessSync(absolutePath, fs.constants.F_OK); return dropArea.getWebElement().then((element) => { diff --git a/e2e/actions/users.actions.ts b/e2e/actions/users.actions.ts index a251d8e4c4..1fd0be5fbf 100644 --- a/e2e/actions/users.actions.ts +++ b/e2e/actions/users.actions.ts @@ -26,9 +26,9 @@ import { browser } from 'protractor'; export class UsersActions { async createTenantAndUser(alfrescoJsApi) { - let newTenant = await alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); - let user = new User({ tenantId: newTenant.id }); + const user = new User({ tenantId: newTenant.id }); await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user); @@ -36,7 +36,7 @@ export class UsersActions { } async createApsUser(alfrescoJsApi, tenantId) { - let user = new User({ tenantId: tenantId }); + const user = new User({ tenantId: tenantId }); await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user); @@ -45,9 +45,9 @@ export class UsersActions { async getApsUserByEmail(alfrescoJsApi, email) { - let users = await alfrescoJsApi.activiti.adminUsersApi.getUsers(); + const users = await alfrescoJsApi.activiti.adminUsersApi.getUsers(); - let user = users.data.filter((currentUser) => { + const user = users.data.filter((currentUser) => { return currentUser.email === email; }); @@ -55,7 +55,7 @@ export class UsersActions { } async createApsUserWithName(alfrescoJsApi, tenantId, email, firstName, lastName) { - let user = new User({ tenantId: tenantId , email: email, firstName: firstName, lastName: lastName}); + const user = new User({ tenantId: tenantId , email: email, firstName: firstName, lastName: lastName}); await alfrescoJsApi.activiti.adminUsersApi.createNewUser(user); @@ -69,8 +69,8 @@ export class UsersActions { async changeProfilePictureAps(alfrescoJsApi, fileLocation) { browser.setFileDetector(new remote.FileDetector()); - let pathFile = path.join(TestConfig.main.rootPath + fileLocation); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + fileLocation); + const file = fs.createReadStream(pathFile); return alfrescoJsApi.activiti.profileApi.uploadProfilePicture(file); } diff --git a/e2e/content-services/comments/comment-component.e2e.ts b/e2e/content-services/comments/comment-component.e2e.ts index 966e15f973..6c68e9e274 100644 --- a/e2e/content-services/comments/comment-component.e2e.ts +++ b/e2e/content-services/comments/comment-component.e2e.ts @@ -35,22 +35,22 @@ import { browser } from 'protractor'; describe('Comment Component', () => { - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let viewerPage = new ViewerPage(); - let commentsPage = new CommentsPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const viewerPage = new ViewerPage(); + const commentsPage = new CommentsPage(); const navigationBar = new NavigationBarPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); let nodeId, userFullName; - let comments = { + const comments = { first: 'This is a comment', multiline: 'This is a comment\n' + 'with a new line', second: 'This is another comment', @@ -80,7 +80,7 @@ describe('Comment Component', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); + const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); nodeId = pngUploadedFile.entry.id; diff --git a/e2e/content-services/directives/create-folder-directive.e2e.ts b/e2e/content-services/directives/create-folder-directive.e2e.ts index e512df5f9b..ec2563576c 100644 --- a/e2e/content-services/directives/create-folder-directive.e2e.ts +++ b/e2e/content-services/directives/create-folder-directive.e2e.ts @@ -28,13 +28,13 @@ import { browser, Key } from 'protractor'; describe('Create folder directive', function () { - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let createFolderDialog = new CreateFolderDialog(); - let notificationPage = new NotificationPage(); - let metadataViewPage = new MetadataViewPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const createFolderDialog = new CreateFolderDialog(); + const notificationPage = new NotificationPage(); + const metadataViewPage = new MetadataViewPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ @@ -64,7 +64,7 @@ describe('Create folder directive', function () { }); it('[C260154] Should not create the folder if cancel button is clicked', () => { - let folderName = 'cancelFolder'; + const folderName = 'cancelFolder'; contentServicesPage.clickOnCreateNewFolder(); createFolderDialog.addFolderName(folderName); @@ -74,7 +74,7 @@ describe('Create folder directive', function () { }); it('[C260155] Should enable the Create button only when a folder name is present', () => { - let folderName = 'NotEnableFolder'; + const folderName = 'NotEnableFolder'; contentServicesPage.clickOnCreateNewFolder(); createFolderDialog.checkCreateBtnIsDisabled(); @@ -85,7 +85,7 @@ describe('Create folder directive', function () { }); it('[C260156] Should not be possible create two folder with the same name', () => { - let folderName = 'duplicate'; + const folderName = 'duplicate'; contentServicesPage.createNewFolder(folderName); contentServicesPage.checkContentIsDisplayed(folderName); @@ -96,7 +96,7 @@ describe('Create folder directive', function () { }); it('[C260157] Should be possible create a folder under a folder with the same name', () => { - let folderName = 'sameSubFolder'; + const folderName = 'sameSubFolder'; contentServicesPage.createNewFolder(folderName); contentServicesPage.checkContentIsDisplayed(folderName); @@ -108,8 +108,8 @@ describe('Create folder directive', function () { }); it('[C260158] Should be possible add a folder description when create a new folder', () => { - let folderName = 'folderDescription'; - let description = 'this is the description'; + const folderName = 'folderDescription'; + const description = 'this is the description'; contentServicesPage.clickOnCreateNewFolder(); diff --git a/e2e/content-services/directives/create-library-directive.e2e.ts b/e2e/content-services/directives/create-library-directive.e2e.ts index 47a52e595b..c97abf56e3 100644 --- a/e2e/content-services/directives/create-library-directive.e2e.ts +++ b/e2e/content-services/directives/create-library-directive.e2e.ts @@ -28,12 +28,12 @@ import { Util } from '../../util/util'; describe('Create library directive', function () { - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let createLibraryDialog = new CreateLibraryDialog(); - let customSourcesPage = new CustomSources(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const createLibraryDialog = new CreateLibraryDialog(); + const customSourcesPage = new CustomSources(); - let visibility = { + const visibility = { public: 'Public', private: 'Private', moderated: 'Moderated' @@ -41,7 +41,7 @@ describe('Create library directive', function () { let createSite; - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ @@ -88,7 +88,7 @@ describe('Create library directive', function () { }); it('[C290159] Should close the dialog when clicking Cancel button', () => { - let libraryName = 'cancelLibrary'; + const libraryName = 'cancelLibrary'; createLibraryDialog.typeLibraryName(libraryName); @@ -98,8 +98,8 @@ describe('Create library directive', function () { }); it('[C290160] Should create a public library', () => { - let libraryName = Util.generateRandomString(); - let libraryDescription = Util.generateRandomString(); + const libraryName = Util.generateRandomString(); + const libraryDescription = Util.generateRandomString(); createLibraryDialog.typeLibraryName(libraryName); createLibraryDialog.typeLibraryDescription(libraryDescription); createLibraryDialog.selectPublic(); @@ -119,8 +119,8 @@ describe('Create library directive', function () { }); it('[C290173] Should create a private library', () => { - let libraryName = Util.generateRandomString(); - let libraryDescription = Util.generateRandomString(); + const libraryName = Util.generateRandomString(); + const libraryDescription = Util.generateRandomString(); createLibraryDialog.typeLibraryName(libraryName); createLibraryDialog.typeLibraryDescription(libraryDescription); createLibraryDialog.selectPrivate(); @@ -140,9 +140,9 @@ describe('Create library directive', function () { }); it('[C290174, C290175] Should create a moderated library with a given Library ID', () => { - let libraryName = Util.generateRandomString(); - let libraryId = Util.generateRandomString(); - let libraryDescription = Util.generateRandomString(); + const libraryName = Util.generateRandomString(); + const libraryId = Util.generateRandomString(); + const libraryDescription = Util.generateRandomString(); createLibraryDialog.typeLibraryName(libraryName); createLibraryDialog.typeLibraryId(libraryId); createLibraryDialog.typeLibraryDescription(libraryDescription); @@ -163,7 +163,7 @@ describe('Create library directive', function () { }); it('[C290163] Should disable Create button when a mandatory field is not filled in', () => { - let inputValue = Util.generateRandomString(); + const inputValue = Util.generateRandomString(); createLibraryDialog.typeLibraryName(inputValue); createLibraryDialog.clearLibraryId(); @@ -179,8 +179,8 @@ describe('Create library directive', function () { }); it('[C290164] Should auto-fill in the Library Id built from library name', () => { - let name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*']; - let libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link']; + const name: string[] = ['abcd1234', 'ab cd 12 34', 'ab cd&12+34_@link/*']; + const libraryId: string[] = ['abcd1234', 'ab-cd-12-34', 'ab-cd1234link']; for (let _i = 0; _i < 3; _i++) { createLibraryDialog.typeLibraryName(name[_i]); @@ -190,8 +190,8 @@ describe('Create library directive', function () { }); it('[C290176] Should not accept special characters for Library Id', () => { - let name = 'My Library'; - let libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>']; + const name = 'My Library'; + const libraryId: string[] = ['My New Library', 'My+New+Library123!', '<>']; createLibraryDialog.typeLibraryName(name); @@ -203,8 +203,8 @@ describe('Create library directive', function () { }); it('[C291985] Should not accept less than one character name for Library name', () => { - let name = 'x'; - let libraryId = 'My New Library'; + const name = 'x'; + const libraryId = 'My New Library'; createLibraryDialog.typeLibraryName(name); createLibraryDialog.typeLibraryId(libraryId); @@ -213,8 +213,8 @@ describe('Create library directive', function () { }); it('[C291793] Should display error for Name field filled in with spaces only', () => { - let name = ' '; - let libraryId = Util.generateRandomString(); + const name = ' '; + const libraryId = Util.generateRandomString(); createLibraryDialog.typeLibraryName(name); createLibraryDialog.typeLibraryId(libraryId); @@ -224,8 +224,8 @@ describe('Create library directive', function () { }); it('[C290177] Should not accept a duplicate Library Id', () => { - let name = 'My Library'; - let libraryId = Util.generateRandomString(); + const name = 'My Library'; + const libraryId = Util.generateRandomString(); createLibraryDialog.typeLibraryName(name); createLibraryDialog.typeLibraryId(libraryId); @@ -241,8 +241,8 @@ describe('Create library directive', function () { }); it('[C290178] Should accept the same library name but different Library Ids', () => { - let name = createSite.entry.title; - let libraryId = Util.generateRandomString(); + const name = createSite.entry.title; + const libraryId = Util.generateRandomString(); createLibraryDialog.typeLibraryName(name.toUpperCase()); createLibraryDialog.typeLibraryId(libraryId); @@ -257,9 +257,9 @@ describe('Create library directive', function () { }); it('[C290179] Should not accept more than the expected characters for input fields', () => { - let name = Util.generateRandomString(257); - let libraryId = Util.generateRandomString(73); - let libraryDescription = Util.generateRandomString(513); + const name = Util.generateRandomString(257); + const libraryId = Util.generateRandomString(73); + const libraryDescription = Util.generateRandomString(513); createLibraryDialog.typeLibraryName(name); createLibraryDialog.typeLibraryId(libraryId); diff --git a/e2e/content-services/document-list/document-list-actions.e2e.ts b/e2e/content-services/document-list/document-list-actions.e2e.ts index 74f10b3872..c1f3e98284 100644 --- a/e2e/content-services/document-list/document-list-actions.e2e.ts +++ b/e2e/content-services/document-list/document-list-actions.e2e.ts @@ -28,19 +28,19 @@ import { Util } from '../../util/util'; describe('Document List Component - Actions', () => { - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let contentListPage = contentServicesPage.getDocumentList(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const contentListPage = contentServicesPage.getDocumentList(); let uploadedFolder, secondUploadedFolder; - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); let acsUser = null; let testFileNode; - let pdfFileModel = new FileModel({ + const pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location }); - let testFileModel = new FileModel({ + const testFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); diff --git a/e2e/content-services/document-list/document-list-component.e2e.ts b/e2e/content-services/document-list/document-list-component.e2e.ts index ff35981cab..15ceebb10b 100644 --- a/e2e/content-services/document-list/document-list-component.e2e.ts +++ b/e2e/content-services/document-list/document-list-component.e2e.ts @@ -32,13 +32,13 @@ import moment from 'moment-es6'; describe('Document List Component', () => { - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let navBar = new NavigationBarPage(); - let errorPage = new ErrorPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const navBar = new NavigationBarPage(); + const errorPage = new ErrorPage(); let privateSite; let uploadedFolder, uploadedFolderExtra; - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); let acsUser = null; let testFileNode, pdfBFileNode; @@ -74,9 +74,9 @@ describe('Document List Component', () => { beforeAll(async (done) => { acsUser = new AcsUserModel(); - let siteName = `PRIVATE_TEST_SITE_${Util.generateRandomString(5)}`; - let folderName = `MEESEEKS_${Util.generateRandomString(5)}`; - let privateSiteBody = { visibility: 'PRIVATE', title: siteName }; + const siteName = `PRIVATE_TEST_SITE_${Util.generateRandomString(5)}`; + const folderName = `MEESEEKS_${Util.generateRandomString(5)}`; + const privateSiteBody = { visibility: 'PRIVATE', title: siteName }; await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); @@ -125,19 +125,19 @@ describe('Document List Component', () => { describe('Custom Column', () => { let folderName; - let pdfFileModel = new FileModel({ + const pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location }); - let docxFileModel = new FileModel({ + const docxFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name, 'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location }); - let timeAgoFileModel = new FileModel({ + const timeAgoFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); - let mediumFileModel = new FileModel({ + const mediumFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location }); @@ -205,7 +205,7 @@ describe('Document List Component', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); timeAgoUploadedNode = await uploadActions.uploadFile(this.alfrescoJsApi, timeAgoFileModel.location, timeAgoFileModel.name, '-my-'); contentServicesPage.goToDocumentList(); - let dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created'); + const dateValue = contentServicesPage.getColumnValueForRow(timeAgoFileModel.name, 'Created'); expect(dateValue).toContain('ago'); done(); }); @@ -213,10 +213,10 @@ describe('Document List Component', () => { it('[C279929] Should be able to display the date with date type', async (done) => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); mediumDateUploadedNode = await uploadActions.uploadFile(this.alfrescoJsApi, mediumFileModel.location, mediumFileModel.name, '-my-'); - let createdDate = moment(mediumDateUploadedNode.createdAt).format('ll'); + const createdDate = moment(mediumDateUploadedNode.createdAt).format('ll'); contentServicesPage.goToDocumentList(); contentServicesPage.enableMediumTimeFormat(); - let dateValue = contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created'); + const dateValue = contentServicesPage.getColumnValueForRow(mediumFileModel.name, 'Created'); expect(dateValue).toContain(createdDate); done(); }); @@ -224,17 +224,17 @@ describe('Document List Component', () => { describe('Column Sorting', () => { - let fakeFileA = new FileModel({ + const fakeFileA = new FileModel({ 'name': 'A', 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); - let fakeFileB = new FileModel({ + const fakeFileB = new FileModel({ 'name': 'B', 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); - let fakeFileC = new FileModel({ + const fakeFileC = new FileModel({ 'name': 'C', 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); @@ -243,7 +243,7 @@ describe('Document List Component', () => { beforeAll(async (done) => { - let user = new AcsUserModel(); + const user = new AcsUserModel(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); @@ -312,7 +312,7 @@ describe('Document List Component', () => { it('[C279959] Should display empty folder state for new folders', async (done) => { acsUser = new AcsUserModel(); - let folderName = 'BANANA'; + const folderName = 'BANANA'; await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser); loginPage.loginToContentServicesUsingUserModel(acsUser); @@ -325,13 +325,13 @@ describe('Document List Component', () => { }); it('[C272775] Should be able to upload a file in new folder', async (done) => { - let testFile = new FileModel({ + const testFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); acsUser = new AcsUserModel(); /* cspell:disable-next-line */ - let folderName = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; + const folderName = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser); await this.alfrescoJsApi.login(acsUser.id, acsUser.password); @@ -352,7 +352,7 @@ describe('Document List Component', () => { loginPage.loginToContentServicesUsingUserModel(acsUser); contentServicesPage.clickOnContentServices(); contentServicesPage.checkRecentFileToBeShowed(); - let icon = await contentServicesPage.getRecentFileIcon(); + const icon = await contentServicesPage.getRecentFileIcon(); expect(icon).toBe('history'); contentServicesPage.expandRecentFiles(); contentServicesPage.checkEmptyRecentFileIsDisplayed(); @@ -362,8 +362,8 @@ describe('Document List Component', () => { it('[C279970] Should display Islocked field for folders', async (done) => { acsUser = new AcsUserModel(); - let folderNameA = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; - let folderNameB = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; + const folderNameA = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; + const folderNameB = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); await this.alfrescoJsApi.core.peopleApi.addPerson(acsUser); await this.alfrescoJsApi.login(acsUser.id, acsUser.password); @@ -379,11 +379,11 @@ describe('Document List Component', () => { }); it('[C269086] Should display Islocked field for files', async (done) => { - let testFileA = new FileModel({ + const testFileA = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); - let testFileB = new FileModel({ + const testFileB = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location }); @@ -441,21 +441,21 @@ describe('Document List Component', () => { describe('Thumbnails and tooltips', () => { - let pdfFile = new FileModel({ + const pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location }); - let testFile = new FileModel({ + const testFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); - let docxFile = new FileModel({ + const docxFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name, 'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location }); - let folderName = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; + const folderName = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; let filePdfNode, fileTestNode, fileDocxNode, folderNode; beforeAll(async (done) => { @@ -504,25 +504,25 @@ describe('Document List Component', () => { }); it('[C260119] Should have a specific thumbnail for folders', async (done) => { - let folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName); + const folderIconUrl = await contentServicesPage.getRowIconImageUrl(folderName); expect(folderIconUrl).toContain('/assets/images/ft_ic_folder.svg'); done(); }); it('[C280066] Should have a specific thumbnail PDF files', async (done) => { - let fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name); + const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name); expect(fileIconUrl).toContain('/assets/images/ft_ic_pdf.svg'); done(); }); it('[C280067] Should have a specific thumbnail DOCX files', async (done) => { - let fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name); + const fileIconUrl = await contentServicesPage.getRowIconImageUrl(docxFile.name); expect(fileIconUrl).toContain('/assets/images/ft_ic_ms_word.svg'); done(); }); it('[C280068] Should have a specific thumbnail files', async (done) => { - let fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name); + const fileIconUrl = await contentServicesPage.getRowIconImageUrl(testFile.name); expect(fileIconUrl).toContain('/assets/images/ft_ic_document.svg'); done(); }); @@ -530,7 +530,7 @@ describe('Document List Component', () => { it('[C274701] Should be able to enable thumbnails', async (done) => { contentServicesPage.enableThumbnails(); contentServicesPage.checkAcsContainer(); - let fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name); + const fileIconUrl = await contentServicesPage.getRowIconImageUrl(pdfFile.name); expect(fileIconUrl).toContain(`/versions/1/nodes/${filePdfNode.entry.id}/renditions`); done(); }); @@ -538,7 +538,7 @@ describe('Document List Component', () => { describe('Gallery View', () => { - let cardProperties = { + const cardProperties = { DISPLAY_NAME: 'Display name', SIZE: 'Size', LOCK: 'Lock', @@ -548,21 +548,21 @@ describe('Document List Component', () => { let funnyUser; - let pdfFile = new FileModel({ + const pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location }); - let testFile = new FileModel({ + const testFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, 'location': resources.Files.ADF_DOCUMENTS.TEST.file_location }); - let docxFile = new FileModel({ + const docxFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name, 'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location }); - let folderName = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; + const folderName = `MEESEEKS_${Util.generateRandomString(5)}_LOOK_AT_ME`; let filePdfNode, fileTestNode, fileDocxNode, folderNode, filePDFSubNode; beforeAll(async (done) => { @@ -693,7 +693,7 @@ describe('Document List Component', () => { }); let file; - let viewer = new ViewerPage(); + const viewer = new ViewerPage(); beforeAll(async (done) => { acsUser = new AcsUserModel(); diff --git a/e2e/content-services/document-list/document-list-pagination.e2e.ts b/e2e/content-services/document-list/document-list-pagination.e2e.ts index cbf709a8ef..15f1238841 100644 --- a/e2e/content-services/document-list/document-list-pagination.e2e.ts +++ b/e2e/content-services/document-list/document-list-pagination.e2e.ts @@ -30,13 +30,13 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api'; import { UploadActions } from '../../actions/ACS/upload.actions'; describe('Document List - Pagination', function () { - let pagination = { + const pagination = { base: 'newFile', secondSetBase: 'secondSet', extension: '.txt' }; - let itemsPerPage = { + const itemsPerPage = { five: '5', fiveValue: 5, ten: '10', @@ -48,19 +48,23 @@ describe('Document List - Pagination', function () { default: '25' }; - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let paginationPage = new PaginationPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const paginationPage = new PaginationPage(); + const navigationBarPage = new NavigationBarPage(); - let acsUser = new AcsUserModel(); - let newFolderModel = new FolderModel({'name': 'newFolder'}); - let fileNames = [], nrOfFiles = 20, currentPage = 1, secondSetOfFiles = [], secondSetNumber = 25; - let folderTwoModel = new FolderModel({'name': 'folderTwo'}); - let folderThreeModel = new FolderModel({'name': 'folderThree'}); + const acsUser = new AcsUserModel(); + const newFolderModel = new FolderModel({'name': 'newFolder'}); + let fileNames = []; + const nrOfFiles = 20; + let currentPage = 1; + let secondSetOfFiles = []; + const secondSetNumber = 25; + const folderTwoModel = new FolderModel({'name': 'folderTwo'}); + const folderThreeModel = new FolderModel({'name': 'folderThree'}); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension); secondSetOfFiles = Util.generateSequenceFiles(10, secondSetNumber + 9, pagination.secondSetBase, pagination.extension); @@ -76,8 +80,8 @@ describe('Document List - Pagination', function () { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let folderThreeUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, folderThreeModel.name, '-my-'); - let newFolderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, newFolderModel.name, '-my-'); + const folderThreeUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, folderThreeModel.name, '-my-'); + const newFolderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, newFolderModel.name, '-my-'); await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, newFolderUploadedModel.entry.id); diff --git a/e2e/content-services/lock-file.e2e.ts b/e2e/content-services/lock-file.e2e.ts index 2f3251373c..4e317f8768 100644 --- a/e2e/content-services/lock-file.e2e.ts +++ b/e2e/content-services/lock-file.e2e.ts @@ -40,16 +40,16 @@ describe('Lock File', () => { const lockFilePage = new LockFilePage(); const contentServices = new ContentServicesPage(); - let adminUser = new AcsUserModel(); - let managerUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const adminUser = new AcsUserModel(); + const managerUser = new AcsUserModel(); + const uploadActions = new UploadActions(); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let pngFileToLock = new FileModel({ + const pngFileToLock = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location }); @@ -74,7 +74,7 @@ describe('Lock File', () => { visibility: 'PRIVATE' }); - let resultNode = await this.alfrescoJsApi.core.nodesApi.getNodeChildren(site.entry.guid); + const resultNode = await this.alfrescoJsApi.core.nodesApi.getNodeChildren(site.entry.guid); documentLibrary = resultNode.list.entries[0].entry.id; @@ -90,7 +90,7 @@ describe('Lock File', () => { describe('Lock file interaction with the UI', () => { beforeAll(async (done) => { - let pngLockedUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary); + const pngLockedUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileToLock.location, pngFileToLock.name, documentLibrary); lockedFileNodeId = pngLockedUploadedFile.entry.id; @@ -98,7 +98,7 @@ describe('Lock File', () => { }); beforeEach(async (done) => { - let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary); + const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary); nodeId = pngUploadedFile.entry.id; @@ -177,7 +177,7 @@ describe('Lock File', () => { describe('Locked file without owner permissions', () => { beforeEach(async (done) => { - let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary); + const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary); nodeId = pngUploadedFile.entry.id; @@ -275,7 +275,7 @@ describe('Lock File', () => { }); beforeEach(async (done) => { - let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary); + const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, documentLibrary); nodeId = pngUploadedFile.entry.id; @@ -303,7 +303,7 @@ describe('Lock File', () => { await lockFilePage.clickAllowOwnerCheckbox(); await lockFilePage.clickSaveButton(); - let response = await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' }); + const response = await this.alfrescoJsApi.core.nodesApi.updateNode(nodeId, { name: 'My new name' }); expect(response.entry.name).toEqual('My new name'); }); @@ -316,7 +316,7 @@ describe('Lock File', () => { await lockFilePage.clickAllowOwnerCheckbox(); await lockFilePage.clickSaveButton(); - let response = await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT'); + const response = await this.alfrescoJsApi.core.nodesApi.updateNodeContent(nodeId, 'NEW FILE CONTENT'); expect(response.entry.modifiedAt).toBeGreaterThan(response.entry.createdAt); }); @@ -331,7 +331,7 @@ describe('Lock File', () => { await this.alfrescoJsApi.core.nodesApi.moveNode(nodeId, { targetParentId: '-my-' }); - let movedFile = await this.alfrescoJsApi.core.nodesApi.getNode(nodeId); + const movedFile = await this.alfrescoJsApi.core.nodesApi.getNode(nodeId); expect(movedFile.entry.parentId).not.toEqual(documentLibrary); diff --git a/e2e/content-services/notifications-component.e2e.ts b/e2e/content-services/notifications-component.e2e.ts index 21496ea342..e5792fa2df 100644 --- a/e2e/content-services/notifications-component.e2e.ts +++ b/e2e/content-services/notifications-component.e2e.ts @@ -24,10 +24,10 @@ import { browser } from 'protractor'; describe('Notifications Component', () => { - let loginPage = new LoginPage(); - let notificationPage = new NotificationPage(); + const loginPage = new LoginPage(); + const notificationPage = new NotificationPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); beforeAll(async (done) => { diff --git a/e2e/content-services/permissions/permissions-component.e2e.ts b/e2e/content-services/permissions/permissions-component.e2e.ts index b825f01ec5..3a4d6cb312 100644 --- a/e2e/content-services/permissions/permissions-component.e2e.ts +++ b/e2e/content-services/permissions/permissions-component.e2e.ts @@ -59,7 +59,7 @@ describe('Permissions Component', function () { const uploadActions = new UploadActions(); - let contentList = contentServicesPage.getDocumentList(); + const contentList = contentServicesPage.getDocumentList(); const searchDialog = new SearchDialog(); @@ -69,11 +69,11 @@ describe('Permissions Component', function () { const notificationPage = new NotificationPage(); - let uploadDialog = new UploadDialog(); + const uploadDialog = new UploadDialog(); let fileOwnerUser, filePermissionUser, file; - let fileModel = new FileModel({ + const fileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, @@ -81,7 +81,7 @@ describe('Permissions Component', function () { }); - let testFileModel = new FileModel({ + const testFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, @@ -89,7 +89,7 @@ describe('Permissions Component', function () { }); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, @@ -97,7 +97,7 @@ describe('Permissions Component', function () { }); - let groupBody = { + const groupBody = { id: Util.generateRandomString(), @@ -105,7 +105,7 @@ describe('Permissions Component', function () { }; - let alfrescoJsApi = new AlfrescoApi({ + const alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -113,15 +113,15 @@ describe('Permissions Component', function () { }); - let roleConsumerFolderModel = new FolderModel({'name': 'roleConsumer' + Util.generateRandomString()}); + const roleConsumerFolderModel = new FolderModel({'name': 'roleConsumer' + Util.generateRandomString()}); - let roleCoordinatorFolderModel = new FolderModel({'name': 'roleCoordinator' + Util.generateRandomString()}); + const roleCoordinatorFolderModel = new FolderModel({'name': 'roleCoordinator' + Util.generateRandomString()}); - let roleCollaboratorFolderModel = new FolderModel({'name': 'roleCollaborator' + Util.generateRandomString()}); + const roleCollaboratorFolderModel = new FolderModel({'name': 'roleCollaborator' + Util.generateRandomString()}); - let roleContributorFolderModel = new FolderModel({'name': 'roleContributor' + Util.generateRandomString()}); + const roleContributorFolderModel = new FolderModel({'name': 'roleContributor' + Util.generateRandomString()}); - let roleEditorFolderModel = new FolderModel({'name': 'roleEditor' + Util.generateRandomString()}); + const roleEditorFolderModel = new FolderModel({'name': 'roleEditor' + Util.generateRandomString()}); let roleConsumerFolder, roleCoordinatorFolder, roleContributorFolder, roleCollaboratorFolder, roleEditorFolder; diff --git a/e2e/content-services/permissions/site-permissions.e2e.ts b/e2e/content-services/permissions/site-permissions.e2e.ts index 73abd0eedf..28018959a2 100644 --- a/e2e/content-services/permissions/site-permissions.e2e.ts +++ b/e2e/content-services/permissions/site-permissions.e2e.ts @@ -61,7 +61,7 @@ describe('Permissions Component', function () { const uploadActions = new UploadActions(); - let contentList = contentServicesPage.getDocumentList(); + const contentList = contentServicesPage.getDocumentList(); const searchDialog = new SearchDialog(); @@ -73,13 +73,13 @@ describe('Permissions Component', function () { const versionManagePage = new VersionManagePage(); - let uploadDialog = new UploadDialog(); + const uploadDialog = new UploadDialog(); let folderOwnerUser, consumerUser, siteConsumerUser, contributorUser, managerUser, collaboratorUser; let publicSite, privateSite, folderName; - let fileModel = new FileModel({ + const fileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, @@ -87,7 +87,7 @@ describe('Permissions Component', function () { }); - let testFileModel = new FileModel({ + const testFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TEST.file_name, @@ -95,7 +95,7 @@ describe('Permissions Component', function () { }); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, @@ -103,7 +103,7 @@ describe('Permissions Component', function () { }); - let alfrescoJsApi = new AlfrescoApi({ + const alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -143,15 +143,15 @@ describe('Permissions Component', function () { await alfrescoJsApi.login(folderOwnerUser.id, folderOwnerUser.password); - let publicSiteName = `PUBLIC_TEST_SITE_${Util.generateRandomString(5)}`; + const publicSiteName = `PUBLIC_TEST_SITE_${Util.generateRandomString(5)}`; - let privateSiteName = `PRIVATE_TEST_SITE_${Util.generateRandomString(5)}`; + const privateSiteName = `PRIVATE_TEST_SITE_${Util.generateRandomString(5)}`; folderName = `MEESEEKS_${Util.generateRandomString(5)}`; - let publicSiteBody = {visibility: 'PUBLIC', title: publicSiteName}; + const publicSiteBody = {visibility: 'PUBLIC', title: publicSiteName}; - let privateSiteBody = {visibility: 'PRIVATE', title: privateSiteName}; + const privateSiteBody = {visibility: 'PRIVATE', title: privateSiteName}; publicSite = await alfrescoJsApi.core.sitesApi.createSite(publicSiteBody); diff --git a/e2e/content-services/share-file/share-file.e2e.ts b/e2e/content-services/share-file/share-file.e2e.ts index 1f5ffab72b..3776365a97 100644 --- a/e2e/content-services/share-file/share-file.e2e.ts +++ b/e2e/content-services/share-file/share-file.e2e.ts @@ -40,10 +40,10 @@ describe('Share file', () => { const navigationBarPage = new NavigationBarPage(); const viewerPage = new ViewerPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); @@ -62,7 +62,7 @@ describe('Share file', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); + const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); nodeId = pngUploadedFile.entry.id; diff --git a/e2e/content-services/share-file/unshare-file.e2e.ts b/e2e/content-services/share-file/unshare-file.e2e.ts index 64483aa5f0..d9b8d96b7f 100644 --- a/e2e/content-services/share-file/unshare-file.e2e.ts +++ b/e2e/content-services/share-file/unshare-file.e2e.ts @@ -40,12 +40,12 @@ describe('Unshare file', () => { const shareDialog = new ShareDialog(); const siteName = `PRIVATE-TEST-SITE-${Util.generateRandomString(5)}`; - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); let nodeBody; let nodeId; let testSite; - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); @@ -97,7 +97,7 @@ describe('Unshare file', () => { await this.alfrescoJsApi.core.sharedlinksApi.addSharedLink({ nodeId: testFile1Id }); await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); + const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); nodeId = pngUploadedFile.entry.id; loginPage.loginToContentServicesUsingUserModel(acsUser); @@ -149,7 +149,7 @@ describe('Unshare file', () => { contentListPage.selectRow(pngFileModel.name); contentServicesPage.clickShareButton(); shareDialog.checkDialogIsDisplayed(); - let sharedLink = await shareDialog.getShareLink(); + const sharedLink = await shareDialog.getShareLink(); shareDialog.clickUnShareFile(); shareDialog.confirmationDialogIsDisplayed(); shareDialog.clickConfirmationDialogRemoveButton(); diff --git a/e2e/content-services/tag-component.e2e.ts b/e2e/content-services/tag-component.e2e.ts index d5c6fda406..20f79b4611 100644 --- a/e2e/content-services/tag-component.e2e.ts +++ b/e2e/content-services/tag-component.e2e.ts @@ -33,23 +33,23 @@ import { browser } from 'protractor'; describe('Tag component', () => { - let loginPage = new LoginPage(); - let tagPage = new TagPage(); - let appNavigationBarPage = new AppNavigationBarPage(); + const loginPage = new LoginPage(); + const tagPage = new TagPage(); + const appNavigationBarPage = new AppNavigationBarPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); - let pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name }); - let deleteFile = new FileModel({ 'name': Util.generateRandomString() }); - let sameTag = Util.generateRandomStringToLowerCase(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); + const pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name }); + const deleteFile = new FileModel({ 'name': Util.generateRandomString() }); + const sameTag = Util.generateRandomStringToLowerCase(); - let tagList = [ + const tagList = [ Util.generateRandomStringToLowerCase(), Util.generateRandomStringToLowerCase(), Util.generateRandomStringToLowerCase(), Util.generateRandomStringToLowerCase()]; - let tags = [ + const tags = [ { tag: 'test-tag-01' }, { tag: 'test-tag-02' }, { tag: 'test-tag-03' }, { tag: 'test-tag-04' }, { tag: 'test-tag-05' }, { tag: 'test-tag-06' }, { tag: 'test-tag-07' }, { tag: 'test-tag-08' }, { tag: 'test-tag-09' }, { tag: 'test-tag-10' }, { tag: 'test-tag-11' }, { tag: 'test-tag-12' }, { tag: 'test-tag-13' }, { tag: 'test-tag-14' }, { tag: 'test-tag-15' }, @@ -57,9 +57,9 @@ describe('Tag component', () => { { tag: 'test-tag-21' }, { tag: 'test-tag-22' }, { tag: 'test-tag-23' }, { tag: 'test-tag-24' }, { tag: 'test-tag-25' }, { tag: 'test-tag-26' }, { tag: 'test-tag-27' }, { tag: 'test-tag-28' }, { tag: 'test-tag-29' }, { tag: 'test-tag-30' }]; - let uppercaseTag = Util.generateRandomStringToUpperCase(); - let digitsTag = Util.generateRandomStringDigits(); - let nonLatinTag = Util.generateRandomStringNonLatin(); + const uppercaseTag = Util.generateRandomStringToUpperCase(); + const digitsTag = Util.generateRandomStringDigits(); + const nonLatinTag = Util.generateRandomStringNonLatin(); let pdfUploadedFile, nodeId; beforeAll(async (done) => { @@ -78,7 +78,7 @@ describe('Tag component', () => { nodeId = pdfUploadedFile.entry.id; - let uploadedDeleteFile = await uploadActions.uploadFile(this.alfrescoJsApi, deleteFile.location, deleteFile.name, '-my-'); + const uploadedDeleteFile = await uploadActions.uploadFile(this.alfrescoJsApi, deleteFile.location, deleteFile.name, '-my-'); Object.assign(pdfFileModel, pdfUploadedFile.entry); @@ -160,7 +160,7 @@ describe('Tag component', () => { }); it('[C260375] Should be possible to delete a tag', () => { - let deleteTag = Util.generateRandomStringToUpperCase(); + const deleteTag = Util.generateRandomStringToUpperCase(); tagPage.insertNodeId(deleteFile.id); diff --git a/e2e/content-services/trashcan-pagination.e2e.ts b/e2e/content-services/trashcan-pagination.e2e.ts index aa8af99d23..5657ac4521 100644 --- a/e2e/content-services/trashcan-pagination.e2e.ts +++ b/e2e/content-services/trashcan-pagination.e2e.ts @@ -32,12 +32,12 @@ import { UploadActions } from '../actions/ACS/upload.actions'; import { browser } from 'protractor'; describe('Trashcan - Pagination', () => { - let pagination = { + const pagination = { base: 'newFile', extension: '.txt' }; - let itemsPerPage = { + const itemsPerPage = { five: '5', fiveValue: 5, ten: '10', @@ -49,19 +49,19 @@ describe('Trashcan - Pagination', () => { default: '25' }; - let loginPage = new LoginPage(); - let trashcanPage = new TrashcanPage(); - let paginationPage = new PaginationPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const trashcanPage = new TrashcanPage(); + const paginationPage = new PaginationPage(); + const navigationBarPage = new NavigationBarPage(); - let acsUser = new AcsUserModel(); - let newFolderModel = new FolderModel({ 'name': 'newFolder' }); - let nrOfFiles = 20; + const acsUser = new AcsUserModel(); + const newFolderModel = new FolderModel({ 'name': 'newFolder' }); + const nrOfFiles = 20; beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); - let fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension); + const fileNames = Util.generateSequenceFiles(10, nrOfFiles + 9, pagination.base, pagination.extension); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -74,9 +74,9 @@ describe('Trashcan - Pagination', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let folderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, newFolderModel.name, '-my-'); + const folderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, newFolderModel.name, '-my-'); - let emptyFiles = await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, folderUploadedModel.entry.id); + const emptyFiles = await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, folderUploadedModel.entry.id); await emptyFiles.list.entries.forEach(async (node) => { await this.alfrescoJsApi.node.deleteNode(node.entry.id).then(() => { }, () => { diff --git a/e2e/content-services/tree-view-component.e2e.ts b/e2e/content-services/tree-view-component.e2e.ts index 69298ce622..5dbdb53c7f 100644 --- a/e2e/content-services/tree-view-component.e2e.ts +++ b/e2e/content-services/tree-view-component.e2e.ts @@ -32,12 +32,12 @@ describe('Tree View Component', () => { const navigationBarPage = new NavigationBarPage(); const treeViewPage = new TreeViewPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); let treeFolder, secondTreeFolder, thirdTreeFolder; - let nodeNames = { + const nodeNames = { folder: 'Folder1', secondFolder: 'Folder2', thirdFolder: 'Folder3', diff --git a/e2e/content-services/upload/cancel-upload.e2e.ts b/e2e/content-services/upload/cancel-upload.e2e.ts index 5194952e0a..7fecda8a48 100644 --- a/e2e/content-services/upload/cancel-upload.e2e.ts +++ b/e2e/content-services/upload/cancel-upload.e2e.ts @@ -33,22 +33,22 @@ import { UploadActions } from '../../actions/ACS/upload.actions'; describe('Upload component', () => { - let contentServicesPage = new ContentServicesPage(); - let uploadDialog = new UploadDialog(); - let uploadToggles = new UploadToggles(); - let loginPage = new LoginPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const contentServicesPage = new ContentServicesPage(); + const uploadDialog = new UploadDialog(); + const uploadToggles = new UploadToggles(); + const loginPage = new LoginPage(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); - let firstPdfFileModel = new FileModel({ + const firstPdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location }); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let largeFile = new FileModel({ + const largeFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_name, 'location': resources.Files.ADF_DOCUMENTS.LARGE_FILE.file_location }); @@ -69,7 +69,7 @@ describe('Upload component', () => { contentServicesPage.goToDocumentList(); - let pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, '-my-'); + const pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, '-my-'); Object.assign(firstPdfFileModel, pdfUploadedFile.entry); @@ -81,7 +81,7 @@ describe('Upload component', () => { }); afterEach(async (done) => { - let nodesPromise = await contentServicesPage.getElementsDisplayedId(); + const nodesPromise = await contentServicesPage.getElementsDisplayedId(); nodesPromise.forEach(async (currentNode) => { if (currentNode && currentNode !== 'Node id') { diff --git a/e2e/content-services/upload/excluded-file.e2e.ts b/e2e/content-services/upload/excluded-file.e2e.ts index 596159365f..181d587dfa 100644 --- a/e2e/content-services/upload/excluded-file.e2e.ts +++ b/e2e/content-services/upload/excluded-file.e2e.ts @@ -36,30 +36,30 @@ import { ConfigEditorPage } from '../../pages/adf/configEditorPage'; describe('Upload component - Excluded Files', () => { - let contentServicesPage = new ContentServicesPage(); - let uploadDialog = new UploadDialog(); - let uploadToggles = new UploadToggles(); - let loginPage = new LoginPage(); - let acsUser = new AcsUserModel(); - let navigationBarPage = new NavigationBarPage(); - let configEditorPage = new ConfigEditorPage(); + const contentServicesPage = new ContentServicesPage(); + const uploadDialog = new UploadDialog(); + const uploadToggles = new UploadToggles(); + const loginPage = new LoginPage(); + const acsUser = new AcsUserModel(); + const navigationBarPage = new NavigationBarPage(); + const configEditorPage = new ConfigEditorPage(); - let iniExcludedFile = new FileModel({ + const iniExcludedFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.INI.file_name, 'location': resources.Files.ADF_DOCUMENTS.INI.file_location }); - let folderWithExcludedFile = new FolderModel({ + const folderWithExcludedFile = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.FOLDER_EXCLUDED.folder_name, 'location': resources.Files.ADF_DOCUMENTS.FOLDER_EXCLUDED.folder_location }); - let txtFileModel = new FileModel({ + const txtFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location }); - let pngFile = new FileModel({ + const pngFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); @@ -91,9 +91,9 @@ describe('Upload component - Excluded Files', () => { it('[C279914] Should not allow upload default excluded files using D&D', () => { contentServicesPage.checkDragAndDropDIsDisplayed(); - let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first(); + const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first(); - let dragAndDrop = new DropActions(); + const dragAndDrop = new DropActions(); dragAndDrop.dropFile(dragAndDropArea, iniExcludedFile.location); diff --git a/e2e/content-services/upload/upload-dialog.ts b/e2e/content-services/upload/upload-dialog.ts index 37737ed837..fdab497c4b 100644 --- a/e2e/content-services/upload/upload-dialog.ts +++ b/e2e/content-services/upload/upload-dialog.ts @@ -31,35 +31,35 @@ import { UploadActions } from '../../actions/ACS/upload.actions'; describe('Upload component', () => { - let contentServicesPage = new ContentServicesPage(); - let uploadDialog = new UploadDialog(); - let uploadToggles = new UploadToggles(); - let loginPage = new LoginPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const contentServicesPage = new ContentServicesPage(); + const uploadDialog = new UploadDialog(); + const uploadToggles = new UploadToggles(); + const loginPage = new LoginPage(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); - let firstPdfFileModel = new FileModel({ + const firstPdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location }); - let docxFileModel = new FileModel({ + const docxFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name, 'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location }); - let pdfFileModel = new FileModel({ + const pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location }); - let pngFileModelTwo = new FileModel({ + const pngFileModelTwo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location }); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location]; - let filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name]; + const filesLocation = [pdfFileModel.location, docxFileModel.location, pngFileModel.location, firstPdfFileModel.location]; + const filesName = [pdfFileModel.name, docxFileModel.name, pngFileModel.name, firstPdfFileModel.name]; beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ @@ -77,7 +77,7 @@ describe('Upload component', () => { contentServicesPage.goToDocumentList(); - let pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, '-my-'); + const pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, '-my-'); Object.assign(firstPdfFileModel, pdfUploadedFile.entry); @@ -89,7 +89,7 @@ describe('Upload component', () => { }); afterEach(async (done) => { - let nodesPromise = await contentServicesPage.getElementsDisplayedId(); + const nodesPromise = await contentServicesPage.getElementsDisplayedId(); nodesPromise.forEach(async (currentNodePromise) => { await currentNodePromise.then(async (currentNode) => { diff --git a/e2e/content-services/upload/uploader-component.e2e.ts b/e2e/content-services/upload/uploader-component.e2e.ts index a79d341cea..e23fb66c18 100644 --- a/e2e/content-services/upload/uploader-component.e2e.ts +++ b/e2e/content-services/upload/uploader-component.e2e.ts @@ -37,48 +37,48 @@ import { DropActions } from '../../actions/drop.actions'; describe('Upload component', () => { - let contentServicesPage = new ContentServicesPage(); - let uploadDialog = new UploadDialog(); - let uploadToggles = new UploadToggles(); - let loginPage = new LoginPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); - let navigationBarPage = new NavigationBarPage(); + const contentServicesPage = new ContentServicesPage(); + const uploadDialog = new UploadDialog(); + const uploadToggles = new UploadToggles(); + const loginPage = new LoginPage(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); + const navigationBarPage = new NavigationBarPage(); - let firstPdfFileModel = new FileModel({ + const firstPdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF_B.file_location }); - let docxFileModel = new FileModel({ + const docxFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.DOCX.file_name, 'location': resources.Files.ADF_DOCUMENTS.DOCX.file_location }); - let pdfFileModel = new FileModel({ + const pdfFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location }); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let fileWithSpecificSize = new FileModel({ + const fileWithSpecificSize = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT_400B.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT_400B.file_location }); - let emptyFile = new FileModel({ + const emptyFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location }); - let folderOne = new FolderModel({ + const folderOne = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.FOLDER_ONE.folder_name, 'location': resources.Files.ADF_DOCUMENTS.FOLDER_ONE.folder_location }); - let folderTwo = new FolderModel({ + const folderTwo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_name, 'location': resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_location }); - let uploadedFileInFolder = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_ONE.file_name }); - let uploadedFileInFolderTwo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_TWO.file_name }); + const uploadedFileInFolder = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_ONE.file_name }); + const uploadedFileInFolderTwo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.FILE_INSIDE_FOLDER_TWO.file_name }); beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ @@ -96,7 +96,7 @@ describe('Upload component', () => { contentServicesPage.goToDocumentList(); - let pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, '-my-'); + const pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, firstPdfFileModel.location, firstPdfFileModel.name, '-my-'); Object.assign(firstPdfFileModel, pdfUploadedFile.entry); @@ -349,8 +349,8 @@ describe('Upload component', () => { browser.driver.sleep(1000); uploadToggles.addExtension('.docx'); - let dragAndDrop = new DropActions(); - let dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first(); + const dragAndDrop = new DropActions(); + const dragAndDropArea = element.all(by.css('adf-upload-drag-area div')).first(); dragAndDrop.dropFile(dragAndDropArea, docxFileModel.location); contentServicesPage.checkContentIsDisplayed(docxFileModel.name); @@ -365,9 +365,9 @@ describe('Upload component', () => { }); it('[C291921] Should display tooltip for uploading files on a not found location', async () => { - let folderName = Util.generateRandomString(8); + const folderName = Util.generateRandomString(8); - let folderUploadedModel = await browser.controlFlow().execute(async () => { + const folderUploadedModel = await browser.controlFlow().execute(async () => { return await uploadActions.createFolder(this.alfrescoJsApi, folderName, '-my-'); }); diff --git a/e2e/content-services/upload/user-permission.e2e.ts b/e2e/content-services/upload/user-permission.e2e.ts index b2f651b11d..675cf5a1a9 100644 --- a/e2e/content-services/upload/user-permission.e2e.ts +++ b/e2e/content-services/upload/user-permission.e2e.ts @@ -39,31 +39,31 @@ import CONSTANTS = require('../../util/constants'); describe('Upload - User permission', () => { - let contentServicesPage = new ContentServicesPage(); - let uploadDialog = new UploadDialog(); - let uploadToggles = new UploadToggles(); - let loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const uploadDialog = new UploadDialog(); + const uploadToggles = new UploadToggles(); + const loginPage = new LoginPage(); let acsUser; let acsUserTwo; - let navigationBarPage = new NavigationBarPage(); - let notificationPage = new NotificationPage(); + const navigationBarPage = new NavigationBarPage(); + const notificationPage = new NotificationPage(); - let emptyFile = new FileModel({ + const emptyFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location }); - let pngFile = new FileModel({ + const pngFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let pdfFile = new FileModel({ + const pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'location': resources.Files.ADF_DOCUMENTS.PDF.file_location }); - let folder = new FolderModel({ + const folder = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_name, 'location': resources.Files.ADF_DOCUMENTS.FOLDER_TWO.folder_location }); @@ -134,7 +134,7 @@ describe('Upload - User permission', () => { contentServicesPage.dragAndDropFile(emptyFile.location); contentServicesPage.dragAndDropFolder(folder.location); - let fileInTheUploadedFolder = 'share_profile_pic.png'; + const fileInTheUploadedFolder = 'share_profile_pic.png'; uploadDialog.fileIsError(emptyFile.name); uploadDialog.fileIsError(fileInTheUploadedFolder); @@ -180,7 +180,7 @@ describe('Upload - User permission', () => { contentServicesPage.uploadFolder(folder.location) .checkContentIsDisplayed(folder.name); - let fileInTheUploadedFolder = 'share_profile_pic.png'; + const fileInTheUploadedFolder = 'share_profile_pic.png'; uploadDialog.fileIsUploaded(fileInTheUploadedFolder); @@ -218,7 +218,7 @@ describe('Upload - User permission', () => { contentServicesPage.dragAndDropFolder(folder.location); contentServicesPage.checkContentIsDisplayed(folder.name); - let fileInTheUploadedFolder = 'share_profile_pic.png'; + const fileInTheUploadedFolder = 'share_profile_pic.png'; uploadDialog.fileIsUploaded(emptyFile.name); uploadDialog.fileIsUploaded(fileInTheUploadedFolder); @@ -239,7 +239,7 @@ describe('Upload - User permission', () => { contentServicesPage.checkContentIsDisplayed(folder.name); }); - let fileInTheUploadedFolder = 'share_profile_pic.png'; + const fileInTheUploadedFolder = 'share_profile_pic.png'; uploadDialog.fileIsUploaded(fileInTheUploadedFolder); }); diff --git a/e2e/content-services/version/version-actions.e2e.ts b/e2e/content-services/version/version-actions.e2e.ts index 78644f1f63..77ea27701f 100644 --- a/e2e/content-services/version/version-actions.e2e.ts +++ b/e2e/content-services/version/version-actions.e2e.ts @@ -40,21 +40,21 @@ describe('Version component actions', () => { const versionManagePage = new VersionManagePage(); const navigationBarPage = new NavigationBarPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let txtFileModel = new FileModel({ + const txtFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT.file_location }); - let fileModelVersionTwo = new FileModel({ + const fileModelVersionTwo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -67,7 +67,7 @@ describe('Version component actions', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let txtUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-'); + const txtUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-'); Object.assign(txtFileModel, txtUploadedFile.entry); diff --git a/e2e/content-services/version/version-permissions.e2e.ts b/e2e/content-services/version/version-permissions.e2e.ts index dd4d6deffb..02ffce4376 100644 --- a/e2e/content-services/version/version-permissions.e2e.ts +++ b/e2e/content-services/version/version-permissions.e2e.ts @@ -47,32 +47,32 @@ describe('Version component permissions', () => { const contentServices = new ContentServicesPage(); let site; - let acsUser = new AcsUserModel(); - let consumerUser = new AcsUserModel(); - let collaboratorUser = new AcsUserModel(); - let contributorUser = new AcsUserModel(); - let managerUser = new AcsUserModel(); - let fileCreatorUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); + const consumerUser = new AcsUserModel(); + const collaboratorUser = new AcsUserModel(); + const contributorUser = new AcsUserModel(); + const managerUser = new AcsUserModel(); + const fileCreatorUser = new AcsUserModel(); - let newVersionFile = new FileModel({ + const newVersionFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location }); - let lockFileModel = new FileModel({ + const lockFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_C.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_C.file_location }); - let differentCreatorFile = new FileModel({ + const differentCreatorFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_D.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_D.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); - let nodeActions = new NodeActions(); + const uploadActions = new UploadActions(); + const nodeActions = new NodeActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -118,7 +118,7 @@ describe('Version component permissions', () => { role: CONSTANTS.CS_USER_ROLES.MANAGER }); - let lockFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, lockFileModel.location, lockFileModel.name, site.entry.guid); + const lockFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, lockFileModel.location, lockFileModel.name, site.entry.guid); Object.assign(lockFileModel, lockFileUploaded.entry); nodeActions.lockNode(this.alfrescoJsApi, lockFileModel.id); @@ -132,17 +132,17 @@ describe('Version component permissions', () => { describe('Manager', () => { - let sameCreatorFile = new FileModel({ + const sameCreatorFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); await this.alfrescoJsApi.login(managerUser.id, managerUser.password); - let sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid); + const sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid); Object.assign(sameCreatorFile, sameCreatorFileUploaded.entry); loginPage.loginToContentServicesUsingUserModel(managerUser); @@ -239,17 +239,17 @@ describe('Version component permissions', () => { }); describe('Contributor', () => { - let sameCreatorFile = new FileModel({ + const sameCreatorFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); await this.alfrescoJsApi.login(contributorUser.id, contributorUser.password); - let sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid); + const sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid); Object.assign(sameCreatorFile, sameCreatorFileUploaded.entry); loginPage.loginToContentServicesUsingUserModel(contributorUser); @@ -299,17 +299,17 @@ describe('Version component permissions', () => { }); describe('Collaborator', () => { - let sameCreatorFile = new FileModel({ + const sameCreatorFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); await this.alfrescoJsApi.login(collaboratorUser.id, collaboratorUser.password); - let sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid); + const sameCreatorFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, sameCreatorFile.location, sameCreatorFile.name, site.entry.guid); Object.assign(sameCreatorFile, sameCreatorFileUploaded.entry); loginPage.loginToContentServicesUsingUserModel(collaboratorUser); diff --git a/e2e/content-services/version/version-properties.e2e.ts b/e2e/content-services/version/version-properties.e2e.ts index f649a73173..db897c9a20 100644 --- a/e2e/content-services/version/version-properties.e2e.ts +++ b/e2e/content-services/version/version-properties.e2e.ts @@ -39,21 +39,21 @@ describe('Version Properties', () => { const versionManagePage = new VersionManagePage(); const navigationBarPage = new NavigationBarPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let txtFileModel = new FileModel({ + const txtFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT_0B.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location }); - let fileModelVersionTwo = new FileModel({ + const fileModelVersionTwo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -66,7 +66,7 @@ describe('Version Properties', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let txtUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-'); + const txtUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, txtFileModel.location, txtFileModel.name, '-my-'); Object.assign(txtFileModel, txtUploadedFile.entry); diff --git a/e2e/content-services/version/version-smoke-tests.e2e.ts b/e2e/content-services/version/version-smoke-tests.e2e.ts index 49af53ec45..188c4d2d85 100644 --- a/e2e/content-services/version/version-smoke-tests.e2e.ts +++ b/e2e/content-services/version/version-smoke-tests.e2e.ts @@ -40,36 +40,36 @@ describe('Version component', () => { const navigationBarPage = new NavigationBarPage(); const versionManagePage = new VersionManagePage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let txtFileModel = new FileModel({ + const txtFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT.file_location }); - let fileModelVersionTwo = new FileModel({ + const fileModelVersionTwo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let fileModelVersionThree = new FileModel({ + const fileModelVersionThree = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_B.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_B.file_location }); - let fileModelVersionFor = new FileModel({ + const fileModelVersionFor = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_C.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_C.file_location }); - let fileModelVersionFive = new FileModel({ + const fileModelVersionFive = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG_D.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG_D.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', diff --git a/e2e/core/card-view/aspect-oriented-config.e2e.ts b/e2e/core/card-view/aspect-oriented-config.e2e.ts index 1ed8740e8e..83ab506542 100644 --- a/e2e/core/card-view/aspect-oriented-config.e2e.ts +++ b/e2e/core/card-view/aspect-oriented-config.e2e.ts @@ -41,20 +41,20 @@ describe('Aspect oriented config', () => { const metadataViewPage = new MetadataViewPage(); const navigationBarPage = new NavigationBarPage(); const configEditorPage = new ConfigEditorPage(); - let contentServicesPage = new ContentServicesPage(); - let modelOneName = 'modelOne', emptyAspectName = 'emptyAspect'; - let defaultModel = 'cm', defaultEmptyPropertiesAspect = 'taggable', aspectName = 'Taggable'; + const contentServicesPage = new ContentServicesPage(); + const modelOneName = 'modelOne', emptyAspectName = 'emptyAspect'; + const defaultModel = 'cm', defaultEmptyPropertiesAspect = 'taggable', aspectName = 'Taggable'; - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -77,11 +77,11 @@ describe('Aspect oriented config', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let uploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); + const uploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); loginPage.loginToContentServicesUsingUserModel(acsUser); - let aspects = await this.alfrescoJsApi.core.nodesApi.getNode(uploadedFile.entry.id); + const aspects = await this.alfrescoJsApi.core.nodesApi.getNode(uploadedFile.entry.id); aspects.entry.aspectNames.push(modelOneName.concat(':', emptyAspectName)); diff --git a/e2e/core/card-view/card-view-component.e2e.ts b/e2e/core/card-view/card-view-component.e2e.ts index 6c246f5ced..8524558eff 100644 --- a/e2e/core/card-view/card-view-component.e2e.ts +++ b/e2e/core/card-view/card-view-component.e2e.ts @@ -45,7 +45,7 @@ describe('CardView Component', () => { describe('key-value pair ', () => { it('[C279938] Should the label be present', () => { - let label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]')); + const label = element(by.css('div[data-automation-id="card-key-value-pairs-label-key-value-pairs"]')); Util.waitUntilElementIsPresent(label); }); @@ -67,7 +67,7 @@ describe('CardView Component', () => { describe('SelectBox', () => { it('[C279939] Should the label be present', () => { - let label = element(by.css('div[data-automation-id="card-select-label-select"]')); + const label = element(by.css('div[data-automation-id="card-select-label-select"]')); Util.waitUntilElementIsPresent(label); }); @@ -84,7 +84,7 @@ describe('CardView Component', () => { describe('Text', () => { it('[C279937] Should the label be present', () => { - let label = element(by.css('div[data-automation-id="card-textitem-label-name"]')); + const label = element(by.css('div[data-automation-id="card-textitem-label-name"]')); Util.waitUntilElementIsPresent(label); }); @@ -115,7 +115,7 @@ describe('CardView Component', () => { describe('Int', () => { it('[C279940] Should the label be present', () => { - let label = element(by.css('div[data-automation-id="card-textitem-label-int"]')); + const label = element(by.css('div[data-automation-id="card-textitem-label-int"]')); Util.waitUntilElementIsPresent(label); }); @@ -189,7 +189,7 @@ describe('CardView Component', () => { describe('Float', () => { it('[C279941] Should the label be present', () => { - let label = element(by.css('div[data-automation-id="card-textitem-label-float"]')); + const label = element(by.css('div[data-automation-id="card-textitem-label-float"]')); Util.waitUntilElementIsPresent(label); }); @@ -239,7 +239,7 @@ describe('CardView Component', () => { describe('Boolean', () => { it('[C279942] Should the label be present', () => { - let label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]')); + const label = element(by.css('div[data-automation-id="card-boolean-label-boolean"]')); Util.waitUntilElementIsPresent(label); }); @@ -258,11 +258,11 @@ describe('CardView Component', () => { describe('Date and DateTime', () => { it('[C279961] Should the label be present', () => { - let labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]')); + const labelDate = element(by.css('div[data-automation-id="card-dateitem-label-date"]')); Util.waitUntilElementIsPresent(labelDate); - let labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]')); + const labelDatetime = element(by.css('div[data-automation-id="card-dateitem-label-datetime"]')); Util.waitUntilElementIsPresent(labelDatetime); }); @@ -277,11 +277,11 @@ describe('CardView Component', () => { it('[C279936] Should not be possible edit any parameter when editable property is false', () => { cardViewPageComponent.disableEdit(); - let editIconText = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-name"]')); - let editIconInt = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-int"]')); - let editIconFloat = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-float"]')); - let editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]')); - let editIconData = element(by.css('mat-datetimepicker-toggle')); + const editIconText = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-name"]')); + const editIconInt = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-int"]')); + const editIconFloat = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-float"]')); + const editIconKey = element(by.css('mat-icon[data-automation-id="card-key-value-pairs-button-key-value-pairs"]')); + const editIconData = element(by.css('mat-datetimepicker-toggle')); Util.waitUntilElementIsNotVisible(editIconText); Util.waitUntilElementIsNotVisible(editIconInt); diff --git a/e2e/core/card-view/metadata-permissions.e2e.ts b/e2e/core/card-view/metadata-permissions.e2e.ts index ff95461dd5..b688e7899d 100644 --- a/e2e/core/card-view/metadata-permissions.e2e.ts +++ b/e2e/core/card-view/metadata-permissions.e2e.ts @@ -52,19 +52,19 @@ describe('permissions', () => { const metadataViewPage = new MetadataViewPage(); const navigationBarPage = new NavigationBarPage(); - let consumerUser = new AcsUserModel(); - let collaboratorUser = new AcsUserModel(); - let contributorUser = new AcsUserModel(); + const consumerUser = new AcsUserModel(); + const collaboratorUser = new AcsUserModel(); + const contributorUser = new AcsUserModel(); let site; - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', diff --git a/e2e/core/card-view/metadata-properties.e2e.ts b/e2e/core/card-view/metadata-properties.e2e.ts index b087b87a30..abd670ce0d 100644 --- a/e2e/core/card-view/metadata-properties.e2e.ts +++ b/e2e/core/card-view/metadata-properties.e2e.ts @@ -33,7 +33,7 @@ import { ContentServicesPage } from '../../pages/adf/contentServicesPage'; describe('CardView Component - properties', () => { - let METADATA = { + const METADATA = { DATA_FORMAT: 'mmm dd yyyy', TITLE: 'Details', COMMENTS_TAB: 'COMMENTS', @@ -46,22 +46,22 @@ describe('CardView Component - properties', () => { EDIT_BUTTON_TOOLTIP: 'Edit' }; - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let viewerPage = new ViewerPage(); - let metadataViewPage = new MetadataViewPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const viewerPage = new ViewerPage(); + const metadataViewPage = new MetadataViewPage(); const contentServicesPage = new ContentServicesPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -74,7 +74,7 @@ describe('CardView Component - properties', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); + const pdfUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); Object.assign(pngFileModel, pdfUploadedFile.entry); diff --git a/e2e/core/card-view/metadata-smoke-tests.e2e.ts b/e2e/core/card-view/metadata-smoke-tests.e2e.ts index 623ce61199..5a1fee3d40 100644 --- a/e2e/core/card-view/metadata-smoke-tests.e2e.ts +++ b/e2e/core/card-view/metadata-smoke-tests.e2e.ts @@ -54,16 +54,16 @@ describe('Metadata component', () => { const metadataViewPage = new MetadataViewPage(); const navigationBarPage = new NavigationBarPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let folderName = 'Metadata Folder'; + const folderName = 'Metadata Folder'; - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); let fileUrl; @@ -80,7 +80,7 @@ describe('Metadata component', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); + const pngUploadedFile = await uploadActions.uploadFile(this.alfrescoJsApi, pngFileModel.location, pngFileModel.name, '-my-'); Object.assign(pngFileModel, pngUploadedFile.entry); diff --git a/e2e/core/datatable/data-table-component-selection.e2e.ts b/e2e/core/datatable/data-table-component-selection.e2e.ts index 5cf971315a..6539cfd321 100644 --- a/e2e/core/datatable/data-table-component-selection.e2e.ts +++ b/e2e/core/datatable/data-table-component-selection.e2e.ts @@ -26,11 +26,11 @@ import { NavigationBarPage } from '../../pages/adf/navigationBarPage'; describe('Datatable component - selection', () => { - let dataTablePage = new DataTablePage(); - let loginPage = new LoginPage(); - let acsUser = new AcsUserModel(); - let navigationBarPage = new NavigationBarPage(); - let dataTableComponent = new DataTableComponentPage(); + const dataTablePage = new DataTablePage(); + const loginPage = new LoginPage(); + const acsUser = new AcsUserModel(); + const navigationBarPage = new NavigationBarPage(); + const dataTableComponent = new DataTableComponentPage(); beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ diff --git a/e2e/core/error-component.e2e.ts b/e2e/core/error-component.e2e.ts index d2782b176e..d17f7d4f54 100644 --- a/e2e/core/error-component.e2e.ts +++ b/e2e/core/error-component.e2e.ts @@ -24,9 +24,9 @@ import { browser } from '../../node_modules/protractor'; describe('Error Component', () => { - let acsUser = new AcsUserModel(); - let loginPage = new LoginPage(); - let errorPage = new ErrorPage(); + const acsUser = new AcsUserModel(); + const loginPage = new LoginPage(); + const errorPage = new ErrorPage(); beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ diff --git a/e2e/core/header-component.e2e.ts b/e2e/core/header-component.e2e.ts index bd3df3c73b..33078d107b 100644 --- a/e2e/core/header-component.e2e.ts +++ b/e2e/core/header-component.e2e.ts @@ -26,14 +26,14 @@ import { UsersActions } from '../actions/users.actions'; describe('Header Component', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let headerPage = new HeaderPage(); - let settingsPage = new SettingsPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const headerPage = new HeaderPage(); + const settingsPage = new SettingsPage(); let user, tenantId; - let names = { + const names = { app_title_default: 'ADF Demo Application', app_title_custom: 'New Test App', urlPath_default: './assets/images/logo.png', @@ -53,7 +53,7 @@ describe('Header Component', () => { hostBpm: TestConfig.adf.url }); - let users = new UsersActions(); + const users = new UsersActions(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); diff --git a/e2e/core/icons-component.e2e.ts b/e2e/core/icons-component.e2e.ts index 07a655d3ef..ba2cdfe174 100644 --- a/e2e/core/icons-component.e2e.ts +++ b/e2e/core/icons-component.e2e.ts @@ -25,10 +25,10 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api'; describe('Universal Icon component', function () { - let loginPage = new LoginPage(); - let acsUser = new AcsUserModel(); - let navigationBarPage = new NavigationBarPage(); - let iconsPage = new IconsPage(); + const loginPage = new LoginPage(); + const acsUser = new AcsUserModel(); + const navigationBarPage = new NavigationBarPage(); + const iconsPage = new IconsPage(); beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ diff --git a/e2e/core/infinite-scrolling.e2e.ts b/e2e/core/infinite-scrolling.e2e.ts index 3aacd5769f..c7417189d4 100644 --- a/e2e/core/infinite-scrolling.e2e.ts +++ b/e2e/core/infinite-scrolling.e2e.ts @@ -38,21 +38,24 @@ describe('Enable infinite scrolling', () => { const configEditorPage = new ConfigEditorPage(); const navigationBarPage = new NavigationBarPage(); - let acsUser = new AcsUserModel(); - let folderModel = new FolderModel({ 'name': 'folderOne' }); + const acsUser = new AcsUserModel(); + const folderModel = new FolderModel({ 'name': 'folderOne' }); - let fileNames = [], nrOfFiles = 30, deleteFileNames = [], nrOfDeletedFiles = 22; + let fileNames = []; + const nrOfFiles = 30; + let deleteFileNames = []; + const nrOfDeletedFiles = 22; let deleteUploaded; - let pageSize = 20; + const pageSize = 20; let emptyFolderModel; - let files = { + const files = { base: 'newFile', extension: '.txt' }; beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -70,7 +73,7 @@ describe('Enable infinite scrolling', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let folderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, folderModel.name, '-my-'); + const folderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, folderModel.name, '-my-'); emptyFolderModel = await uploadActions.createFolder(this.alfrescoJsApi, 'emptyFolder', '-my-'); await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, folderUploadedModel.entry.id); diff --git a/e2e/core/login/login-component.e2e.ts b/e2e/core/login/login-component.e2e.ts index 226ab74a62..21dc1db9a4 100644 --- a/e2e/core/login/login-component.e2e.ts +++ b/e2e/core/login/login-component.e2e.ts @@ -35,29 +35,29 @@ import { ErrorPage } from '../../pages/adf/errorPage'; describe('Login component', () => { - let settingsPage = new SettingsPage(); - let processServicesPage = new ProcessServicesPage(); - let navigationBarPage = new NavigationBarPage(); - let userInfoPage = new UserInfoPage(); - let contentServicesPage = new ContentServicesPage(); - let loginPage = new LoginPage(); - let errorPage = new ErrorPage(); - let adminUserModel = new AcsUserModel({ + const settingsPage = new SettingsPage(); + const processServicesPage = new ProcessServicesPage(); + const navigationBarPage = new NavigationBarPage(); + const userInfoPage = new UserInfoPage(); + const contentServicesPage = new ContentServicesPage(); + const loginPage = new LoginPage(); + const errorPage = new ErrorPage(); + const adminUserModel = new AcsUserModel({ 'id': TestConfig.adf.adminUser, 'password': TestConfig.adf.adminPassword }); - let userA = new AcsUserModel(); - let userB = new AcsUserModel(); + const userA = new AcsUserModel(); + const userB = new AcsUserModel(); - let errorMessages = { + const errorMessages = { username: 'Your username needs to be at least 2 characters.', invalid_credentials: 'You\'ve entered an unknown username or password', password: 'Enter your password to sign in', required: 'Required' }; - let invalidUsername = 'invaliduser'; - let invalidPassword = 'invalidpassword'; + const invalidUsername = 'invaliduser'; + const invalidPassword = 'invalidpassword'; beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ diff --git a/e2e/core/login/login-sso/login-sso.e2e.ts b/e2e/core/login/login-sso/login-sso.e2e.ts index 5d7a3a7466..3d7a1c6da7 100644 --- a/e2e/core/login/login-sso/login-sso.e2e.ts +++ b/e2e/core/login/login-sso/login-sso.e2e.ts @@ -28,7 +28,9 @@ describe('Login component - SSO', () => { const loginApsPage = new LoginSSOPage(); const loginPage = new LoginPage(); const navigationBarPage = new NavigationBarPage(); - let silentLogin, implicitFlow; + + const silentLogin = false; + let implicitFlow; describe('Login component - SSO implicit Flow', () => { diff --git a/e2e/core/login/redirection.e2e.ts b/e2e/core/login/redirection.e2e.ts index 3f464b445a..f5d51f0250 100644 --- a/e2e/core/login/redirection.e2e.ts +++ b/e2e/core/login/redirection.e2e.ts @@ -35,19 +35,19 @@ import { LogoutPage } from '../../pages/adf/demo-shell/logoutPage'; describe('Login component - Redirect', () => { - let settingsPage = new SettingsPage(); - let processServicesPage = new ProcessServicesPage(); - let navigationBarPage = new NavigationBarPage(); - let contentServicesPage = new ContentServicesPage(); - let loginPage = new LoginPage(); - let user = new AcsUserModel(); - let userFolderOwner = new AcsUserModel(); - let adminUserModel = new AcsUserModel({ + const settingsPage = new SettingsPage(); + const processServicesPage = new ProcessServicesPage(); + const navigationBarPage = new NavigationBarPage(); + const contentServicesPage = new ContentServicesPage(); + const loginPage = new LoginPage(); + const user = new AcsUserModel(); + const userFolderOwner = new AcsUserModel(); + const adminUserModel = new AcsUserModel({ 'id': TestConfig.adf.adminUser, 'password': TestConfig.adf.adminPassword }); let uploadedFolder; - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); const logoutPage = new LogoutPage(); beforeAll(async (done) => { diff --git a/e2e/core/login/remember-me.e2e.ts b/e2e/core/login/remember-me.e2e.ts index a72ab2335e..135e16de50 100644 --- a/e2e/core/login/remember-me.e2e.ts +++ b/e2e/core/login/remember-me.e2e.ts @@ -20,8 +20,8 @@ import { SettingsPage } from '../../pages/adf/settingsPage'; describe('Login component - Remember Me', () => { - let settingsPage = new SettingsPage(); - let loginPage = new LoginPage(); + const settingsPage = new SettingsPage(); + const loginPage = new LoginPage(); beforeAll((done) => { settingsPage.setProviderEcmBpm(); diff --git a/e2e/core/pagination-empty-current-page.e2e.ts b/e2e/core/pagination-empty-current-page.e2e.ts index ec2622d02e..a9169c2685 100644 --- a/e2e/core/pagination-empty-current-page.e2e.ts +++ b/e2e/core/pagination-empty-current-page.e2e.ts @@ -33,36 +33,40 @@ import TestConfig = require('../test.config'); describe('Pagination - returns to previous page when current is empty', () => { - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let paginationPage = new PaginationPage(); - let viewerPage = new ViewerPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const paginationPage = new PaginationPage(); + const viewerPage = new ViewerPage(); - let acsUser = new AcsUserModel(); - let folderModel = new FolderModel({ 'name': 'folderOne' }); - let parentFolderModel = new FolderModel({ 'name': 'parentFolder' }); + const acsUser = new AcsUserModel(); + const folderModel = new FolderModel({ 'name': 'folderOne' }); + const parentFolderModel = new FolderModel({ 'name': 'parentFolder' }); - let fileNames = [], nrOfFiles = 6, nrOfFolders = 5; - let lastFile = 'newFile6.txt', lastFolderResponse, pngFileUploaded; - let folderNames = ['t1', 't2', 't3', 't4', 't5', 't6']; + let fileNames = []; + const nrOfFiles = 6; + const nrOfFolders = 5; + const lastFile = 'newFile6.txt'; + let lastFolderResponse; + let pngFileUploaded; + const folderNames = ['t1', 't2', 't3', 't4', 't5', 't6']; - let itemsPerPage = { + const itemsPerPage = { five: '5', fiveValue: 5 }; - let files = { + const files = { base: 'newFile', extension: '.txt' }; - let pngFileInfo = new FileModel({ + const pngFileInfo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -77,9 +81,9 @@ describe('Pagination - returns to previous page when current is empty', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let folderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, folderModel.name, '-my-'); + const folderUploadedModel = await uploadActions.createFolder(this.alfrescoJsApi, folderModel.name, '-my-'); - let parentFolderResponse = await uploadActions.createFolder(this.alfrescoJsApi, parentFolderModel.name, '-my-'); + const parentFolderResponse = await uploadActions.createFolder(this.alfrescoJsApi, parentFolderModel.name, '-my-'); for (let i = 0; i < nrOfFolders; i++) { await uploadActions.createFolder(this.alfrescoJsApi, folderNames[i], parentFolderResponse.entry.id); diff --git a/e2e/core/settings-component.e2e.ts b/e2e/core/settings-component.e2e.ts index 0f9897353d..ecbd392e4b 100644 --- a/e2e/core/settings-component.e2e.ts +++ b/e2e/core/settings-component.e2e.ts @@ -34,7 +34,7 @@ describe('Settings component', () => { const loginError = 'Request has been terminated ' + 'Possible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.'; - let adminUserModel = new AcsUserModel({ + const adminUserModel = new AcsUserModel({ 'id': TestConfig.adf.adminUser, 'password': TestConfig.adf.adminPassword }); diff --git a/e2e/core/user-info-component.e2e.ts b/e2e/core/user-info-component.e2e.ts index 619e1056c7..0dd4243b27 100644 --- a/e2e/core/user-info-component.e2e.ts +++ b/e2e/core/user-info-component.e2e.ts @@ -33,21 +33,21 @@ import { browser } from 'protractor'; describe('User Info component', () => { - let settingsPage = new SettingsPage(); - let loginPage = new LoginPage(); - let userInfoPage = new UserInfoPage(); + const settingsPage = new SettingsPage(); + const loginPage = new LoginPage(); + const userInfoPage = new UserInfoPage(); let processUserModel, contentUserModel; - let acsAvatarFileModel = new FileModel({ + const acsAvatarFileModel = new FileModel({ 'name': resources.Files.PROFILE_IMAGES.ECM.file_name, 'location': resources.Files.PROFILE_IMAGES.ECM.file_location }); - let apsAvatarFileModel = new FileModel({ + const apsAvatarFileModel = new FileModel({ 'name': resources.Files.PROFILE_IMAGES.BPM.file_name, 'location': resources.Files.PROFILE_IMAGES.BPM.file_location }); beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ALL', @@ -166,7 +166,7 @@ describe('User Info component', () => { }); it('[C260118] Should display UserInfo with profile image uploaded in APS', async () => { - let users = new UsersActions(); + const users = new UsersActions(); await this.alfrescoJsApi.login(contentUserModel.email, contentUserModel.password); await users.changeProfilePictureAps(this.alfrescoJsApi, apsAvatarFileModel.getLocation()); diff --git a/e2e/core/viewer/viewer-component.e2e.ts b/e2e/core/viewer/viewer-component.e2e.ts index 8f6c4eb104..be020f6a3c 100644 --- a/e2e/core/viewer/viewer-component.e2e.ts +++ b/e2e/core/viewer/viewer-component.e2e.ts @@ -38,59 +38,59 @@ import { browser } from 'protractor'; xdescribe('Viewer', () => { - let viewerPage = new ViewerPage(); - let navigationBarPage = new NavigationBarPage(); - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let uploadActions = new UploadActions(); + const viewerPage = new ViewerPage(); + const navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const uploadActions = new UploadActions(); let site; - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); let pngFileUploaded; const contentList = contentServicesPage.getDocumentList(); const shareDialog = new ShareDialog(); const about = new AboutPage(); - let pngFileInfo = new FileModel({ + const pngFileInfo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let archiveFolderInfo = new FolderModel({ + const archiveFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.ARCHIVE_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.ARCHIVE_FOLDER.folder_location }); - let excelFolderInfo = new FolderModel({ + const excelFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.EXCEL_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.EXCEL_FOLDER.folder_location }); - let otherFolderInfo = new FolderModel({ + const otherFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.OTHER_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.OTHER_FOLDER.folder_location }); - let pptFolderInfo = new FolderModel({ + const pptFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.PPT_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.PPT_FOLDER.folder_location }); - let textFolderInfo = new FolderModel({ + const textFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.TEXT_FOLDER.folder_location }); - let wordFolderInfo = new FolderModel({ + const wordFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.WORD_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.WORD_FOLDER.folder_location }); - let imgFolderInfo = new FolderModel({ + const imgFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.IMG_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.IMG_FOLDER.folder_location }); - let imgRenditionFolderInfo = new FolderModel({ + const imgRenditionFolderInfo = new FolderModel({ 'name': resources.Files.ADF_DOCUMENTS.IMG_RENDITION_FOLDER.folder_name, 'location': resources.Files.ADF_DOCUMENTS.IMG_RENDITION_FOLDER.folder_location }); @@ -394,7 +394,7 @@ xdescribe('Viewer', () => { describe('Display files via API', () => { - let wordFileInfo = new FileModel({ + const wordFileInfo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.DOCX_SUPPORTED.file_name, 'location': resources.Files.ADF_DOCUMENTS.DOCX_SUPPORTED.file_location }); @@ -439,7 +439,7 @@ xdescribe('Viewer', () => { shareDialog.checkDialogIsDisplayed(); shareDialog.clickShareLinkButton(); browser.controlFlow().execute(async () => { - let sharedLink = await shareDialog.getShareLink(); + const sharedLink = await shareDialog.getShareLink(); await browser.get(sharedLink); viewerPage.checkFileIsLoaded(); @@ -456,7 +456,7 @@ xdescribe('Viewer', () => { describe('Viewer - Code editor extension', () => { - let jsFileInfo = new FileModel({ + const jsFileInfo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.JS.file_name, 'location': resources.Files.ADF_DOCUMENTS.JS.file_location }); diff --git a/e2e/core/viewer/viewer-content-services-component.e2e.ts b/e2e/core/viewer/viewer-content-services-component.e2e.ts index e3b65f7d28..72c60c4f76 100644 --- a/e2e/core/viewer/viewer-content-services-component.e2e.ts +++ b/e2e/core/viewer/viewer-content-services-component.e2e.ts @@ -33,19 +33,19 @@ import { UploadActions } from '../../actions/ACS/upload.actions'; describe('Content Services Viewer', () => { - let acsUser = new AcsUserModel(); - let viewerPage = new ViewerPage(); - let contentServicesPage = new ContentServicesPage(); - let loginPage = new LoginPage(); + const acsUser = new AcsUserModel(); + const viewerPage = new ViewerPage(); + const contentServicesPage = new ContentServicesPage(); + const loginPage = new LoginPage(); let zoom; - let pdfFile = new FileModel({ + const pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name, 'firstPageText': resources.Files.ADF_DOCUMENTS.PDF.first_page_text, 'secondPageText': resources.Files.ADF_DOCUMENTS.PDF.second_page_text, 'lastPageNumber': resources.Files.ADF_DOCUMENTS.PDF.last_page_number }); - let protectedFile = new FileModel({ + const protectedFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF_PROTECTED.file_name, 'firstPageText': resources.Files.ADF_DOCUMENTS.PDF_PROTECTED.first_page_text, 'secondPageText': resources.Files.ADF_DOCUMENTS.PDF_PROTECTED.second_page_text, @@ -53,31 +53,31 @@ describe('Content Services Viewer', () => { 'password': resources.Files.ADF_DOCUMENTS.PDF_PROTECTED.password, 'location': resources.Files.ADF_DOCUMENTS.PDF_PROTECTED.file_location }); - let docxFile = new FileModel({ + const docxFile = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.DOCX_SUPPORTED.file_location, 'name': resources.Files.ADF_DOCUMENTS.DOCX_SUPPORTED.file_name, 'firstPageText': resources.Files.ADF_DOCUMENTS.DOCX_SUPPORTED.first_page_text }); - let jpgFile = new FileModel({ + const jpgFile = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.JPG.file_location, 'name': resources.Files.ADF_DOCUMENTS.JPG.file_name }); - let mp4File = new FileModel({ + const mp4File = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.MP4.file_location, 'name': resources.Files.ADF_DOCUMENTS.MP4.file_name }); - let unsupportedFile = new FileModel({ + const unsupportedFile = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.UNSUPPORTED.file_location, 'name': resources.Files.ADF_DOCUMENTS.UNSUPPORTED.file_name }); - let pptFile = new FileModel({ + const pptFile = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.PPT.file_location, 'name': resources.Files.ADF_DOCUMENTS.PPT.file_name, 'firstPageText': resources.Files.ADF_DOCUMENTS.PPT.first_page_text }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -90,25 +90,25 @@ describe('Content Services Viewer', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let pdfFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, '-my-'); + const pdfFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pdfFile.location, pdfFile.name, '-my-'); Object.assign(pdfFile, pdfFileUploaded.entry); - let protectedFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, protectedFile.location, protectedFile.name, '-my-'); + const protectedFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, protectedFile.location, protectedFile.name, '-my-'); Object.assign(protectedFile, protectedFileUploaded.entry); - let docxFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, docxFile.location, docxFile.name, '-my-'); + const docxFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, docxFile.location, docxFile.name, '-my-'); Object.assign(docxFile, docxFileUploaded.entry); - let jpgFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, jpgFile.location, jpgFile.name, '-my-'); + const jpgFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, jpgFile.location, jpgFile.name, '-my-'); Object.assign(jpgFile, jpgFileUploaded.entry); - let mp4FileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, mp4File.location, mp4File.name, '-my-'); + const mp4FileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, mp4File.location, mp4File.name, '-my-'); Object.assign(mp4File, mp4FileUploaded.entry); - let pptFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pptFile.location, pptFile.name, '-my-'); + const pptFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, pptFile.location, pptFile.name, '-my-'); Object.assign(pptFile, pptFileUploaded.entry); - let unsupportedFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, unsupportedFile.location, unsupportedFile.name, '-my-'); + const unsupportedFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, unsupportedFile.location, unsupportedFile.name, '-my-'); Object.assign(unsupportedFile, unsupportedFileUploaded.entry); loginPage.loginToContentServicesUsingUserModel(acsUser); @@ -119,7 +119,7 @@ describe('Content Services Viewer', () => { }); afterAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pdfFile.getId()); await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, protectedFile.getId()); diff --git a/e2e/core/viewer/viewer-custom-toolbar-info-drawer.e2e.ts b/e2e/core/viewer/viewer-custom-toolbar-info-drawer.e2e.ts index 99fb46e612..08f1dcb524 100644 --- a/e2e/core/viewer/viewer-custom-toolbar-info-drawer.e2e.ts +++ b/e2e/core/viewer/viewer-custom-toolbar-info-drawer.e2e.ts @@ -31,14 +31,14 @@ import { UploadActions } from '../../actions/ACS/upload.actions'; describe('Viewer', () => { - let viewerPage = new ViewerPage(); - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let uploadActions = new UploadActions(); - let acsUser = new AcsUserModel(); + const viewerPage = new ViewerPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const uploadActions = new UploadActions(); + const acsUser = new AcsUserModel(); let txtFileUploaded; - let txtFileInfo = new FileModel({ + const txtFileInfo = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.TXT.file_name, 'location': resources.Files.ADF_DOCUMENTS.TXT.file_location }); diff --git a/e2e/core/viewer/viewer-properties.e2e.ts b/e2e/core/viewer/viewer-properties.e2e.ts index ebfca1aa6b..3ffe8a94e3 100644 --- a/e2e/core/viewer/viewer-properties.e2e.ts +++ b/e2e/core/viewer/viewer-properties.e2e.ts @@ -33,25 +33,25 @@ import { UploadActions } from '../../actions/ACS/upload.actions'; describe('Viewer - properties', () => { - let acsUser = new AcsUserModel(); - let viewerPage = new ViewerPage(); - let contentServicesPage = new ContentServicesPage(); - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let dataTable = new DataTableComponentPage(); + const acsUser = new AcsUserModel(); + const viewerPage = new ViewerPage(); + const contentServicesPage = new ContentServicesPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const dataTable = new DataTableComponentPage(); - let pngFile = new FileModel({ + const pngFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let fileForOverlay = new FileModel({ + const fileForOverlay = new FileModel({ 'name': 'fileForOverlay.png', 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); beforeAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -85,7 +85,7 @@ describe('Viewer - properties', () => { }); afterAll(async (done) => { - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); await uploadActions.deleteFilesOrFolder(this.alfrescoJsApi, pngFile.getId()); diff --git a/e2e/insights/analytics-component.e2e.ts b/e2e/insights/analytics-component.e2e.ts index 047eab0933..41c775ff5e 100644 --- a/e2e/insights/analytics-component.e2e.ts +++ b/e2e/insights/analytics-component.e2e.ts @@ -28,13 +28,13 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api'; describe('Analytics Smoke Test', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let appNavigationBarPage = new AppNavigationBarPage(); - let analyticsPage = new AnalyticsPage(); - let processServicesPage = new ProcessServicesPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const appNavigationBarPage = new AppNavigationBarPage(); + const analyticsPage = new AnalyticsPage(); + const processServicesPage = new ProcessServicesPage(); let tenantId; - let reportTitle = 'New Title'; + const reportTitle = 'New Title'; beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ @@ -44,10 +44,10 @@ describe('Analytics Smoke Test', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); tenantId = newTenant.id; - let procUserModel = new User({ tenantId: tenantId }); + const procUserModel = new User({ tenantId: tenantId }); await this.alfrescoJsApi.activiti.adminUsersApi.createNewUser(procUserModel); diff --git a/e2e/models/ACS/fileModel.ts b/e2e/models/ACS/fileModel.ts index fe826a127f..6dbe3f1914 100644 --- a/e2e/models/ACS/fileModel.ts +++ b/e2e/models/ACS/fileModel.ts @@ -53,8 +53,8 @@ export class FileModel { } getVersionName() { - let extension = this.name.split('.')[1]; - let name = this.name.split('.')[0]; + const extension = this.name.split('.')[1]; + const name = this.name.split('.')[0]; return name + this.version + '.' + extension; } diff --git a/e2e/pages/adf/cardViewComponentPage.ts b/e2e/pages/adf/cardViewComponentPage.ts index f4c690ec89..4e64f48d32 100644 --- a/e2e/pages/adf/cardViewComponentPage.ts +++ b/e2e/pages/adf/cardViewComponentPage.ts @@ -50,7 +50,7 @@ export class CardViewComponentPage { } clickOnTextField() { - let toggleText = element(by.css(`div[data-automation-id='card-textitem-edit-toggle-name']`)); + const toggleText = element(by.css(`div[data-automation-id='card-textitem-edit-toggle-name']`)); Util.waitUntilElementIsVisible(toggleText); toggleText.click(); Util.waitUntilElementIsVisible(this.textField); @@ -58,19 +58,19 @@ export class CardViewComponentPage { } clickOnTextClearIcon() { - let clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-name"]`)); + const clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-name"]`)); Util.waitUntilElementIsVisible(clearIcon); return clearIcon.click(); } clickOnTextSaveIcon() { - let saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-name"]`)); + const saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-name"]`)); Util.waitUntilElementIsVisible(saveIcon); return saveIcon.click(); } getTextFieldText() { - let textField = element(by.css(`span[data-automation-id="card-textitem-value-name"]`)); + const textField = element(by.css(`span[data-automation-id="card-textitem-value-name"]`)); Util.waitUntilElementIsVisible(textField); return textField.getText(); } @@ -84,7 +84,7 @@ export class CardViewComponentPage { } clickOnIntField() { - let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]')); + const toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-int"]')); Util.waitUntilElementIsVisible(toggleText); toggleText.click(); Util.waitUntilElementIsVisible(this.intField); @@ -92,13 +92,13 @@ export class CardViewComponentPage { } clickOnIntClearIcon() { - let clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]')); + const clearIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-int"]')); Util.waitUntilElementIsVisible(clearIcon); return clearIcon.click(); } clickOnIntSaveIcon() { - let saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]')); + const saveIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-int"]')); Util.waitUntilElementIsVisible(saveIcon); return saveIcon.click(); } @@ -112,19 +112,19 @@ export class CardViewComponentPage { } getIntFieldText() { - let textField = element(by.css('span[data-automation-id="card-textitem-value-int"]')); + const textField = element(by.css('span[data-automation-id="card-textitem-value-int"]')); Util.waitUntilElementIsVisible(textField); return textField.getText(); } getErrorInt() { - let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]')); + const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-int"]')); Util.waitUntilElementIsVisible(errorElement); return errorElement.getText(); } clickOnFloatField() { - let toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]')); + const toggleText = element(by.css('div[data-automation-id="card-textitem-edit-toggle-float"]')); Util.waitUntilElementIsVisible(toggleText); toggleText.click(); Util.waitUntilElementIsVisible(this.floatField); @@ -132,13 +132,13 @@ export class CardViewComponentPage { } clickOnFloatClearIcon() { - let clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-float"]`)); + const clearIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-reset-float"]`)); Util.waitUntilElementIsVisible(clearIcon); return clearIcon.click(); } clickOnFloatSaveIcon() { - let saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-float"]`)); + const saveIcon = element(by.css(`mat-icon[data-automation-id="card-textitem-update-float"]`)); Util.waitUntilElementIsVisible(saveIcon); return saveIcon.click(); } @@ -152,13 +152,13 @@ export class CardViewComponentPage { } getFloatFieldText() { - let textField = element(by.css('span[data-automation-id="card-textitem-value-float"]')); + const textField = element(by.css('span[data-automation-id="card-textitem-value-float"]')); Util.waitUntilElementIsVisible(textField); return textField.getText(); } getErrorFloat() { - let errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]')); + const errorElement = element(by.css('mat-error[data-automation-id="card-textitem-error-float"]')); Util.waitUntilElementIsVisible(errorElement); return errorElement.getText(); } diff --git a/e2e/pages/adf/configEditorPage.ts b/e2e/pages/adf/configEditorPage.ts index f77e165655..aebf4585ae 100644 --- a/e2e/pages/adf/configEditorPage.ts +++ b/e2e/pages/adf/configEditorPage.ts @@ -21,14 +21,14 @@ import { Util } from '../../util/util'; export class ConfigEditorPage { enterConfiguration(text) { - let textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea')); + const textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea')); Util.waitUntilElementIsVisible(textField); textField.sendKeys(text); return this; } enterBigConfigurationText(text) { - let textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea')); + const textField = element(by.css('#adf-code-configuration-editor div.overflow-guard > textarea')); Util.waitUntilElementIsVisible(textField); browser.executeScript('this.monaco.editor.getModels()[0].setValue(`' + text + '`)'); @@ -36,63 +36,63 @@ export class ConfigEditorPage { } clickSaveButton() { - let saveButton = element(by.id('adf-configuration-save')); + const saveButton = element(by.id('adf-configuration-save')); Util.waitUntilElementIsVisible(saveButton); Util.waitUntilElementIsClickable(saveButton); return saveButton.click(); } clickClearButton() { - let clearButton = element(by.id('adf-configuration-clear')); + const clearButton = element(by.id('adf-configuration-clear')); Util.waitUntilElementIsVisible(clearButton); Util.waitUntilElementIsClickable(clearButton); return clearButton.click(); } clickFileConfiguration() { - let button = element(by.id('adf-file-conf')); + const button = element(by.id('adf-file-conf')); Util.waitUntilElementIsVisible(button); Util.waitUntilElementIsClickable(button); return button.click(); } clickSearchConfiguration() { - let button = element(by.id('adf-search-conf')); + const button = element(by.id('adf-search-conf')); Util.waitUntilElementIsVisible(button); Util.waitUntilElementIsClickable(button); return button.click(); } clickProcessListCloudConfiguration() { - let button = element(by.id('adf-process-list-cloud-conf')); + const button = element(by.id('adf-process-list-cloud-conf')); Util.waitUntilElementIsVisible(button); Util.waitUntilElementIsClickable(button); return button.click(); } clickEditProcessCloudConfiguration() { - let button = element(by.id('adf-edit-process-filter-conf')); + const button = element(by.id('adf-edit-process-filter-conf')); Util.waitUntilElementIsVisible(button); Util.waitUntilElementIsClickable(button); return button.click(); } clickEditTaskConfiguration() { - let button = element(by.id('adf-edit-task-filter-conf')); + const button = element(by.id('adf-edit-task-filter-conf')); Util.waitUntilElementIsVisible(button); Util.waitUntilElementIsClickable(button); return button.click(); } clickTaskListCloudConfiguration() { - let button = element(by.id('adf-task-list-cloud-conf')); + const button = element(by.id('adf-task-list-cloud-conf')); Util.waitUntilElementIsVisible(button); Util.waitUntilElementIsClickable(button); return button.click(); } clickInfinitePaginationConfiguration() { - let button = element(by.id('adf-infinite-pagination-conf')); + const button = element(by.id('adf-infinite-pagination-conf')); Util.waitUntilElementIsVisible(button); Util.waitUntilElementIsClickable(button); return button.click(); diff --git a/e2e/pages/adf/content-services/documentListPage.ts b/e2e/pages/adf/content-services/documentListPage.ts index 0d20e62ddb..13afd6e0b3 100644 --- a/e2e/pages/adf/content-services/documentListPage.ts +++ b/e2e/pages/adf/content-services/documentListPage.ts @@ -34,15 +34,15 @@ export class DocumentListPage { } checkLockedIcon(content) { - let row = this.dataTable.getRowParentElement('Display name', content); - let lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock')); + const row = this.dataTable.getRowParentElement('Display name', content); + const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock')); Util.waitUntilElementIsVisible(lockIcon); return this; } checkUnlockedIcon(content) { - let row = this.dataTable.getRowParentElement('Display name', content); - let lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock_open')); + const row = this.dataTable.getRowParentElement('Display name', content); + const lockIcon = row.element(by.cssContainingText('div[title="Lock"] mat-icon', 'lock_open')); Util.waitUntilElementIsVisible(lockIcon); return this; } @@ -64,7 +64,7 @@ export class DocumentListPage { } clickOnActionMenu(content) { - let row = this.dataTable.getRowParentElement('Display name', content); + const row = this.dataTable.getRowParentElement('Display name', content); row.element(this.optionButton).click(); Util.waitUntilElementIsVisible(this.actionMenu); browser.sleep(500); diff --git a/e2e/pages/adf/content-services/search/components/dateRangeFilterPage.ts b/e2e/pages/adf/content-services/search/components/dateRangeFilterPage.ts index e1091d6538..1af248d5cc 100644 --- a/e2e/pages/adf/content-services/search/components/dateRangeFilterPage.ts +++ b/e2e/pages/adf/content-services/search/components/dateRangeFilterPage.ts @@ -48,7 +48,7 @@ export class DateRangeFilterPage { } getFromCalendarSelectedDate() { - let selectedDate = this.openFromDatePicker().getSelectedDate(); + const selectedDate = this.openFromDatePicker().getSelectedDate(); new DatePickerPage().closeDatePicker(); return selectedDate; } diff --git a/e2e/pages/adf/content-services/search/components/search-checkList.ts b/e2e/pages/adf/content-services/search/components/search-checkList.ts index 2fbeea3512..e980b88239 100644 --- a/e2e/pages/adf/content-services/search/components/search-checkList.ts +++ b/e2e/pages/adf/content-services/search/components/search-checkList.ts @@ -32,7 +32,7 @@ export class SearchCheckListPage { clickCheckListOption(option) { Util.waitUntilElementIsVisible(this.filter); - let result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`)).first(); + const result = this.filter.all(by.css(`mat-checkbox[data-automation-id*='-${option}'] .mat-checkbox-inner-container`)).first(); Util.waitUntilElementIsVisible(result); Util.waitUntilElementIsClickable(result); result.click(); @@ -49,7 +49,7 @@ export class SearchCheckListPage { } removeFilterOption(option) { - let cancelChipButton = element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon')); + const cancelChipButton = element(by.cssContainingText('mat-chip', option)).element(by.css('mat-icon')); Util.waitUntilElementIsClickable(cancelChipButton); cancelChipButton.click(); return this; @@ -69,7 +69,7 @@ export class SearchCheckListPage { searchInFilter(option) { Util.waitUntilElementIsClickable(this.filter); - let inputElement = this.filter.all(this.inputBy).first(); + const inputElement = this.filter.all(this.inputBy).first(); Util.waitUntilElementIsClickable(inputElement); inputElement.clear(); @@ -122,11 +122,11 @@ export class SearchCheckListPage { } getBucketNumberOfFilterType(option) { - let fileTypeFilter = this.filter.all(by.css('mat-checkbox[data-automation-id*=".' + option + '"] span')).first(); + const fileTypeFilter = this.filter.all(by.css('mat-checkbox[data-automation-id*=".' + option + '"] span')).first(); Util.waitUntilElementIsVisible(fileTypeFilter); - let bucketNumber = fileTypeFilter.getText().then((valueOfBucket) => { - let numberOfBucket = valueOfBucket.split('(')[1]; - let totalNumberOfBucket = numberOfBucket.split(')')[0]; + const bucketNumber = fileTypeFilter.getText().then((valueOfBucket) => { + const numberOfBucket = valueOfBucket.split('(')[1]; + const totalNumberOfBucket = numberOfBucket.split(')')[0]; return totalNumberOfBucket.trim(); }); @@ -135,38 +135,38 @@ export class SearchCheckListPage { checkCheckListOptionIsDisplayed(option) { Util.waitUntilElementIsVisible(this.filter); - let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}']`)); + const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}']`)); return Util.waitUntilElementIsVisible(result); } checkCheckListOptionIsNotSelected(option) { Util.waitUntilElementIsVisible(this.filter); - let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`)); + const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`)); return Util.waitUntilElementIsNotVisible(result); } checkCheckListOptionIsSelected(option) { Util.waitUntilElementIsVisible(this.filter); - let result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`)); + const result = this.filter.element(by.css(`mat-checkbox[data-automation-id*='-${option}'][class*='checked']`)); return Util.waitUntilElementIsVisible(result); } checkClearAllButtonIsDisplayed() { Util.waitUntilElementIsVisible(this.filter); - let result = this.filter.element(this.clearAllButton); + const result = this.filter.element(this.clearAllButton); return Util.waitUntilElementIsVisible(result); } clickClearAllButton() { Util.waitUntilElementIsVisible(this.filter); - let result = this.filter.element(this.clearAllButton); + const result = this.filter.element(this.clearAllButton); Util.waitUntilElementIsVisible(result); return result.click(); } getCheckListOptionsNumberOnPage() { Util.waitUntilElementIsVisible(this.filter); - let checkListOptions = this.filter.all(by.css('div[class="checklist"] mat-checkbox')); + const checkListOptions = this.filter.all(by.css('div[class="checklist"] mat-checkbox')); return checkListOptions.count(); } diff --git a/e2e/pages/adf/content-services/search/components/search-radio.ts b/e2e/pages/adf/content-services/search/components/search-radio.ts index 3bd1dbed37..251980bfd3 100644 --- a/e2e/pages/adf/content-services/search/components/search-radio.ts +++ b/e2e/pages/adf/content-services/search/components/search-radio.ts @@ -29,12 +29,12 @@ export class SearchRadioPage { } checkFilterRadioButtonIsDisplayed(filterName) { - let filterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"]')); + const filterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"]')); return Util.waitUntilElementIsVisible(filterType); } checkFilterRadioButtonIsChecked(filterName) { - let selectedFilterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"][class*="checked"]')); + const selectedFilterType = element(by.css('mat-radio-button[data-automation-id="search-radio-' + filterName + '"][class*="checked"]')); return Util.waitUntilElementIsVisible(selectedFilterType); } @@ -43,7 +43,7 @@ export class SearchRadioPage { } getRadioButtonsNumberOnPage() { - let radioButtons = element.all(by.css('mat-radio-button')); + const radioButtons = element.all(by.css('mat-radio-button')); return radioButtons.count(); } diff --git a/e2e/pages/adf/content-services/search/components/search-sortingPicker.page.ts b/e2e/pages/adf/content-services/search/components/search-sortingPicker.page.ts index fee3bd1760..3f18daea60 100644 --- a/e2e/pages/adf/content-services/search/components/search-sortingPicker.page.ts +++ b/e2e/pages/adf/content-services/search/components/search-sortingPicker.page.ts @@ -28,7 +28,7 @@ export class SearchSortingPickerPage { Util.waitUntilElementIsClickable(this.sortingSelector); this.sortingSelector.click(); - let selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', sortType)); + const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', sortType)); Util.waitUntilElementIsClickable(selectedSortingOption); selectedSortingOption.click(); @@ -51,7 +51,7 @@ export class SearchSortingPickerPage { } clickSortingOption(option) { - let selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', option)); + const selectedSortingOption = element(by.cssContainingText('span[class="mat-option-text"]', option)); Util.waitUntilElementIsClickable(selectedSortingOption); selectedSortingOption.click(); return this; @@ -64,13 +64,13 @@ export class SearchSortingPickerPage { } checkOptionIsDisplayed(option) { - let optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option)); + const optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option)); Util.waitUntilElementIsVisible(optionSelector); return this; } checkOptionIsNotDisplayed(option) { - let optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option)); + const optionSelector = this.optionsDropdown.element(by.cssContainingText('span[class="mat-option-text"]', option)); Util.waitUntilElementIsNotVisible(optionSelector); return this; } @@ -86,7 +86,7 @@ export class SearchSortingPickerPage { } checkOrderArrowIsDownward() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); Util.waitUntilElementIsVisible(this.orderArrow); this.orderArrow.getText().then((result) => { deferred.fulfill(result !== 'arrow_upward'); diff --git a/e2e/pages/adf/content-services/search/search-categories.ts b/e2e/pages/adf/content-services/search/search-categories.ts index ce812e62c3..ce726733ec 100644 --- a/e2e/pages/adf/content-services/search/search-categories.ts +++ b/e2e/pages/adf/content-services/search/search-categories.ts @@ -62,7 +62,7 @@ export class SearchCategoriesPage { } clickFilterHeader(filter: ElementFinder) { - let fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header')); + const fileSizeFilterHeader = filter.element(by.css('mat-expansion-panel-header')); Util.waitUntilElementIsClickable(fileSizeFilterHeader); fileSizeFilterHeader.click(); return this; diff --git a/e2e/pages/adf/content-services/treeViewPage.ts b/e2e/pages/adf/content-services/treeViewPage.ts index 33bd42e48d..42cb1d3ad4 100644 --- a/e2e/pages/adf/content-services/treeViewPage.ts +++ b/e2e/pages/adf/content-services/treeViewPage.ts @@ -35,28 +35,28 @@ export class TreeViewPage { } clickNode(nodeName) { - let node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button')); + const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"] button')); Util.waitUntilElementIsClickable(node); return node.click(); } checkNodeIsDisplayedAsClosed(nodeName) { - let node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]')); + const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="false"]')); return Util.waitUntilElementIsVisible(node); } checkNodeIsDisplayedAsOpen(nodeName) { - let node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]')); + const node = element(by.css('mat-tree-node[id="' + nodeName + '-tree-child-node"][aria-expanded="true"]')); return Util.waitUntilElementIsVisible(node); } checkClickedNodeName(nodeName) { - let clickedNode = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + '')); + const clickedNode = element(by.cssContainingText('span', ' CLICKED NODE: ' + nodeName + '')); return Util.waitUntilElementIsVisible(clickedNode); } checkNodeIsNotDisplayed(nodeName) { - let node = element(by.id('' + nodeName + '-tree-child-node')); + const node = element(by.id('' + nodeName + '-tree-child-node')); return Util.waitUntilElementIsNotVisible(node); } @@ -82,7 +82,7 @@ export class TreeViewPage { } checkErrorMessageIsDisplayed() { - let clickedNode = element(by.cssContainingText('span', 'An Error Occurred ')); + const clickedNode = element(by.cssContainingText('span', 'An Error Occurred ')); return Util.waitUntilElementIsVisible(clickedNode); } diff --git a/e2e/pages/adf/contentServicesPage.ts b/e2e/pages/adf/contentServicesPage.ts index c95a4a7c98..ccf4e9291c 100644 --- a/e2e/pages/adf/contentServicesPage.ts +++ b/e2e/pages/adf/contentServicesPage.ts @@ -77,12 +77,12 @@ export class ContentServicesPage { siteListDropdown = element(by.css(`mat-select[data-automation-id='site-my-files-option']`)); pressContextMenuActionNamed(actionName) { - let actionButton = this.checkContextActionIsVisible(actionName); + const actionButton = this.checkContextActionIsVisible(actionName); actionButton.click(); } checkContextActionIsVisible(actionName) { - let actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`)); + const actionButton = element(by.css(`button[data-automation-id="context-${actionName}"`)); Util.waitUntilElementIsVisible(actionButton); Util.waitUntilElementIsClickable(actionButton); return actionButton; @@ -103,7 +103,7 @@ export class ContentServicesPage { checkDeleteIsDisabled(content) { this.contentList.clickOnActionMenu(content); this.waitForContentOptions(); - let disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`)); + const disabledDelete = element(by.css(`button[data-automation-id*='DELETE'][disabled='true']`)); Util.waitUntilElementIsVisible(disabledDelete); } @@ -143,7 +143,7 @@ export class ContentServicesPage { } clickFileHyperlink(fileName) { - let hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName); + const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName); Util.waitUntilElementIsClickable(hyperlink); hyperlink.click(); @@ -151,13 +151,13 @@ export class ContentServicesPage { } checkFileHyperlinkIsEnabled(fileName) { - let hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName); + const hyperlink = this.contentList.dataTablePage().getFileHyperlink(fileName); Util.waitUntilElementIsVisible(hyperlink); return this; } clickHyperlinkNavigationToggle() { - let hyperlinkToggle = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation')); + const hyperlinkToggle = element(by.cssContainingText('.mat-slide-toggle-content', 'Hyperlink navigation')); Util.waitUntilElementIsVisible(hyperlinkToggle); hyperlinkToggle.click(); return this; @@ -300,7 +300,7 @@ export class ContentServicesPage { } currentFolderName() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); Util.waitUntilElementIsVisible(this.currentFolder); this.currentFolder.getText().then(function (result) { deferred.fulfill(result); @@ -326,7 +326,7 @@ export class ContentServicesPage { sortAndCheckListIsOrderedByName(sortOrder) { this.sortByName(sortOrder); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.checkListIsSortedByNameColumn(sortOrder).then((result) => { deferred.fulfill(result); }); @@ -351,7 +351,7 @@ export class ContentServicesPage { sortAndCheckListIsOrderedByAuthor(sortOrder) { this.sortByAuthor(sortOrder); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.checkListIsSortedByAuthorColumn(sortOrder).then((result) => { deferred.fulfill(result); }); @@ -360,7 +360,7 @@ export class ContentServicesPage { sortAndCheckListIsOrderedByCreated(sortOrder) { this.sortByCreated(sortOrder); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.checkListIsSortedByCreatedColumn(sortOrder).then((result) => { deferred.fulfill(result); }); @@ -468,7 +468,7 @@ export class ContentServicesPage { getErrorMessage() { Util.waitUntilElementIsVisible(this.errorSnackBar); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.errorSnackBar.getText().then(function (text) { deferred.fulfill(text); }); @@ -476,28 +476,28 @@ export class ContentServicesPage { } enableInfiniteScrolling() { - let infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling')); + const infiniteScrollButton = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable Infinite Scrolling')); Util.waitUntilElementIsVisible(infiniteScrollButton); infiniteScrollButton.click(); return this; } enableCustomPermissionMessage() { - let customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message')); + const customPermissionMessage = element(by.cssContainingText('.mat-slide-toggle-content', 'Enable custom permission message')); Util.waitUntilElementIsVisible(customPermissionMessage); customPermissionMessage.click(); return this; } enableMediumTimeFormat() { - let mediumTimeFormat = element(by.css('#enableMediumTimeFormat')); + const mediumTimeFormat = element(by.css('#enableMediumTimeFormat')); Util.waitUntilElementIsVisible(mediumTimeFormat); mediumTimeFormat.click(); return this; } enableThumbnails() { - let thumbnailSlide = element(by.id('adf-thumbnails-upload-switch')); + const thumbnailSlide = element(by.id('adf-thumbnails-upload-switch')); Util.waitUntilElementIsVisible(thumbnailSlide); thumbnailSlide.click(); return this; @@ -508,7 +508,7 @@ export class ContentServicesPage { } getDocumentListRowNumber() { - let documentList = element(by.css('adf-upload-drag-area adf-document-list')); + const documentList = element(by.css('adf-upload-drag-area adf-document-list')); Util.waitUntilElementIsVisible(documentList); return $$('adf-upload-drag-area adf-document-list .adf-datatable-row').count(); } @@ -544,7 +544,7 @@ export class ContentServicesPage { } checkLockIsDisplayedForElement(name) { - let lockButton = element(by.css(`div.adf-datatable-cell[filename="${name}"] button`)); + const lockButton = element(by.css(`div.adf-datatable-cell[filename="${name}"] button`)); Util.waitUntilElementIsVisible(lockButton); } @@ -553,7 +553,7 @@ export class ContentServicesPage { } async getStyleValueForRowText(rowName, styleName) { - let row = element(by.css(`div.adf-datatable-cell[filename="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`)); + const row = element(by.css(`div.adf-datatable-cell[filename="${rowName}"] span.adf-datatable-cell-value[title="${rowName}"]`)); Util.waitUntilElementIsVisible(row); return row.getCssValue(styleName); } @@ -577,13 +577,13 @@ export class ContentServicesPage { } checkIconForRowIsDisplayed(fileName) { - let iconRow = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${fileName}"] img`)); + const iconRow = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${fileName}"] img`)); Util.waitUntilElementIsVisible(iconRow); return iconRow; } async getRowIconImageUrl(fileName) { - let iconRow = this.checkIconForRowIsDisplayed(fileName); + const iconRow = this.checkIconForRowIsDisplayed(fileName); return iconRow.getAttribute('src'); } @@ -602,54 +602,54 @@ export class ContentServicesPage { getCardElementShowedInPage() { this.checkCardViewContainerIsDisplayed(); - let actualCards = $$('div.adf-document-list-container div.adf-datatable-card div.adf-cell-value img').count(); + const actualCards = $$('div.adf-document-list-container div.adf-datatable-card div.adf-cell-value img').count(); return actualCards; } getDocumentCardIconForElement(elementName) { - let elementIcon = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"] img`)); + const elementIcon = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"] img`)); return elementIcon.getAttribute('src'); } checkDocumentCardPropertyIsShowed(elementName, propertyName) { - let elementProperty = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"][title="${propertyName}"]`)); + const elementProperty = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"][title="${propertyName}"]`)); Util.waitUntilElementIsVisible(elementProperty); } getAttributeValueForElement(elementName, propertyName) { - let elementSize = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"][title="${propertyName}"] span`)); + const elementSize = element(by.css(`.adf-document-list-container div.adf-datatable-cell[filename="${elementName}"][title="${propertyName}"] span`)); return elementSize.getText(); } checkMenuIsShowedForElementIndex(elementIndex) { - let elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`)); + const elementMenu = element(by.css(`button[data-automation-id="action_menu_${elementIndex}"]`)); Util.waitUntilElementIsVisible(elementMenu); } navigateToCardFolder(folderName) { - let folderCard = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[filename="${folderName}"]`)); + const folderCard = element(by.css(`.adf-document-list-container div.adf-image-table-cell.adf-datatable-cell[filename="${folderName}"]`)); folderCard.click(); - let folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[filename="${folderName}"].adf-datatable-cell--image`)); + const folderSelected = element(by.css(`.adf-datatable-row.adf-is-selected div[filename="${folderName}"].adf-datatable-cell--image`)); Util.waitUntilElementIsVisible(folderSelected); browser.actions().sendKeys(protractor.Key.ENTER).perform(); } getGridViewSortingDropdown() { - let sortingDropdown = element(by.css('mat-select[data-automation-id="grid-view-sorting"]')); + const sortingDropdown = element(by.css('mat-select[data-automation-id="grid-view-sorting"]')); Util.waitUntilElementIsVisible(sortingDropdown); return sortingDropdown; } selectGridSortingFromDropdown(sortingChosen) { - let dropdownSorting = this.getGridViewSortingDropdown(); + const dropdownSorting = this.getGridViewSortingDropdown(); dropdownSorting.click(); - let optionToClick = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`)); + const optionToClick = element(by.css(`mat-option[data-automation-id="grid-view-sorting-${sortingChosen}"]`)); Util.waitUntilElementIsPresent(optionToClick); optionToClick.click(); } checkRowIsDisplayed(rowName) { - let row = this.contentList.dataTablePage().getRow('Display name', rowName); + const row = this.contentList.dataTablePage().getRow('Display name', rowName); Util.waitUntilElementIsVisible(row); } @@ -659,7 +659,7 @@ export class ContentServicesPage { } clickContentNodeSelectorResult(name) { - let resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[filename="${name}"`)).first(); + const resultElement = element.all(by.css(`div[data-automation-id="content-node-selector-content-list"] div[filename="${name}"`)).first(); Util.waitUntilElementIsVisible(resultElement); resultElement.click(); } diff --git a/e2e/pages/adf/core/headerPage.ts b/e2e/pages/adf/core/headerPage.ts index 71d36b840f..a94613a0c8 100644 --- a/e2e/pages/adf/core/headerPage.ts +++ b/e2e/pages/adf/core/headerPage.ts @@ -50,18 +50,18 @@ export class HeaderPage { } clickShowMenuButton() { - let checkBox = element.all(by.css('mat-checkbox')); + const checkBox = element.all(by.css('mat-checkbox')); Util.waitUntilElementIsVisible(checkBox); return checkBox.get(0).click(); } changeHeaderColor(color) { - let headerColor = element(by.css('option[value="' + color + '"]')); + const headerColor = element(by.css('option[value="' + color + '"]')); return headerColor.click(); } checkAppTitle(name) { - let title = element(by.cssContainingText('.adf-app-title', name)); + const title = element(by.cssContainingText('.adf-app-title', name)); return Util.waitUntilElementIsVisible(title); } @@ -73,7 +73,7 @@ export class HeaderPage { } checkIconIsDisplayed(url) { - let icon = element(by.css('img[src="' + url + '"]')); + const icon = element(by.css('img[src="' + url + '"]')); Util.waitUntilElementIsVisible(icon); } diff --git a/e2e/pages/adf/dataTableComponentPage.ts b/e2e/pages/adf/dataTableComponentPage.ts index 09ffdd04cf..286c761142 100644 --- a/e2e/pages/adf/dataTableComponentPage.ts +++ b/e2e/pages/adf/dataTableComponentPage.ts @@ -58,7 +58,7 @@ export class DataTableComponentPage { } clickCheckbox(columnName, columnValue) { - let checkbox = this.getRowCheckbox(columnName, columnValue); + const checkbox = this.getRowCheckbox(columnName, columnValue); Util.waitUntilElementIsClickable(checkbox); checkbox.click(); } @@ -68,7 +68,7 @@ export class DataTableComponentPage { } checkRowIsChecked(columnName, columnValue) { - let rowCheckbox = this.getRowCheckbox(columnName, columnValue); + const rowCheckbox = this.getRowCheckbox(columnName, columnValue); Util.waitUntilElementIsVisible(rowCheckbox.element(by.css('input[aria-checked="true"]'))); } @@ -86,33 +86,33 @@ export class DataTableComponentPage { } selectRowWithKeyboard(columnName, columnValue) { - let row = this.getRow(columnName, columnValue); + const row = this.getRow(columnName, columnValue); browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform(); } selectRow(columnName, columnValue) { - let row = this.getRow(columnName, columnValue); + const row = this.getRow(columnName, columnValue); Util.waitUntilElementIsClickable(row); row.click(); return this; } checkRowIsSelected(columnName, columnValue) { - let selectedRow = this.getRow(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`)); + const selectedRow = this.getRow(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`)); Util.waitUntilElementIsVisible(selectedRow); return this; } checkRowIsNotSelected(columnName, columnValue) { - let selectedRow = this.getRow(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`)); + const selectedRow = this.getRow(columnName, columnValue).element(by.xpath(`ancestor::div[contains(@class, 'is-selected')]`)); Util.waitUntilElementIsNotOnPage(selectedRow); return this; } getColumnValueForRow(identifyingColumn, identifyingValue, columnName) { - let row = this.getRow(identifyingColumn, identifyingValue).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]`)); + const row = this.getRow(identifyingColumn, identifyingValue).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]`)); Util.waitUntilElementIsVisible(row); - let rowColumn = row.element(by.css(`div[title="${columnName}"] span`)); + const rowColumn = row.element(by.css(`div[title="${columnName}"] span`)); Util.waitUntilElementIsVisible(rowColumn); return rowColumn.getText(); } @@ -125,10 +125,10 @@ export class DataTableComponentPage { * @return 'true' if the list is sorted as expected and 'false' if it isn't */ checkListIsSorted(sortOrder, locator) { - let deferred = protractor.promise.defer(); - let column = element.all(by.css(`div[title='${locator}'] span`)); + const deferred = protractor.promise.defer(); + const column = element.all(by.css(`div[title='${locator}'] span`)); Util.waitUntilElementIsVisible(column.first()); - let initialList = []; + const initialList = []; column.each(function (currentElement) { currentElement.getText().then(function (text) { initialList.push(text); @@ -145,7 +145,7 @@ export class DataTableComponentPage { } rightClickOnRow(columnName, columnValue) { - let row = this.getRow(columnName, columnValue); + const row = this.getRow(columnName, columnValue); browser.actions().click(row, protractor.Button.RIGHT).perform(); Util.waitUntilElementIsVisible(element(by.id('adf-context-menu-content'))); } @@ -163,20 +163,20 @@ export class DataTableComponentPage { } async getAllRowsColumnValues(column) { - let columnLocator = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='" + column + "'] span"); + const columnLocator = by.css("adf-datatable div[class*='adf-datatable-body'] div[class*='adf-datatable-row'] div[title='" + column + "'] span"); Util.waitUntilElementIsVisible(element.all(columnLocator).first()); - let initialList: any = await element.all(columnLocator).getText(); + const initialList: any = await element.all(columnLocator).getText(); return initialList.filter((el) => el); } async getRowsWithSameColumnValues(columnName, columnValue) { - let columnLocator = by.css(`div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`); + const columnLocator = by.css(`div[title='${columnName}'] div[data-automation-id="text_${columnValue}"] span`); Util.waitUntilElementIsVisible(this.rootElement.all(columnLocator).first()); return this.rootElement.all(columnLocator).getText(); } doubleClickRow(columnName, columnValue) { - let row = this.getRow(columnName, columnValue); + const row = this.getRow(columnName, columnValue); Util.waitUntilElementIsVisible(row); Util.waitUntilElementIsClickable(row); row.click(); @@ -190,7 +190,7 @@ export class DataTableComponentPage { } getFirstElementDetail(detail) { - let firstNode = element.all(by.css(`adf-datatable div[title="${detail}"] span`)).first(); + const firstNode = element.all(by.css(`adf-datatable div[title="${detail}"] span`)).first(); return firstNode.getText(); } @@ -199,7 +199,7 @@ export class DataTableComponentPage { } sortByColumn(sortOrder, column) { - let locator = by.css(`div[data-automation-id="auto_id_${column}"]`); + const locator = by.css(`div[data-automation-id="auto_id_${column}"]`); Util.waitUntilElementIsVisible(element(locator)); return element(locator).getAttribute('class').then(function (result) { if (sortOrder === true) { @@ -222,13 +222,13 @@ export class DataTableComponentPage { } checkContentIsDisplayed(columnName, columnValue) { - let row = this.getRow(columnName, columnValue); + const row = this.getRow(columnName, columnValue); Util.waitUntilElementIsVisible(row); return this; } checkContentIsNotDisplayed(columnName, columnValue) { - let row = this.getRow(columnName, columnValue); + const row = this.getRow(columnName, columnValue); Util.waitUntilElementIsNotOnPage(row); return this; } @@ -239,7 +239,7 @@ export class DataTableComponentPage { } getRowParentElement(columnName, columnValue) { - let row = this.rootElement.all(by.css(`div[title="${columnName}"] div[data-automation-id="text_${columnValue}"]`)).first() + const row = this.rootElement.all(by.css(`div[title="${columnName}"] div[data-automation-id="text_${columnValue}"]`)).first() .element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]`)); Util.waitUntilElementIsVisible(row); return row; diff --git a/e2e/pages/adf/demo-shell/customSourcesPage.ts b/e2e/pages/adf/demo-shell/customSourcesPage.ts index 7e339a2b91..af5cfac0f2 100644 --- a/e2e/pages/adf/demo-shell/customSourcesPage.ts +++ b/e2e/pages/adf/demo-shell/customSourcesPage.ts @@ -20,7 +20,7 @@ import { element, by } from 'protractor'; import { DataTableComponentPage } from '../dataTableComponentPage'; import { NavigationBarPage } from '../navigationBarPage'; -let source = { +const source = { favorites: 'Favorites', recent: 'Recent', sharedLinks: 'Shared Links', @@ -32,7 +32,7 @@ let source = { shared: 'Shared' }; -let column = { +const column = { status: 'Status' }; @@ -71,7 +71,7 @@ export class CustomSources { } getStatusCell(rowName) { - let cell = this.dataTable.getCellByRowAndColumn('Name', rowName, column.status); + const cell = this.dataTable.getCellByRowAndColumn('Name', rowName, column.status); Util.waitUntilElementIsVisible(cell); return cell.getText(); } diff --git a/e2e/pages/adf/demo-shell/dataTablePage.ts b/e2e/pages/adf/demo-shell/dataTablePage.ts index 25f52e2ce0..4495491fc8 100644 --- a/e2e/pages/adf/demo-shell/dataTablePage.ts +++ b/e2e/pages/adf/demo-shell/dataTablePage.ts @@ -35,7 +35,7 @@ export class DataTablePage { createdOnColumn = element(by.css(`div[data-automation-id='auto_id_createdOn']`)); insertFilter(filterText) { - let inputFilter = element(by.css(`#adf-datatable-filter-input`)); + const inputFilter = element(by.css(`#adf-datatable-filter-input`)); inputFilter.clear(); return inputFilter.sendKeys(filterText); } @@ -46,7 +46,7 @@ export class DataTablePage { } replaceRows(id) { - let rowID = this.dataTable.getRow('Id', id); + const rowID = this.dataTable.getRow('Id', id); Util.waitUntilElementIsVisible(rowID); this.replaceRowsElement.click(); Util.waitUntilElementIsNotVisible(rowID); @@ -69,7 +69,7 @@ export class DataTablePage { } checkRowIsNotSelected(rowNumber) { - let isRowSelected = this.dataTable.getRow('Id', rowNumber) + const isRowSelected = this.dataTable.getRow('Id', rowNumber) .element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row custom-row-style ng-star-inserted is-selected')]`)); Util.waitUntilElementIsNotOnPage(isRowSelected); } @@ -96,13 +96,13 @@ export class DataTablePage { } clickCheckbox(rowNumber) { - let checkbox = this.dataTable.getRow('Id', rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`)); + const checkbox = this.dataTable.getRow('Id', rowNumber).element(by.xpath(`ancestor::div[contains(@class, 'adf-datatable-row')]//mat-checkbox/label`)); Util.waitUntilElementIsVisible(checkbox); checkbox.click(); } selectRow(rowNumber) { - let locator = this.dataTable.getRow('Id', rowNumber); + const locator = this.dataTable.getRow('Id', rowNumber); Util.waitUntilElementIsVisible(locator); Util.waitUntilElementIsClickable(locator); locator.click(); @@ -110,12 +110,12 @@ export class DataTablePage { } selectRowWithKeyboard(rowNumber) { - let row = this.dataTable.getRow('Id', rowNumber); + const row = this.dataTable.getRow('Id', rowNumber); browser.actions().sendKeys(protractor.Key.COMMAND).click(row).perform(); } selectSelectionMode(selectionMode) { - let selectMode = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode)); + const selectMode = element(by.cssContainingText(`span[class='mat-option-text']`, selectionMode)); this.selectionButton.click(); Util.waitUntilElementIsVisible(this.selectionDropDown); selectMode.click(); diff --git a/e2e/pages/adf/demo-shell/process-services/processListDemoPage.ts b/e2e/pages/adf/demo-shell/process-services/processListDemoPage.ts index eed496f175..bfa5395f37 100644 --- a/e2e/pages/adf/demo-shell/process-services/processListDemoPage.ts +++ b/e2e/pages/adf/demo-shell/process-services/processListDemoPage.ts @@ -38,7 +38,7 @@ export class ProcessListDemoPage { selectSorting(sort) { Util.waitUntilElementIsVisible(this.stateSelector); this.sortSelector.click(); - let sortLocator = element(by.cssContainingText('mat-option span', sort)); + const sortLocator = element(by.cssContainingText('mat-option span', sort)); Util.waitUntilElementIsVisible(sortLocator); sortLocator.click(); return this; @@ -47,7 +47,7 @@ export class ProcessListDemoPage { selectStateFilter(state) { Util.waitUntilElementIsVisible(this.stateSelector); this.stateSelector.click(); - let stateLocator = element(by.cssContainingText('mat-option span', state)); + const stateLocator = element(by.cssContainingText('mat-option span', state)); Util.waitUntilElementIsVisible(stateLocator); stateLocator.click(); return this; @@ -67,7 +67,7 @@ export class ProcessListDemoPage { } checkErrorMessageIsDisplayed(error) { - let errorMessage = element(by.cssContainingText('mat-error', error)); + const errorMessage = element(by.cssContainingText('mat-error', error)); Util.waitUntilElementIsVisible(errorMessage); } diff --git a/e2e/pages/adf/demo-shell/process-services/taskListDemoPage.ts b/e2e/pages/adf/demo-shell/process-services/taskListDemoPage.ts index c795f2c4f0..4be5673fa7 100644 --- a/e2e/pages/adf/demo-shell/process-services/taskListDemoPage.ts +++ b/e2e/pages/adf/demo-shell/process-services/taskListDemoPage.ts @@ -128,7 +128,7 @@ export class TaskListDemoPage { getItemsPerPageFieldErrorMessage() { Util.waitUntilElementIsVisible(this.itemsPerPageForm); - let errorMessage = this.itemsPerPageForm.element(by.css('mat-error')); + const errorMessage = this.itemsPerPageForm.element(by.css('mat-error')); Util.waitUntilElementIsVisible(errorMessage); return errorMessage.getText(); } @@ -147,7 +147,7 @@ export class TaskListDemoPage { getPageFieldErrorMessage() { Util.waitUntilElementIsVisible(this.pageForm); - let errorMessage = this.pageForm.element(by.css('mat-error')); + const errorMessage = this.pageForm.element(by.css('mat-error')); Util.waitUntilElementIsVisible(errorMessage); return errorMessage.getText(); } @@ -179,7 +179,7 @@ export class TaskListDemoPage { selectSort(sort) { this.clickOnSortDropDownArrow(); - let sortElement = element.all(by.cssContainingText('mat-option span', sort)).first(); + const sortElement = element.all(by.cssContainingText('mat-option span', sort)).first(); Util.waitUntilElementIsClickable(sortElement); Util.waitUntilElementIsVisible(sortElement); sortElement.click(); @@ -195,7 +195,7 @@ export class TaskListDemoPage { selectState(state) { this.clickOnStateDropDownArrow(); - let stateElement = element.all(by.cssContainingText('mat-option span', state)).first(); + const stateElement = element.all(by.cssContainingText('mat-option span', state)).first(); Util.waitUntilElementIsClickable(stateElement); Util.waitUntilElementIsVisible(stateElement); stateElement.click(); diff --git a/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts b/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts index 360c25dd37..5bcf7cff62 100644 --- a/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts +++ b/e2e/pages/adf/demo-shell/process-services/tasksCloudDemoPage.ts @@ -144,7 +144,7 @@ export class TasksCloudDemoPage { selectSelectionMode(mode) { this.clickOnSelectionModeDropDownArrow(); - let modeElement = element.all(by.cssContainingText('mat-option span', mode)).first(); + const modeElement = element.all(by.cssContainingText('mat-option span', mode)).first(); Util.waitUntilElementIsClickable(modeElement); Util.waitUntilElementIsVisible(modeElement); modeElement.click(); diff --git a/e2e/pages/adf/dialog/createLibraryDialog.ts b/e2e/pages/adf/dialog/createLibraryDialog.ts index 26515b69d0..6d567f5bb2 100644 --- a/e2e/pages/adf/dialog/createLibraryDialog.ts +++ b/e2e/pages/adf/dialog/createLibraryDialog.ts @@ -34,7 +34,7 @@ export class CreateLibraryDialog { libraryNameHint = element(by.css('adf-library-dialog .mat-hint')); getSelectedRadio() { - let radio = element(by.css('.mat-radio-button[class*="checked"]')); + const radio = element(by.css('.mat-radio-button[class*="checked"]')); Util.waitUntilElementIsVisible(radio); return radio.getText(); } diff --git a/e2e/pages/adf/dialog/editProcessFilterDialog.ts b/e2e/pages/adf/dialog/editProcessFilterDialog.ts index 47250b6377..077f2f0513 100644 --- a/e2e/pages/adf/dialog/editProcessFilterDialog.ts +++ b/e2e/pages/adf/dialog/editProcessFilterDialog.ts @@ -27,7 +27,7 @@ export class EditProcessFilterDialog { cancelButtonLocator = by.id('adf-cancel-button-id'); clickOnSaveButton() { - let saveButton = this.componentElement.element(this.saveButtonLocator); + const saveButton = this.componentElement.element(this.saveButtonLocator); Util.waitUntilElementIsVisible(saveButton); saveButton.click(); Util.waitUntilElementIsNotVisible(this.componentElement); @@ -40,7 +40,7 @@ export class EditProcessFilterDialog { } clickOnCancelButton() { - let cancelButton = this.componentElement.element(this.cancelButtonLocator); + const cancelButton = this.componentElement.element(this.cancelButtonLocator); Util.waitUntilElementIsVisible(cancelButton); cancelButton.click(); Util.waitUntilElementIsNotVisible(this.componentElement); diff --git a/e2e/pages/adf/dialog/editTaskFilterDialog.ts b/e2e/pages/adf/dialog/editTaskFilterDialog.ts index 4ae99bed12..0599e79cd0 100644 --- a/e2e/pages/adf/dialog/editTaskFilterDialog.ts +++ b/e2e/pages/adf/dialog/editTaskFilterDialog.ts @@ -27,7 +27,7 @@ export class EditTaskFilterDialog { cancelButtonLocator = by.id('adf-cancel-button-id'); clickOnSaveButton() { - let saveButton = this.componentElement.element(this.saveButtonLocator); + const saveButton = this.componentElement.element(this.saveButtonLocator); Util.waitUntilElementIsVisible(saveButton); saveButton.click(); Util.waitUntilElementIsNotVisible(this.componentElement); @@ -40,7 +40,7 @@ export class EditTaskFilterDialog { } clickOnCancelButton() { - let cancelButton = this.componentElement.element(this.cancelButtonLocator); + const cancelButton = this.componentElement.element(this.cancelButtonLocator); Util.waitUntilElementIsVisible(cancelButton); cancelButton.click(); Util.waitUntilElementIsNotVisible(this.componentElement); diff --git a/e2e/pages/adf/dialog/shareDialog.ts b/e2e/pages/adf/dialog/shareDialog.ts index a9d3acf92d..21a0165bc0 100644 --- a/e2e/pages/adf/dialog/shareDialog.ts +++ b/e2e/pages/adf/dialog/shareDialog.ts @@ -118,7 +118,7 @@ export class ShareDialog { setDefaultDay() { const selector = '.mat-datetimepicker-calendar-body-cell:not(.mat-datetimepicker-calendar-body-disabled)'; Util.waitUntilElementIsVisible(this.dayPicker); - let tomorrow = new Date(new Date().getTime() + 48 * 60 * 60 * 1000).getDate().toString(); + const tomorrow = new Date(new Date().getTime() + 48 * 60 * 60 * 1000).getDate().toString(); this.dayPicker.element(by.cssContainingText(selector, tomorrow)).click(); } diff --git a/e2e/pages/adf/dialog/uploadDialog.ts b/e2e/pages/adf/dialog/uploadDialog.ts index 1e11c82ab1..fdbfde438e 100644 --- a/e2e/pages/adf/dialog/uploadDialog.ts +++ b/e2e/pages/adf/dialog/uploadDialog.ts @@ -65,7 +65,7 @@ export class UploadDialog { } getRowsName(content) { - let row = element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first(); + const row = element.all(by.css(`div[class*='uploading-row'] span[title="${content}"]`)).first(); Util.waitUntilElementIsVisible(row); return row; } @@ -115,7 +115,7 @@ export class UploadDialog { getTitleText() { Util.waitUntilElementIsVisible(this.title); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.title.getText().then((text) => { deferred.fulfill(text); }); @@ -124,7 +124,7 @@ export class UploadDialog { getConfirmationDialogTitleText() { Util.waitUntilElementIsVisible(this.canUploadConfirmationTitle); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.canUploadConfirmationTitle.getText().then((text) => { deferred.fulfill(text); }); @@ -133,7 +133,7 @@ export class UploadDialog { getConfirmationDialogDescriptionText() { Util.waitUntilElementIsVisible(this.canUploadConfirmationDescription); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.canUploadConfirmationDescription.getText().then((text) => { deferred.fulfill(text); }); @@ -157,7 +157,7 @@ export class UploadDialog { } numberOfCurrentFilesUploaded() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.getTitleText().then((text: any) => { deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[0]); }); @@ -165,7 +165,7 @@ export class UploadDialog { } numberOfInitialFilesUploaded() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.getTitleText().then((text: any) => { deferred.fulfill(text.split('Uploaded ')[1].split(' / ')[1]); }); diff --git a/e2e/pages/adf/dialog/uploadToggles.ts b/e2e/pages/adf/dialog/uploadToggles.ts index ef05555eb3..2b6742f3be 100644 --- a/e2e/pages/adf/dialog/uploadToggles.ts +++ b/e2e/pages/adf/dialog/uploadToggles.ts @@ -48,25 +48,25 @@ export class UploadToggles { } checkFolderUploadToggleIsEnabled() { - let enabledToggle = element(by.css('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]')); + const enabledToggle = element(by.css('mat-slide-toggle[id="adf-folder-upload-switch"][class*="mat-checked"]')); Util.waitUntilElementIsVisible(enabledToggle); return this; } checkMultipleFileUploadToggleIsEnabled() { - let enabledToggle = element(by.css('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]')); + const enabledToggle = element(by.css('mat-slide-toggle[id="adf-multiple-upload-switch"][class*="mat-checked"]')); Util.waitUntilElementIsVisible(enabledToggle); return this; } checkMaxSizeToggleIsEnabled() { - let enabledToggle = element(by.css('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]')); + const enabledToggle = element(by.css('mat-slide-toggle[id="adf-max-size-filter-upload-switch"][class*="mat-checked"]')); Util.waitUntilElementIsVisible(enabledToggle); return this; } checkVersioningToggleIsEnabled() { - let enabledToggle = element(by.css('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]')); + const enabledToggle = element(by.css('mat-slide-toggle[id="adf-version-upload-switch"][class*="mat-checked"]')); Util.waitUntilElementIsVisible(enabledToggle); return this; } @@ -122,7 +122,7 @@ export class UploadToggles { clearText() { Util.waitUntilElementIsVisible(this.maxSizeField); - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.maxSizeField.clear().then((value) => { this.maxSizeField.sendKeys(protractor.Key.ESCAPE); }); diff --git a/e2e/pages/adf/filePreviewPage.ts b/e2e/pages/adf/filePreviewPage.ts index 4672cd6733..0edef8d95a 100644 --- a/e2e/pages/adf/filePreviewPage.ts +++ b/e2e/pages/adf/filePreviewPage.ts @@ -35,7 +35,7 @@ export class FilePreviewPage { } getPDFTitleFromSearch() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); Util.waitUntilElementIsVisible(this.pdfTitleFromSearch); Util.waitUntilElementIsVisible(this.textLayer); this.pdfTitleFromSearch.getText().then((result) => { @@ -78,10 +78,10 @@ export class FilePreviewPage { } checkText(pageNumber, text) { - let allPages = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); - let pageLoaded = element(by.css(`div[id="pageContainer${pageNumber}"][data-loaded='true']`)); - let textLayerLoaded = element(by.css(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`)); - let specificText = element(by.cssContainingText(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`, text)); + const allPages = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); + const pageLoaded = element(by.css(`div[id="pageContainer${pageNumber}"][data-loaded='true']`)); + const textLayerLoaded = element(by.css(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`)); + const specificText = element(by.cssContainingText(`div[id="pageContainer${pageNumber}"] div[class='textLayer'] > div`, text)); Util.waitUntilElementIsVisible(allPages); Util.waitUntilElementIsVisible(pageLoaded); @@ -90,19 +90,19 @@ export class FilePreviewPage { } goToNextPage() { - let nextPageIcon = element(by.css(`div[id='viewer-next-page-button']`)); + const nextPageIcon = element(by.css(`div[id='viewer-next-page-button']`)); Util.waitUntilElementIsVisible(nextPageIcon); nextPageIcon.click(); } goToPreviousPage() { - let previousPageIcon = element(by.css(`div[id='viewer-previous-page-button']`)); + const previousPageIcon = element(by.css(`div[id='viewer-previous-page-button']`)); Util.waitUntilElementIsVisible(previousPageIcon); previousPageIcon.click(); } goToPage(page) { - let pageInput = element(by.css(`input[id='viewer-pagenumber-input']`)); + const pageInput = element(by.css(`input[id='viewer-pagenumber-input']`)); Util.waitUntilElementIsVisible(pageInput); pageInput.clear(); @@ -116,7 +116,7 @@ export class FilePreviewPage { } closePreviewWithEsc(fileName) { - let filePreview = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); + const filePreview = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); browser.actions().sendKeys(protractor.Key.ESCAPE).perform(); Util.waitUntilElementIsVisible(element(by.cssContainingText(`div[data-automation-id="text_${fileName}"]`, fileName))); @@ -124,28 +124,28 @@ export class FilePreviewPage { } clickDownload(fileName) { - let downloadButton = element(by.css(`button[id='viewer-download-button']`)); + const downloadButton = element(by.css(`button[id='viewer-download-button']`)); Util.waitUntilElementIsVisible(downloadButton); downloadButton.click(); } clickZoomIn() { - let zoomInButton = element(by.css(`div[id='viewer-zoom-in-button']`)); + const zoomInButton = element(by.css(`div[id='viewer-zoom-in-button']`)); Util.waitUntilElementIsVisible(zoomInButton); zoomInButton.click(); } clickZoomOut() { - let zoomOutButton = element(by.css(`div[id='viewer-zoom-out-button']`)); + const zoomOutButton = element(by.css(`div[id='viewer-zoom-out-button']`)); Util.waitUntilElementIsVisible(zoomOutButton); zoomOutButton.click(); } clickActualSize() { - let actualSizeButton = element(by.css(`div[id='viewer-scale-page-button']`)); + const actualSizeButton = element(by.css(`div[id='viewer-scale-page-button']`)); Util.waitUntilElementIsVisible(actualSizeButton); actualSizeButton.click(); @@ -164,8 +164,8 @@ export class FilePreviewPage { } zoomIn() { - let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); - let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`)); + const canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); + const textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`)); Util.waitUntilElementIsVisible(canvasLayer); Util.waitUntilElementIsVisible(textLayer); @@ -207,8 +207,8 @@ export class FilePreviewPage { } actualSize() { - let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); - let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`)); + const canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); + const textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`)); Util.waitUntilElementIsVisible(canvasLayer); Util.waitUntilElementIsVisible(textLayer); @@ -257,17 +257,18 @@ export class FilePreviewPage { }); } + /* zoomOut() { - let canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); - let textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`)); + const canvasLayer = element.all(by.css(`div[class='canvasWrapper'] > canvas`)).first(); + const textLayer = element(by.css(`div[id*='pageContainer'] div[class='textLayer'] > div`)); Util.waitUntilElementIsVisible(canvasLayer); Util.waitUntilElementIsVisible(textLayer); - let actualWidth, - zoomedOutWidth, - actualHeight, - zoomedOutHeight; + let actualWidth; + let zoomedOutWidth; + let actualHeight; + let zoomedOutHeight; this.checkCanvasWidth().then((width) => { actualWidth = width; @@ -298,4 +299,5 @@ export class FilePreviewPage { } }); } + */ } diff --git a/e2e/pages/adf/material/datePickerPage.ts b/e2e/pages/adf/material/datePickerPage.ts index 67c8ce8be9..6e0fa1c077 100644 --- a/e2e/pages/adf/material/datePickerPage.ts +++ b/e2e/pages/adf/material/datePickerPage.ts @@ -30,8 +30,8 @@ export class DatePickerPage { } checkDatesAfterDateAreDisabled(date) { - let afterDate = DateUtil.formatDate('DD-MM-YY', date, 1); - let afterCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${afterDate}"]`)); + const afterDate = DateUtil.formatDate('DD-MM-YY', date, 1); + const afterCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${afterDate}"]`)); browser.controlFlow().execute(async () => { if (await afterCalendar.isPresent()) { await expect(afterCalendar.getAttribute('aria-disabled')).toBe('true'); @@ -42,8 +42,8 @@ export class DatePickerPage { } checkDatesBeforeDateAreDisabled(date) { - let beforeDate = DateUtil.formatDate('DD-MM-YY', date, -1); - let beforeCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${beforeDate}"]`)); + const beforeDate = DateUtil.formatDate('DD-MM-YY', date, -1); + const beforeCalendar = element(by.css(`td[class*="mat-calendar-body-cell"][aria-label="${beforeDate}"]`)); browser.controlFlow().execute(async () => { if (await beforeCalendar.isPresent()) { await expect(beforeCalendar.getAttribute('aria-disabled')).toBe('true'); @@ -55,7 +55,7 @@ export class DatePickerPage { selectTodayDate() { this.checkDatePickerIsDisplayed(); - let todayDate = element(by.css('.mat-calendar-body-today')); + const todayDate = element(by.css('.mat-calendar-body-today')); Util.waitUntilElementIsClickable(todayDate); todayDate.click(); return this; diff --git a/e2e/pages/adf/metadataViewPage.ts b/e2e/pages/adf/metadataViewPage.ts index 768c8ad422..d46de60f02 100644 --- a/e2e/pages/adf/metadataViewPage.ts +++ b/e2e/pages/adf/metadataViewPage.ts @@ -145,7 +145,7 @@ export class MetadataViewPage { } clickOnPropertiesTab(): MetadataViewPage { - let propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`)); + const propertiesTab = element(by.cssContainingText(`.adf-info-drawer-layout-content div.mat-tab-labels div .mat-tab-label-content`, `Properties`)); Util.waitUntilElementIsVisible(propertiesTab); propertiesTab.click(); return this; @@ -166,23 +166,23 @@ export class MetadataViewPage { } editPropertyIconIsDisplayed(propertyName: string) { - let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); + const editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); Util.waitUntilElementIsVisible(editPropertyIcon); } updatePropertyIconIsDisplayed(propertyName: string) { - let updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]')); + const updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]')); Util.waitUntilElementIsVisible(updatePropertyIcon); } clickUpdatePropertyIcon(propertyName: string): promise.Promise { - let updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]')); + const updatePropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-update-' + propertyName + '"]')); Util.waitUntilElementIsVisible(updatePropertyIcon); return updatePropertyIcon.click(); } clickClearPropertyIcon(propertyName: string): promise.Promise { - let clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]')); + const clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]')); Util.waitUntilElementIsVisible(clearPropertyIcon); return clearPropertyIcon.click(); } @@ -225,62 +225,62 @@ export class MetadataViewPage { } clearPropertyIconIsDisplayed(propertyName: string) { - let clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]')); + const clearPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-reset-' + propertyName + '"]')); Util.waitUntilElementIsVisible(clearPropertyIcon); } clickEditPropertyIcons(propertyName: string) { - let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); + const editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); Util.waitUntilElementIsClickable(editPropertyIcon); editPropertyIcon.click(); } getPropertyIconTooltip(propertyName: string): promise.Promise { - let editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); + const editPropertyIcon = element(by.css('mat-icon[data-automation-id="card-textitem-edit-icon-' + propertyName + '"]')); return editPropertyIcon.getAttribute('title'); } clickMetadataGroup(groupName: string) { - let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]')); + const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]')); Util.waitUntilElementIsVisible(group); group.click(); } checkMetadataGroupIsPresent(groupName: string): promise.Promise { - let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]')); + const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]')); return Util.waitUntilElementIsVisible(group); } checkMetadataGroupIsNotPresent(groupName: string): promise.Promise { - let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]')); + const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"]')); return Util.waitUntilElementIsNotVisible(group); } checkMetadataGroupIsExpand(groupName: string) { - let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header')); + const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header')); Util.waitUntilElementIsVisible(group); expect(group.getAttribute('class')).toContain('mat-expanded'); } checkMetadataGroupIsNotExpand(groupName: string) { - let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header')); + const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header')); Util.waitUntilElementIsVisible(group); expect(group.getAttribute('class')).not.toContain('mat-expanded'); } getMetadataGroupTitle(groupName: string): promise.Promise { - let group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title')); + const group = element(by.css('mat-expansion-panel[data-automation-id="adf-metadata-group-' + groupName + '"] > mat-expansion-panel-header > span > mat-panel-title')); Util.waitUntilElementIsVisible(group); return group.getText(); } checkPropertyIsVisible(propertyName: string, type: string) { - let property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]')); + const property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]')); Util.waitUntilElementIsVisible(property); } checkPropertyIsNotVisible(propertyName: string, type: string) { - let property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]')); + const property = element(by.css('div[data-automation-id="card-' + type + '-label-' + propertyName + '"]')); Util.waitUntilElementIsNotVisible(property); } diff --git a/e2e/pages/adf/navigationBarPage.ts b/e2e/pages/adf/navigationBarPage.ts index 8c630cc8d5..92d8e34f56 100644 --- a/e2e/pages/adf/navigationBarPage.ts +++ b/e2e/pages/adf/navigationBarPage.ts @@ -126,7 +126,7 @@ export class NavigationBarPage { } clickOnSpecificThemeButton(themeName) { - let themeElement = element(by.css(`button[data-automation-id="${themeName}"]`)); + const themeElement = element(by.css(`button[data-automation-id="${themeName}"]`)); Util.waitUntilElementIsVisible(themeElement); Util.waitUntilElementIsClickable(themeElement); themeElement.click(); @@ -147,7 +147,7 @@ export class NavigationBarPage { } chooseLanguage(language) { - let buttonLanguage = element(by.xpath(`//adf-language-menu//button[contains(text(), '${language}')]`)); + const buttonLanguage = element(by.xpath(`//adf-language-menu//button[contains(text(), '${language}')]`)); Util.waitUntilElementIsVisible(buttonLanguage); buttonLanguage.click(); } @@ -182,12 +182,12 @@ export class NavigationBarPage { } checkToolbarColor(color) { - let toolbarColor = element(by.css(`mat-toolbar[class*="mat-${color}"]`)); + const toolbarColor = element(by.css(`mat-toolbar[class*="mat-${color}"]`)); return Util.waitUntilElementIsVisible(toolbarColor); } clickAppLogo(logoTitle) { - let appLogo = element(by.css('a[title="' + logoTitle + '"]')); + const appLogo = element(by.css('a[title="' + logoTitle + '"]')); Util.waitUntilElementIsVisible(appLogo); appLogo.click(); } @@ -205,7 +205,7 @@ export class NavigationBarPage { } checkLogoTooltip(logoTooltipTitle) { - let logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]')); + const logoTooltip = element(by.css('a[title="' + logoTooltipTitle + '"]')); Util.waitUntilElementIsVisible(logoTooltip); } diff --git a/e2e/pages/adf/notificationPage.ts b/e2e/pages/adf/notificationPage.ts index 804442c3a7..68e59bdd36 100644 --- a/e2e/pages/adf/notificationPage.ts +++ b/e2e/pages/adf/notificationPage.ts @@ -54,7 +54,7 @@ export class NotificationPage { } checkNotificationSnackBarIsDisplayedWithMessage(message) { - let notificationSnackBarMessage = element(by.cssContainingText('simple-snack-bar', message)); + const notificationSnackBarMessage = element(by.cssContainingText('simple-snack-bar', message)); Util.waitUntilElementIsVisible(notificationSnackBarMessage); return this; } @@ -77,21 +77,21 @@ export class NotificationPage { } selectHorizontalPosition(selectedItem) { - let selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem)); + const selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem)); this.horizontalPosition.click(); Util.waitUntilElementIsVisible(this.selectionDropDown); selectItem.click(); } selectVerticalPosition(selectedItem) { - let selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem)); + const selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem)); this.verticalPosition.click(); Util.waitUntilElementIsVisible(this.selectionDropDown); selectItem.click(); } selectDirection(selectedItem) { - let selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem)); + const selectItem = element(by.cssContainingText('span[class="mat-option-text"]', selectedItem)); this.direction.click(); Util.waitUntilElementIsVisible(this.selectionDropDown); selectItem.click(); diff --git a/e2e/pages/adf/paginationPage.ts b/e2e/pages/adf/paginationPage.ts index a1d3a91007..dcadd67ce1 100644 --- a/e2e/pages/adf/paginationPage.ts +++ b/e2e/pages/adf/paginationPage.ts @@ -45,7 +45,7 @@ export class PaginationPage { this.itemsPerPageDropdown.click(); Util.waitUntilElementIsVisible(this.pageSelectorDropDown); - let itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first(); + const itemsPerPage = element.all(by.cssContainingText('.mat-menu-item', numberOfItem)).first(); Util.waitUntilElementIsClickable(itemsPerPage); Util.waitUntilElementIsVisible(itemsPerPage); itemsPerPage.click(); @@ -103,16 +103,16 @@ export class PaginationPage { clickOnPageDropdownOption(numberOfItemPerPage: string) { Util.waitUntilElementIsVisible(element.all(this.pageDropDownOptions).first()); - let option = element(by.cssContainingText('div[class*="mat-menu-content"] button', numberOfItemPerPage)); + const option = element(by.cssContainingText('div[class*="mat-menu-content"] button', numberOfItemPerPage)); Util.waitUntilElementIsVisible(option); option.click(); return this; } getPageDropdownOptions() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); Util.waitUntilElementIsVisible(element.all(this.pageDropDownOptions).first()); - let initialList = []; + const initialList = []; element.all(this.pageDropDownOptions).each(function (currentOption) { currentOption.getText().then(function (text) { if (text !== '') { @@ -143,8 +143,8 @@ export class PaginationPage { getTotalNumberOfFiles() { Util.waitUntilElementIsVisible(this.totalFiles); - let numberOfFiles = this.totalFiles.getText().then(function (totalNumber) { - let totalNumberOfFiles = totalNumber.split('of ')[1]; + const numberOfFiles = this.totalFiles.getText().then(function (totalNumber) { + const totalNumberOfFiles = totalNumber.split('of ')[1]; return totalNumberOfFiles; }); diff --git a/e2e/pages/adf/permissionsPage.ts b/e2e/pages/adf/permissionsPage.ts index 8c83a85c76..3772decb98 100644 --- a/e2e/pages/adf/permissionsPage.ts +++ b/e2e/pages/adf/permissionsPage.ts @@ -20,7 +20,7 @@ import { element, by } from 'protractor'; import { Util } from '../../util/util'; import { DataTableComponentPage } from './dataTableComponentPage'; -let column = { +const column = { role: 'Role' }; @@ -74,7 +74,7 @@ export class PermissionsPage { } clickUserOrGroup(name) { - let userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name)); + const userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name)); Util.waitUntilElementIsVisible(userOrGroupName); userOrGroupName.click(); Util.waitUntilElementIsVisible(this.addButton); @@ -82,12 +82,12 @@ export class PermissionsPage { } checkUserOrGroupIsAdded(name) { - let userOrGroupName = element(by.css('div[data-automation-id="text_' + name + '"]')); + const userOrGroupName = element(by.css('div[data-automation-id="text_' + name + '"]')); Util.waitUntilElementIsVisible(userOrGroupName); } checkUserOrGroupIsDeleted(name) { - let userOrGroupName = element(by.css('div[data-automation-id="text_' + name + '"]')); + const userOrGroupName = element(by.css('div[data-automation-id="text_' + name + '"]')); Util.waitUntilElementIsNotVisible(userOrGroupName); } @@ -119,7 +119,7 @@ export class PermissionsPage { } getRoleCellValue(rowName) { - let locator = new DataTableComponentPage().getCellByRowAndColumn('Authority ID', rowName, column.role); + const locator = new DataTableComponentPage().getCellByRowAndColumn('Authority ID', rowName, column.role); Util.waitUntilElementIsVisible(locator); return locator.getText(); } @@ -135,7 +135,7 @@ export class PermissionsPage { } selectOption(name) { - let selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); + const selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); Util.waitUntilElementIsVisible(selectProcessDropdown); Util.waitUntilElementIsClickable(selectProcessDropdown); selectProcessDropdown.click(); @@ -152,7 +152,7 @@ export class PermissionsPage { } checkUserOrGroupIsDisplayed(name) { - let userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name)); + const userOrGroupName = element(by.cssContainingText('mat-list-option .mat-list-text', name)); Util.waitUntilElementIsVisible(userOrGroupName); } } diff --git a/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts b/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts index 3a081692f7..ed75cf0d72 100644 --- a/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts +++ b/e2e/pages/adf/process-cloud/editProcessFilterCloudComponent.ts @@ -39,9 +39,9 @@ export class EditProcessFilterCloudComponent { } checkCustomiseFilterHeaderIsExpanded() { - let expansionPanelExtended = element.all(by.css('mat-expansion-panel-header[class*="mat-expanded"]')).first(); + const expansionPanelExtended = element.all(by.css('mat-expansion-panel-header[class*="mat-expanded"]')).first(); Util.waitUntilElementIsVisible(expansionPanelExtended); - let content = element(by.css('div[class*="mat-expansion-panel-content "][style*="visible"]')); + const content = element(by.css('div[class*="mat-expansion-panel-content "][style*="visible"]')); Util.waitUntilElementIsVisible(content); return this; } @@ -49,7 +49,7 @@ export class EditProcessFilterCloudComponent { setStatusFilterDropDown(option) { this.clickOnDropDownArrow('status'); - let statusElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const statusElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(statusElement); Util.waitUntilElementIsVisible(statusElement); statusElement.click(); @@ -63,7 +63,7 @@ export class EditProcessFilterCloudComponent { setSortFilterDropDown(option) { this.clickOnDropDownArrow('sort'); - let sortElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const sortElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(sortElement); Util.waitUntilElementIsVisible(sortElement); sortElement.click(); @@ -71,7 +71,7 @@ export class EditProcessFilterCloudComponent { } getSortFilterDropDownValue() { - let sortLocator = element.all(by.css("mat-form-field[data-automation-id='sort'] span")).first(); + const sortLocator = element.all(by.css("mat-form-field[data-automation-id='sort'] span")).first(); Util.waitUntilElementIsVisible(sortLocator); return sortLocator.getText(); } @@ -79,7 +79,7 @@ export class EditProcessFilterCloudComponent { setOrderFilterDropDown(option) { this.clickOnDropDownArrow('order'); - let orderElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const orderElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(orderElement); Util.waitUntilElementIsVisible(orderElement); orderElement.click(); @@ -91,7 +91,7 @@ export class EditProcessFilterCloudComponent { } clickOnDropDownArrow(option) { - let dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class='mat-select-arrow-wrapper']")).first(); + const dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class='mat-select-arrow-wrapper']")).first(); Util.waitUntilElementIsVisible(dropDownArrow); Util.waitUntilElementIsClickable(dropDownArrow); dropDownArrow.click(); @@ -101,7 +101,7 @@ export class EditProcessFilterCloudComponent { setAppNameDropDown(option) { this.clickOnDropDownArrow('appName'); - let appNameElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const appNameElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(appNameElement); Util.waitUntilElementIsVisible(appNameElement); appNameElement.click(); @@ -109,10 +109,10 @@ export class EditProcessFilterCloudComponent { } async checkAppNamesAreUnique() { - let appNameList = element.all(by.css('mat-option[data-automation-id="adf-cloud-edit-process-property-optionsappName"] span')); - let appTextList: any = await appNameList.getText(); - let uniqueArray = appTextList.filter((appName) => { - let sameAppNameArray = appTextList.filter((eachApp) => eachApp === appName); + const appNameList = element.all(by.css('mat-option[data-automation-id="adf-cloud-edit-process-property-optionsappName"] span')); + const appTextList: any = await appNameList.getText(); + const uniqueArray = appTextList.filter((appName) => { + const sameAppNameArray = appTextList.filter((eachApp) => eachApp === appName); return sameAppNameArray.length === 1; }); return uniqueArray.length === appTextList.length; @@ -120,7 +120,7 @@ export class EditProcessFilterCloudComponent { getNumberOfAppNameOptions() { this.clickOnDropDownArrow('appName'); - let dropdownOptions = element.all(by.css('.mat-select-panel mat-option')); + const dropdownOptions = element.all(by.css('.mat-select-panel mat-option')); return dropdownOptions.count(); } @@ -133,13 +133,13 @@ export class EditProcessFilterCloudComponent { } getProperty(property) { - let locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first(); + const locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first(); Util.waitUntilElementIsVisible(locator); return locator.getAttribute('value'); } setProperty(property, option) { - let locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first(); + const locator = element.all(by.css('input[data-automation-id="adf-cloud-edit-process-property-' + property + '"]')).first(); Util.waitUntilElementIsVisible(locator); locator.clear(); locator.sendKeys(option); @@ -178,7 +178,7 @@ export class EditProcessFilterCloudComponent { } clickSaveAsButton() { - let disabledButton = element(by.css(("button[data-automation-id='adf-filter-action-saveAs'][disabled]"))); + const disabledButton = element(by.css(("button[data-automation-id='adf-filter-action-saveAs'][disabled]"))); Util.waitUntilElementIsClickable(this.saveAsButton); Util.waitUntilElementIsVisible(this.saveAsButton); Util.waitUntilElementIsNotVisible(disabledButton); @@ -193,7 +193,7 @@ export class EditProcessFilterCloudComponent { } clickSaveButton() { - let disabledButton = element(by.css(("button[data-automation-id='adf-filter-action-saveAs'][disabled]"))); + const disabledButton = element(by.css(("button[data-automation-id='adf-filter-action-saveAs'][disabled]"))); Util.waitUntilElementIsClickable(this.saveButton); Util.waitUntilElementIsVisible(this.saveButton); Util.waitUntilElementIsNotVisible(disabledButton); diff --git a/e2e/pages/adf/process-cloud/editTaskFilterCloudComponent.ts b/e2e/pages/adf/process-cloud/editTaskFilterCloudComponent.ts index 101bf49bcd..c5484f2413 100644 --- a/e2e/pages/adf/process-cloud/editTaskFilterCloudComponent.ts +++ b/e2e/pages/adf/process-cloud/editTaskFilterCloudComponent.ts @@ -51,7 +51,7 @@ export class EditTaskFilterCloudComponent { setStatusFilterDropDown(option) { this.clickOnDropDownArrow('status'); - let statusElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const statusElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsVisible(statusElement); Util.waitUntilElementIsClickable(statusElement); statusElement.click(); @@ -65,7 +65,7 @@ export class EditTaskFilterCloudComponent { setSortFilterDropDown(option) { this.clickOnDropDownArrow('sort'); - let sortElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const sortElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(sortElement); Util.waitUntilElementIsVisible(sortElement); sortElement.click(); @@ -73,7 +73,7 @@ export class EditTaskFilterCloudComponent { } getSortFilterDropDownValue() { - let elementSort = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-sort'] span")).first(); + const elementSort = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-sort'] span")).first(); Util.waitUntilElementIsVisible(elementSort); return elementSort.getText(); } @@ -81,7 +81,7 @@ export class EditTaskFilterCloudComponent { setOrderFilterDropDown(option) { this.clickOnDropDownArrow('order'); - let orderElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const orderElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(orderElement); Util.waitUntilElementIsVisible(orderElement); orderElement.click(); @@ -93,7 +93,7 @@ export class EditTaskFilterCloudComponent { } clickOnDropDownArrow(option) { - let dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")).first(); + const dropDownArrow = element.all(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")).first(); Util.waitUntilElementIsVisible(dropDownArrow); dropDownArrow.click(); Util.waitUntilElementIsVisible(this.selectedOption); @@ -180,7 +180,7 @@ export class EditTaskFilterCloudComponent { } clickSaveAsButton() { - let disabledButton = element(by.css(("button[id='adf-save-as-id'][disabled]"))); + const disabledButton = element(by.css(("button[id='adf-save-as-id'][disabled]"))); Util.waitUntilElementIsClickable(this.saveAsButton); Util.waitUntilElementIsVisible(this.saveAsButton); Util.waitUntilElementIsNotVisible(disabledButton); @@ -217,7 +217,7 @@ export class EditTaskFilterCloudComponent { setAppNameDropDown(option) { this.clickOnDropDownArrow('appName'); - let appNameElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const appNameElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(appNameElement); Util.waitUntilElementIsVisible(appNameElement); appNameElement.click(); @@ -225,7 +225,7 @@ export class EditTaskFilterCloudComponent { } getAppNameDropDownValue() { - let locator = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-appName'] span")).first(); + const locator = element.all(by.css("mat-select[data-automation-id='adf-cloud-edit-task-property-appName'] span")).first(); Util.waitUntilElementIsVisible(locator); return locator.getText(); } @@ -251,7 +251,7 @@ export class EditTaskFilterCloudComponent { } setProperty(property, option) { - let locator = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-' + property + '"]')); + const locator = element(by.css('input[data-automation-id="adf-cloud-edit-task-property-' + property + '"]')); Util.waitUntilElementIsVisible(locator); locator.clear(); locator.sendKeys(option); diff --git a/e2e/pages/adf/process-cloud/groupCloudComponent.ts b/e2e/pages/adf/process-cloud/groupCloudComponent.ts index f262903dbf..da69613b33 100644 --- a/e2e/pages/adf/process-cloud/groupCloudComponent.ts +++ b/e2e/pages/adf/process-cloud/groupCloudComponent.ts @@ -35,7 +35,7 @@ export class GroupCloudComponent { } selectGroupFromList(name) { - let groupRow = element.all(by.cssContainingText('mat-option span', name)).first(); + const groupRow = element.all(by.cssContainingText('mat-option span', name)).first(); Util.waitUntilElementIsVisible(groupRow); groupRow.click(); Util.waitUntilElementIsNotVisible(groupRow); @@ -43,13 +43,13 @@ export class GroupCloudComponent { } checkGroupIsDisplayed(name) { - let groupRow = element.all(by.cssContainingText('mat-option span', name)).first(); + const groupRow = element.all(by.cssContainingText('mat-option span', name)).first(); Util.waitUntilElementIsVisible(groupRow); return this; } checkGroupIsNotDisplayed(name) { - let groupRow = element.all(by.cssContainingText('mat-option span', name)).first(); + const groupRow = element.all(by.cssContainingText('mat-option span', name)).first(); Util.waitUntilElementIsNotVisible(groupRow); return this; } diff --git a/e2e/pages/adf/process-cloud/peopleCloudComponent.ts b/e2e/pages/adf/process-cloud/peopleCloudComponent.ts index 6e802db453..939a414ea6 100644 --- a/e2e/pages/adf/process-cloud/peopleCloudComponent.ts +++ b/e2e/pages/adf/process-cloud/peopleCloudComponent.ts @@ -43,7 +43,7 @@ export class PeopleCloudComponent { } selectAssigneeFromList(name) { - let assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); + const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); Util.waitUntilElementIsVisible(assigneeRow); assigneeRow.click(); Util.waitUntilElementIsNotVisible(assigneeRow); @@ -56,13 +56,13 @@ export class PeopleCloudComponent { } checkUserIsDisplayed(name) { - let assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); + const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); Util.waitUntilElementIsVisible(assigneeRow); return this; } checkUserIsNotDisplayed(name) { - let assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); + const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); Util.waitUntilElementIsNotVisible(assigneeRow); return this; } diff --git a/e2e/pages/adf/process-cloud/processFiltersCloudComponent.ts b/e2e/pages/adf/process-cloud/processFiltersCloudComponent.ts index 897286e4df..a4871f0fa4 100644 --- a/e2e/pages/adf/process-cloud/processFiltersCloudComponent.ts +++ b/e2e/pages/adf/process-cloud/processFiltersCloudComponent.ts @@ -34,7 +34,7 @@ export class ProcessFiltersCloudComponent { getProcessFilterIcon() { Util.waitUntilElementIsVisible(this.filter); - let icon = this.filter.element(this.filterIcon); + const icon = this.filter.element(this.filterIcon); Util.waitUntilElementIsVisible(icon); return icon.getText(); } diff --git a/e2e/pages/adf/process-cloud/taskFiltersCloudComponent.ts b/e2e/pages/adf/process-cloud/taskFiltersCloudComponent.ts index 28741898fd..c0bc3ef967 100644 --- a/e2e/pages/adf/process-cloud/taskFiltersCloudComponent.ts +++ b/e2e/pages/adf/process-cloud/taskFiltersCloudComponent.ts @@ -34,7 +34,7 @@ export class TaskFiltersCloudComponent { getTaskFilterIcon() { Util.waitUntilElementIsVisible(this.filter); - let icon = this.filter.element(this.taskIcon); + const icon = this.filter.element(this.taskIcon); Util.waitUntilElementIsVisible(icon); return icon.getText(); } diff --git a/e2e/pages/adf/process-cloud/taskListCloudComponent.ts b/e2e/pages/adf/process-cloud/taskListCloudComponent.ts index bb3bfffc94..55bdcdab20 100644 --- a/e2e/pages/adf/process-cloud/taskListCloudComponent.ts +++ b/e2e/pages/adf/process-cloud/taskListCloudComponent.ts @@ -19,7 +19,7 @@ import { Util } from '../../../util/util'; import { DataTableComponentPage } from '../dataTableComponentPage'; import { element, by } from 'protractor'; -let column = { +const column = { id: 'Id' }; @@ -105,7 +105,7 @@ export class TaskListCloudComponent { } getIdCellValue(rowName) { - let locator = new DataTableComponentPage().getCellByRowAndColumn('Name', rowName, column.id); + const locator = new DataTableComponentPage().getCellByRowAndColumn('Name', rowName, column.id); Util.waitUntilElementIsVisible(locator); return locator.getText(); } diff --git a/e2e/pages/adf/process-services/analyticsPage.ts b/e2e/pages/adf/process-services/analyticsPage.ts index ff837660b5..c3afdcc4b8 100644 --- a/e2e/pages/adf/process-services/analyticsPage.ts +++ b/e2e/pages/adf/process-services/analyticsPage.ts @@ -26,7 +26,7 @@ export class AnalyticsPage { reportMessage = element(by.css('div[class="ng-star-inserted"] span')); getReport(title) { - let reportTitle = element(by.css(`mat-icon[data-automation-id="${title}_filter"]`)); + const reportTitle = element(by.css(`mat-icon[data-automation-id="${title}_filter"]`)); Util.waitUntilElementIsVisible(reportTitle); reportTitle.click(); } diff --git a/e2e/pages/adf/process-services/attachmentListPage.ts b/e2e/pages/adf/process-services/attachmentListPage.ts index 82a35f2c95..fdc5004df2 100644 --- a/e2e/pages/adf/process-services/attachmentListPage.ts +++ b/e2e/pages/adf/process-services/attachmentListPage.ts @@ -43,7 +43,7 @@ export class AttachmentListPage { } checkFileIsAttached(name) { - let fileAttached = element.all(by.css('div[filename="' + name + '"]')).first(); + const fileAttached = element.all(by.css('div[filename="' + name + '"]')).first(); Util.waitUntilElementIsVisible(fileAttached); } @@ -88,7 +88,7 @@ export class AttachmentListPage { doubleClickFile(name) { Util.waitUntilElementIsVisible(element.all(by.css('div[filename="' + name + '"]')).first()); - let fileAttached = element.all(by.css('div[filename="' + name + '"]')).first(); + const fileAttached = element.all(by.css('div[filename="' + name + '"]')).first(); Util.waitUntilElementIsVisible(fileAttached); Util.waitUntilElementIsClickable(fileAttached); fileAttached.click(); @@ -96,7 +96,7 @@ export class AttachmentListPage { } checkFileIsRemoved(name) { - let fileAttached = element.all(by.css('div[filename="' + name + '"]')).first(); + const fileAttached = element.all(by.css('div[filename="' + name + '"]')).first(); Util.waitUntilElementIsNotVisible(fileAttached); return this; } diff --git a/e2e/pages/adf/process-services/dialog/startTaskDialog.ts b/e2e/pages/adf/process-services/dialog/startTaskDialog.ts index f805f1665d..52d6435849 100644 --- a/e2e/pages/adf/process-services/dialog/startTaskDialog.ts +++ b/e2e/pages/adf/process-services/dialog/startTaskDialog.ts @@ -56,7 +56,7 @@ export class StartTaskDialog { } selectAssigneeFromList(name) { - let assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); + const assigneeRow = element(by.cssContainingText('mat-option span.adf-people-label-name', name)); Util.waitUntilElementIsVisible(assigneeRow); assigneeRow.click(); Util.waitUntilElementIsNotVisible(assigneeRow); @@ -75,7 +75,7 @@ export class StartTaskDialog { } selectForm(form) { - let option = element(by.cssContainingText('span[class*="mat-option-text"]', form)); + const option = element(by.cssContainingText('span[class*="mat-option-text"]', form)); Util.waitUntilElementIsVisible(option); Util.waitUntilElementIsClickable(option); option.click(); diff --git a/e2e/pages/adf/process-services/filtersPage.ts b/e2e/pages/adf/process-services/filtersPage.ts index c2fbf060f8..5e66ea05a7 100644 --- a/e2e/pages/adf/process-services/filtersPage.ts +++ b/e2e/pages/adf/process-services/filtersPage.ts @@ -30,7 +30,7 @@ export class FiltersPage { } goToFilter(filterName) { - let filter = element(by.css(`span[data-automation-id="${filterName}_filter"]`)); + const filter = element(by.css(`span[data-automation-id="${filterName}_filter"]`)); Util.waitUntilElementIsVisible(filter); filter.click(); return this; diff --git a/e2e/pages/adf/process-services/formFields.ts b/e2e/pages/adf/process-services/formFields.ts index a56bffb4bd..00bef9cdf0 100644 --- a/e2e/pages/adf/process-services/formFields.ts +++ b/e2e/pages/adf/process-services/formFields.ts @@ -34,7 +34,7 @@ export class FormFields { errorMessage = by.css('.adf-error-text-container .adf-error-text'); setFieldValue(locator, field, value) { - let fieldElement = element(locator(field)); + const fieldElement = element(locator(field)); Util.waitUntilElementIsVisible(fieldElement); fieldElement.clear(); fieldElement.sendKeys(value); @@ -42,46 +42,46 @@ export class FormFields { } checkWidgetIsVisible(fieldId) { - let fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first(); + const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first(); Util.waitUntilElementIsVisible(fieldElement); } checkWidgetIsHidden(fieldId) { - let hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`)); + const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`)); Util.waitUntilElementIsVisible(hiddenElement); } getWidget(fieldId) { - let widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); + const widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); Util.waitUntilElementIsVisible(widget); return widget; } getFieldValue(fieldId, valueLocatorParam?: any) { - let value = this.getWidget(fieldId).element(valueLocatorParam || this.valueLocator); + const value = this.getWidget(fieldId).element(valueLocatorParam || this.valueLocator); Util.waitUntilElementIsVisible(value); return value.getAttribute('value'); } getFieldLabel(fieldId, labelLocatorParam?: any) { - let label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first(); + const label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first(); Util.waitUntilElementIsVisible(label); return label.getText(); } getFieldErrorMessage(fieldId) { - let error = this.getWidget(fieldId).element(this.errorMessage); + const error = this.getWidget(fieldId).element(this.errorMessage); return error.getText(); } getFieldText(fieldId, labelLocatorParam?: any) { - let label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator); + const label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator); Util.waitUntilElementIsVisible(label); return label.getText(); } getFieldPlaceHolder(fieldId, locator = 'input') { - let placeHolderLocator = element(by.css(`${locator}#${fieldId}`)).getAttribute('placeholder'); + const placeHolderLocator = element(by.css(`${locator}#${fieldId}`)).getAttribute('placeholder'); Util.waitUntilElementIsVisible(placeHolderLocator); return placeHolderLocator; } @@ -139,14 +139,14 @@ export class FormFields { } selectFormFromDropDown(formName) { - let formNameElement = element(by.cssContainingText('span', formName)); + const formNameElement = element(by.cssContainingText('span', formName)); Util.waitUntilElementIsVisible(formNameElement); formNameElement.click(); } checkWidgetIsReadOnlyMode(fieldId) { - let widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); - let widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]')); + const widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); + const widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]')); Util.waitUntilElementIsVisible(widgetReadOnly); return widgetReadOnly; } @@ -157,7 +157,7 @@ export class FormFields { } setValueInInputById(fieldId, value) { - let input = element(by.id(fieldId)); + const input = element(by.id(fieldId)); Util.waitUntilElementIsVisible(input); input.clear(); input.sendKeys(value); diff --git a/e2e/pages/adf/process-services/processDetailsPage.ts b/e2e/pages/adf/process-services/processDetailsPage.ts index 82f272d19b..8e7ec3a943 100644 --- a/e2e/pages/adf/process-services/processDetailsPage.ts +++ b/e2e/pages/adf/process-services/processDetailsPage.ts @@ -137,7 +137,7 @@ export class ProcessDetailsPage { } checkCommentIsDisplayed(comment) { - let commentInserted = element(by.cssContainingText('div[id="comment-message"]', comment)); + const commentInserted = element(by.cssContainingText('div[id="comment-message"]', comment)); Util.waitUntilElementIsVisible(commentInserted); return this; } diff --git a/e2e/pages/adf/process-services/processFiltersPage.ts b/e2e/pages/adf/process-services/processFiltersPage.ts index 70df30722b..d906393228 100644 --- a/e2e/pages/adf/process-services/processFiltersPage.ts +++ b/e2e/pages/adf/process-services/processFiltersPage.ts @@ -82,13 +82,13 @@ export class ProcessFiltersPage { } selectFromProcessList(title) { - let processName = element.all(by.css(`div[data-automation-id="text_${title}"]`)).first(); + const processName = element.all(by.css(`div[data-automation-id="text_${title}"]`)).first(); Util.waitUntilElementIsVisible(processName); processName.click(); } checkFilterIsHighlighted(filterName) { - let processNameHighlighted = element(by.css(`mat-list-item.adf-active span[data-automation-id='${filterName}_filter']`)); + const processNameHighlighted = element(by.css(`mat-list-item.adf-active span[data-automation-id='${filterName}_filter']`)); Util.waitUntilElementIsVisible(processNameHighlighted); } @@ -114,26 +114,26 @@ export class ProcessFiltersPage { } checkFilterIsDisplayed(name) { - let filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); + const filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); return Util.waitUntilElementIsVisible(filterName); } checkFilterHasNoIcon(name) { - let filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); + const filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); Util.waitUntilElementIsVisible(filterName); return Util.waitUntilElementIsNotOnPage(filterName.element(this.processIcon)); } getFilterIcon(name) { - let filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); + const filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); Util.waitUntilElementIsVisible(filterName); - let icon = filterName.element(this.processIcon); + const icon = filterName.element(this.processIcon); Util.waitUntilElementIsVisible(icon); return icon.getText(); } checkFilterIsNotDisplayed(name) { - let filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); + const filterName = element(by.css(`span[data-automation-id='${name}_filter']`)); return Util.waitUntilElementIsNotVisible(filterName); } diff --git a/e2e/pages/adf/process-services/processServicesPage.ts b/e2e/pages/adf/process-services/processServicesPage.ts index 3187b6c732..97ad72b21b 100644 --- a/e2e/pages/adf/process-services/processServicesPage.ts +++ b/e2e/pages/adf/process-services/processServicesPage.ts @@ -32,7 +32,7 @@ export class ProcessServicesPage { } goToApp(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); Util.waitUntilElementIsVisible(app); app.click(); return new AppNavigationBarPage(); @@ -45,34 +45,34 @@ export class ProcessServicesPage { } getAppIconType(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); Util.waitUntilElementIsVisible(app); - let iconType = app.element(this.iconTypeLocator); + const iconType = app.element(this.iconTypeLocator); Util.waitUntilElementIsVisible(iconType); return iconType.getText(); } getBackgroundColor(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); Util.waitUntilElementIsVisible(app); return app.getCssValue('background-color'); } getDescription(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); Util.waitUntilElementIsVisible(app); - let description = app.element(this.descriptionLocator); + const description = app.element(this.descriptionLocator); Util.waitUntilElementIsVisible(description); return description.getText(); } checkAppIsNotDisplayed(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); return Util.waitUntilElementIsNotOnPage(app); } checkAppIsDisplayed(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); return Util.waitUntilElementIsVisible(app); } diff --git a/e2e/pages/adf/process-services/startProcessPage.ts b/e2e/pages/adf/process-services/startProcessPage.ts index cec499039a..366de7f580 100644 --- a/e2e/pages/adf/process-services/startProcessPage.ts +++ b/e2e/pages/adf/process-services/startProcessPage.ts @@ -82,20 +82,20 @@ export class StartProcessPage { } checkOptionIsDisplayed(name) { - let selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); + const selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); Util.waitUntilElementIsVisible(selectProcessDropdown); Util.waitUntilElementIsClickable(selectProcessDropdown); return this; } checkOptionIsNotDisplayed(name) { - let selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); + const selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); Util.waitUntilElementIsNotOnPage(selectProcessDropdown); return this; } selectOption(name) { - let selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); + const selectProcessDropdown = element(by.cssContainingText('.mat-option-text', name)); Util.waitUntilElementIsVisible(selectProcessDropdown); Util.waitUntilElementIsClickable(selectProcessDropdown); selectProcessDropdown.click(); @@ -140,7 +140,7 @@ export class StartProcessPage { checkSelectProcessPlaceholderIsDisplayed() { Util.waitUntilElementIsVisible(this.processDefinition); - let processPlaceholder = this.processDefinition.getAttribute('value').then(((result) => { + const processPlaceholder = this.processDefinition.getAttribute('value').then(((result) => { return result; })); return processPlaceholder; diff --git a/e2e/pages/adf/process-services/taskDetailsPage.ts b/e2e/pages/adf/process-services/taskDetailsPage.ts index 484c5c5e08..8e7fe2c2d4 100644 --- a/e2e/pages/adf/process-services/taskDetailsPage.ts +++ b/e2e/pages/adf/process-services/taskDetailsPage.ts @@ -104,7 +104,7 @@ export class TaskDetailsPage { } selectAttachFormOption(option) { - let selectedOption = element(by.cssContainingText('mat-option[role="option"]', option)); + const selectedOption = element(by.cssContainingText('mat-option[role="option"]', option)); Util.waitUntilElementIsClickable(selectedOption); return selectedOption.click(); } @@ -218,13 +218,13 @@ export class TaskDetailsPage { } selectActivityTab() { - let tabsPage = new TabsPage; + const tabsPage = new TabsPage; tabsPage.clickTabByTitle('Activity'); return this; } selectDetailsTab() { - let tabsPage = new TabsPage; + const tabsPage = new TabsPage; tabsPage.clickTabByTitle('Details'); return this; } @@ -243,7 +243,7 @@ export class TaskDetailsPage { } checkCommentIsDisplayed(comment) { - let row = element(by.cssContainingText('div[id="comment-message"]', comment)); + const row = element(by.cssContainingText('div[id="comment-message"]', comment)); Util.waitUntilElementIsVisible(row); return this; } @@ -268,7 +268,7 @@ export class TaskDetailsPage { } checkUserIsSelected(user) { - let row = element(by.cssContainingText('div[class*="search-list-container"] div[class*="people-full-name"]', user)); + const row = element(by.cssContainingText('div[class*="search-list-container"] div[class*="people-full-name"]', user)); Util.waitUntilElementIsVisible(row); return this; } @@ -281,13 +281,13 @@ export class TaskDetailsPage { } getRowsUser(user) { - let row = element(by.cssContainingText('div[class*="people-full-name"]', user)); + const row = element(by.cssContainingText('div[class*="people-full-name"]', user)); Util.waitUntilElementIsVisible(row); return row; } removeInvolvedUser(user) { - let row = this.getRowsUser(user).element(by.xpath('ancestor::div[contains(@class, "adf-datatable-row")]')); + const row = this.getRowsUser(user).element(by.xpath('ancestor::div[contains(@class, "adf-datatable-row")]')); Util.waitUntilElementIsVisible(row); row.element(by.css('button[data-automation-id="action_menu_0"]')).click(); Util.waitUntilElementIsVisible(this.removeInvolvedPeople); @@ -295,13 +295,13 @@ export class TaskDetailsPage { } getInvolvedUserEmail(user) { - let email = this.getRowsUser(user).element(this.emailInvolvedUser); + const email = this.getRowsUser(user).element(this.emailInvolvedUser); Util.waitUntilElementIsVisible(email); return email.getText(); } getInvolvedUserEditAction(user) { - let edit = this.getRowsUser(user).element(this.editActionInvolvedUser); + const edit = this.getRowsUser(user).element(this.editActionInvolvedUser); Util.waitUntilElementIsVisible(edit); return edit.getText(); } @@ -367,7 +367,7 @@ export class TaskDetailsPage { } getInvolvedPeopleInitialImage(user) { - let pic = this.getRowsUser(user).element(this.involvedUserPic); + const pic = this.getRowsUser(user).element(this.involvedUserPic); Util.waitUntilElementIsVisible(pic); return pic.getText(); } diff --git a/e2e/pages/adf/process-services/taskFiltersPage.ts b/e2e/pages/adf/process-services/taskFiltersPage.ts index df15e0392f..19e167d081 100644 --- a/e2e/pages/adf/process-services/taskFiltersPage.ts +++ b/e2e/pages/adf/process-services/taskFiltersPage.ts @@ -34,7 +34,7 @@ export class TaskFiltersPage { getTaskFilterIcon() { Util.waitUntilElementIsVisible(this.filter); - let icon = this.filter.element(this.taskIcon); + const icon = this.filter.element(this.taskIcon); Util.waitUntilElementIsVisible(icon); return icon.getText(); } diff --git a/e2e/pages/adf/process-services/tasksPage.ts b/e2e/pages/adf/process-services/tasksPage.ts index 8320319422..c03f26b289 100644 --- a/e2e/pages/adf/process-services/tasksPage.ts +++ b/e2e/pages/adf/process-services/tasksPage.ts @@ -91,13 +91,13 @@ export class TasksPage { } getRowsName(name) { - let row = element(this.checklistContainer).element(by.cssContainingText('span', name)); + const row = element(this.checklistContainer).element(by.cssContainingText('span', name)); Util.waitUntilElementIsVisible(row); return row; } getChecklistByName(checklist) { - let row = this.getRowsName(checklist).element(this.rowByRowName); + const row = this.getRowsName(checklist).element(this.rowByRowName); Util.waitUntilElementIsVisible(row); return row; } @@ -114,7 +114,7 @@ export class TasksPage { checkTaskTitle(taskName) { Util.waitUntilElementIsVisible(element(by.css(this.taskTitle))); - let title = element(by.cssContainingText(this.taskTitle, taskName)); + const title = element(by.cssContainingText(this.taskTitle, taskName)); Util.waitUntilElementIsVisible(title); return this; } @@ -150,14 +150,14 @@ export class TasksPage { } removeChecklists(checklist) { - let row = this.getRowsName(checklist).element(this.rowByRowName); + const row = this.getRowsName(checklist).element(this.rowByRowName); Util.waitUntilElementIsVisible(row.element(by.css('mat-icon'))); row.element(by.css('mat-icon')).click(); return this; } checkChecklistsRemoveButtonIsNotDisplayed(checklist) { - let row = this.getRowsName(checklist).element(this.rowByRowName); + const row = this.getRowsName(checklist).element(this.rowByRowName); Util.waitUntilElementIsNotOnPage(row.element(by.css('mat-icon'))); return this; } diff --git a/e2e/pages/adf/process-services/widgets/amountWidget.ts b/e2e/pages/adf/process-services/widgets/amountWidget.ts index 9bec558abb..10813288df 100644 --- a/e2e/pages/adf/process-services/widgets/amountWidget.ts +++ b/e2e/pages/adf/process-services/widgets/amountWidget.ts @@ -25,7 +25,7 @@ export class AmountWidget { formFields = new FormFields(); getAmountFieldLabel(fieldId) { - let label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); + const label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); Util.waitUntilElementIsVisible(label); return label.getText(); } @@ -41,7 +41,7 @@ export class AmountWidget { removeFromAmountWidget(fieldId) { Util.waitUntilElementIsVisible(this.formFields.getWidget(fieldId)); - let amountWidgetInput = element(by.id(fieldId)); + const amountWidgetInput = element(by.id(fieldId)); amountWidgetInput.getAttribute('value').then((result) => { for (let i = result.length; i >= 0; i--) { amountWidgetInput.sendKeys(protractor.Key.BACK_SPACE); @@ -50,7 +50,7 @@ export class AmountWidget { } clearFieldValue(fieldId) { - let numberField = element(by.id(fieldId)); + const numberField = element(by.id(fieldId)); Util.waitUntilElementIsVisible(numberField); return numberField.clear(); } @@ -60,7 +60,7 @@ export class AmountWidget { } getErrorMessage(fieldId) { - let errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); + const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); Util.waitUntilElementIsVisible(errorMessage); return errorMessage.getText(); } diff --git a/e2e/pages/adf/process-services/widgets/attachFileWidget.ts b/e2e/pages/adf/process-services/widgets/attachFileWidget.ts index c7e46cfbd8..5d54828c1a 100644 --- a/e2e/pages/adf/process-services/widgets/attachFileWidget.ts +++ b/e2e/pages/adf/process-services/widgets/attachFileWidget.ts @@ -31,8 +31,8 @@ export class AttachFileWidget { attachFile(fieldId, fileLocation) { browser.setFileDetector(new remote.FileDetector()); - let widget = this.formFields.getWidget(fieldId); - let uploadButton = widget.element(this.uploadLocator); + const widget = this.formFields.getWidget(fieldId); + const uploadButton = widget.element(this.uploadLocator); Util.waitUntilElementIsVisible(uploadButton); uploadButton.click(); @@ -42,14 +42,14 @@ export class AttachFileWidget { } checkFileIsAttached(fieldId, name) { - let widget = this.formFields.getWidget(fieldId); - let fileAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); + const widget = this.formFields.getWidget(fieldId); + const fileAttached = widget.element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); Util.waitUntilElementIsVisible(fileAttached); return this; } viewFile(name) { - let fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); + const fileView = element(this.filesListLocator).element(by.cssContainingText('mat-list-item span ', name)); Util.waitUntilElementIsVisible(fileView); fileView.click(); browser.actions().doubleClick(fileView).perform(); diff --git a/e2e/pages/adf/process-services/widgets/checkboxWidget.ts b/e2e/pages/adf/process-services/widgets/checkboxWidget.ts index 96af442851..7f5c8889a6 100644 --- a/e2e/pages/adf/process-services/widgets/checkboxWidget.ts +++ b/e2e/pages/adf/process-services/widgets/checkboxWidget.ts @@ -31,7 +31,7 @@ export class CheckboxWidget { } clickCheckboxInput(fieldId) { - let checkboxInput = element.all(by.css(`mat-checkbox[id="${fieldId}"] div`)).first(); + const checkboxInput = element.all(by.css(`mat-checkbox[id="${fieldId}"] div`)).first(); Util.waitUntilElementIsVisible(checkboxInput); return checkboxInput.click(); } diff --git a/e2e/pages/adf/process-services/widgets/dateTimeWidget.ts b/e2e/pages/adf/process-services/widgets/dateTimeWidget.ts index 4b1fd2cf51..f4241e6d6d 100644 --- a/e2e/pages/adf/process-services/widgets/dateTimeWidget.ts +++ b/e2e/pages/adf/process-services/widgets/dateTimeWidget.ts @@ -33,7 +33,7 @@ export class DateTimeWidget { } getDateTimeLabel(fieldId) { - let label = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)); + const label = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)); Util.waitUntilElementIsVisible(label); return label.getText(); } @@ -43,13 +43,13 @@ export class DateTimeWidget { } clearDateTimeInput(fieldId) { - let dateInput = element(by.id(fieldId)); + const dateInput = element(by.id(fieldId)); Util.waitUntilElementIsVisible(dateInput); return dateInput.clear(); } clickOutsideWidget(fieldId) { - let form = this.formFields.getWidget(fieldId); + const form = this.formFields.getWidget(fieldId); Util.waitUntilElementIsVisible(form); return form.click(); } @@ -60,13 +60,13 @@ export class DateTimeWidget { } getErrorMessage(fieldId) { - let errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); + const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); Util.waitUntilElementIsVisible(errorMessage); return errorMessage.getText(); } selectDay(day) { - let selectedDay = element(by.cssContainingText('div[class*="mat-datetimepicker-calendar-body-cell-content"]', day)); + const selectedDay = element(by.cssContainingText('div[class*="mat-datetimepicker-calendar-body-cell-content"]', day)); Util.waitUntilElementIsVisible(selectedDay); return selectedDay.click(); } @@ -76,7 +76,7 @@ export class DateTimeWidget { } private selectTime(time) { - let selectedTime = element(by.cssContainingText('div[class*="mat-datetimepicker-clock-cell"]', time)); + const selectedTime = element(by.cssContainingText('div[class*="mat-datetimepicker-clock-cell"]', time)); Util.waitUntilElementIsClickable(selectedTime); return selectedTime.click(); } @@ -96,7 +96,7 @@ export class DateTimeWidget { removeFromDatetimeWidget(fieldId) { Util.waitUntilElementIsVisible(this.formFields.getWidget(fieldId)); - let amountWidgetInput = element(by.id(fieldId)); + const amountWidgetInput = element(by.id(fieldId)); amountWidgetInput.getAttribute('value').then((result) => { for (let i = result.length; i >= 0; i--) { amountWidgetInput.sendKeys(protractor.Key.BACK_SPACE); diff --git a/e2e/pages/adf/process-services/widgets/dateWidget.ts b/e2e/pages/adf/process-services/widgets/dateWidget.ts index 36274d0c19..c72c2db5d2 100644 --- a/e2e/pages/adf/process-services/widgets/dateWidget.ts +++ b/e2e/pages/adf/process-services/widgets/dateWidget.ts @@ -32,7 +32,7 @@ export class DateWidget { } getDateLabel(fieldId) { - let label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); + const label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); Util.waitUntilElementIsVisible(label); return label.getText(); } @@ -43,19 +43,19 @@ export class DateWidget { } clearDateInput(fieldId) { - let dateInput = element(by.id(fieldId)); + const dateInput = element(by.id(fieldId)); Util.waitUntilElementIsVisible(dateInput); return dateInput.clear(); } clickOutsideWidget(fieldId) { - let form = this.formFields.getWidget(fieldId); + const form = this.formFields.getWidget(fieldId); Util.waitUntilElementIsVisible(form); return form.click(); } getErrorMessage(fieldId) { - let errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); + const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); Util.waitUntilElementIsVisible(errorMessage); return errorMessage.getText(); } @@ -63,7 +63,7 @@ export class DateWidget { removeFromDatetimeWidget(fieldId) { Util.waitUntilElementIsVisible(this.formFields.getWidget(fieldId)); - let dateWidgetInput = element(by.id(fieldId)); + const dateWidgetInput = element(by.id(fieldId)); dateWidgetInput.getAttribute('value').then((result) => { for (let i = result.length; i >= 0; i--) { dateWidgetInput.sendKeys(protractor.Key.BACK_SPACE); diff --git a/e2e/pages/adf/process-services/widgets/dropdownWidget.ts b/e2e/pages/adf/process-services/widgets/dropdownWidget.ts index 9f57bd75d4..500572179f 100644 --- a/e2e/pages/adf/process-services/widgets/dropdownWidget.ts +++ b/e2e/pages/adf/process-services/widgets/dropdownWidget.ts @@ -32,7 +32,7 @@ export class DropdownWidget { selectOption(option) { this.openDropdown(); - let row = element(by.cssContainingText('mat-option span', option)); + const row = element(by.cssContainingText('mat-option span', option)); return row.click(); } diff --git a/e2e/pages/adf/process-services/widgets/dynamicTableWidget.ts b/e2e/pages/adf/process-services/widgets/dynamicTableWidget.ts index 31fe69f206..0369bb98a7 100644 --- a/e2e/pages/adf/process-services/widgets/dynamicTableWidget.ts +++ b/e2e/pages/adf/process-services/widgets/dynamicTableWidget.ts @@ -58,7 +58,7 @@ export class DynamicTableWidget { } clickTableRow(rowNumber) { - let tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); + const tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); Util.waitUntilElementIsVisible(tableRowByIndex); return tableRowByIndex.click(); } @@ -80,18 +80,18 @@ export class DynamicTableWidget { } getTableRowText(rowNumber) { - let tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); + const tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); Util.waitUntilElementIsVisible(tableRowByIndex); return tableRowByIndex.getText(); } checkTableRowIsVisible(rowNumber) { - let tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); + const tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); return Util.waitUntilElementIsVisible(tableRowByIndex); } checkTableRowIsNotVisible(rowNumber) { - let tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); + const tableRowByIndex = element(by.id('dynamictable-row-' + rowNumber)); return Util.waitUntilElementIsNotVisible(tableRowByIndex); } @@ -138,8 +138,8 @@ export class DynamicTableWidget { } checkItemIsPresent(item) { - let row = element(by.cssContainingText('table tbody tr td span', item)); - let present = Util.waitUntilElementIsVisible(row); + const row = element(by.cssContainingText('table tbody tr td span', item)); + const present = Util.waitUntilElementIsVisible(row); expect(present).toBe(true); } } diff --git a/e2e/pages/adf/process-services/widgets/hyperlinkWidget.ts b/e2e/pages/adf/process-services/widgets/hyperlinkWidget.ts index bea2fa4c67..6f3ef56ddf 100644 --- a/e2e/pages/adf/process-services/widgets/hyperlinkWidget.ts +++ b/e2e/pages/adf/process-services/widgets/hyperlinkWidget.ts @@ -30,7 +30,7 @@ export class HyperlinkWidget { } getFieldLabel(fieldId) { - let label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); + const label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); Util.waitUntilElementIsVisible(label); return label.getText(); } diff --git a/e2e/pages/adf/process-services/widgets/numberWidget.ts b/e2e/pages/adf/process-services/widgets/numberWidget.ts index 95f25b8ac4..dcf46b570d 100644 --- a/e2e/pages/adf/process-services/widgets/numberWidget.ts +++ b/e2e/pages/adf/process-services/widgets/numberWidget.ts @@ -24,7 +24,7 @@ export class NumberWidget { formFields = new FormFields(); getNumberFieldLabel(fieldId) { - let label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); + const label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); Util.waitUntilElementIsVisible(label); return label.getText(); } @@ -34,7 +34,7 @@ export class NumberWidget { } clearFieldValue(fieldId) { - let numberField = element(by.id(fieldId)); + const numberField = element(by.id(fieldId)); Util.waitUntilElementIsVisible(numberField); return numberField.clear(); } @@ -44,7 +44,7 @@ export class NumberWidget { } getErrorMessage(fieldId) { - let errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); + const errorMessage = element(by.css(`adf-form-field div[id="field-${fieldId}-container"] div[class="adf-error-text"]`)); Util.waitUntilElementIsVisible(errorMessage); return errorMessage.getText(); } diff --git a/e2e/pages/adf/process-services/widgets/peopleWidget.ts b/e2e/pages/adf/process-services/widgets/peopleWidget.ts index 32e978187a..78fa36aba4 100644 --- a/e2e/pages/adf/process-services/widgets/peopleWidget.ts +++ b/e2e/pages/adf/process-services/widgets/peopleWidget.ts @@ -52,17 +52,17 @@ export class PeopleWidget { } checkUserIsListed(userName) { - let user = element(by.cssContainingText('.adf-people-label-name', userName)); + const user = element(by.cssContainingText('.adf-people-label-name', userName)); return Util.waitUntilElementIsVisible(user); } checkUserNotListed(userName) { - let user = element(by.xpath('div[text()="' + userName + '"]')); + const user = element(by.xpath('div[text()="' + userName + '"]')); return Util.waitUntilElementIsNotVisible(user); } selectUserFromDropDown(userName) { - let user = element(by.cssContainingText('.adf-people-label-name', userName)); + const user = element(by.cssContainingText('.adf-people-label-name', userName)); user.click(); return this; } diff --git a/e2e/pages/adf/process-services/widgets/radioButtonsWidget.ts b/e2e/pages/adf/process-services/widgets/radioButtonsWidget.ts index cac2552117..317c28777e 100644 --- a/e2e/pages/adf/process-services/widgets/radioButtonsWidget.ts +++ b/e2e/pages/adf/process-services/widgets/radioButtonsWidget.ts @@ -26,28 +26,28 @@ export class RadioButtonsWidget { formFields = new FormFields(); getSpecificOptionLabel(fieldId, optionNumber) { - let optionLocator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"]'); + const optionLocator = by.css('label[for*="radiobuttons-option_' + optionNumber + '"]'); - let option = this.formFields.getWidget(fieldId).element(optionLocator); + const option = this.formFields.getWidget(fieldId).element(optionLocator); Util.waitUntilElementIsVisible(option); return option.getText(); } selectOption(fieldId, optionNumber) { - let optionLocator = by.css(`label[for*="${fieldId}-option_${optionNumber}"]`); + const optionLocator = by.css(`label[for*="${fieldId}-option_${optionNumber}"]`); - let option = this.formFields.getWidget(fieldId).element(optionLocator); + const option = this.formFields.getWidget(fieldId).element(optionLocator); Util.waitUntilElementIsVisible(option); return option.click(); } isSelectionClean(fieldId) { - let option = this.formFields.getWidget(fieldId).element(this.selectedOption); + const option = this.formFields.getWidget(fieldId).element(this.selectedOption); return Util.waitUntilElementIsNotVisible(option); } getRadioWidgetLabel(fieldId) { - let label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); + const label = element.all(by.css(`adf-form-field div[id="field-${fieldId}-container"] label`)).first(); Util.waitUntilElementIsVisible(label); return label.getText(); } diff --git a/e2e/pages/adf/process_cloud/editTaskFilterCloudComponent.ts b/e2e/pages/adf/process_cloud/editTaskFilterCloudComponent.ts index f4e1c680a4..2df7b06424 100644 --- a/e2e/pages/adf/process_cloud/editTaskFilterCloudComponent.ts +++ b/e2e/pages/adf/process_cloud/editTaskFilterCloudComponent.ts @@ -43,7 +43,7 @@ export class EditTaskFilterCloudComponent { setStateFilterDropDown(option) { this.clickOnDropDownArrow('status'); - let stateElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const stateElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(stateElement); Util.waitUntilElementIsVisible(stateElement); stateElement.click(); @@ -57,7 +57,7 @@ export class EditTaskFilterCloudComponent { setSortFilterDropDown(option) { this.clickOnDropDownArrow('sort'); - let sortElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const sortElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(sortElement); Util.waitUntilElementIsVisible(sortElement); sortElement.click(); @@ -71,7 +71,7 @@ export class EditTaskFilterCloudComponent { setOrderFilterDropDown(option) { this.clickOnDropDownArrow('order'); - let orderElement = element.all(by.cssContainingText('mat-option span', option)).first(); + const orderElement = element.all(by.cssContainingText('mat-option span', option)).first(); Util.waitUntilElementIsClickable(orderElement); Util.waitUntilElementIsVisible(orderElement); orderElement.click(); @@ -83,7 +83,7 @@ export class EditTaskFilterCloudComponent { } clickOnDropDownArrow(option) { - let dropDownArrow = element(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")); + const dropDownArrow = element(by.css("mat-form-field[data-automation-id='" + option + "'] div[class*='arrow']")); Util.waitUntilElementIsVisible(dropDownArrow); dropDownArrow.click(); Util.waitUntilElementIsVisible(this.selectedOption); diff --git a/e2e/pages/adf/searchResultsPage.ts b/e2e/pages/adf/searchResultsPage.ts index 35c10a7b8b..902fb94daf 100644 --- a/e2e/pages/adf/searchResultsPage.ts +++ b/e2e/pages/adf/searchResultsPage.ts @@ -37,7 +37,7 @@ export class SearchResultsPage { } closeActionButton() { - let container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing')); + const container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing')); Util.waitUntilElementIsVisible(container); container.click(); Util.waitUntilElementIsNotVisible(container); @@ -100,32 +100,32 @@ export class SearchResultsPage { } async checkListIsOrderedByNameAsc() { - let list = await this.contentServices.getElementsDisplayedName(); + const list = await this.contentServices.getElementsDisplayedName(); return this.contentServices.checkElementsSortedAsc(list); } async checkListIsOrderedByNameDesc() { - let list = await this.contentServices.getElementsDisplayedName(); + const list = await this.contentServices.getElementsDisplayedName(); return this.contentServices.checkElementsSortedDesc(list); } async checkListIsOrderedByAuthorAsc() { - let authorList = await this.dataTable.geCellElementDetail('Created by'); + const authorList = await this.dataTable.geCellElementDetail('Created by'); return this.contentServices.checkElementsSortedAsc(authorList); } async checkListIsOrderedByAuthorDesc() { - let authorList = await this.dataTable.geCellElementDetail('Created by'); + const authorList = await this.dataTable.geCellElementDetail('Created by'); return this.contentServices.checkElementsSortedDesc(authorList); } async checkListIsOrderedBySizeAsc() { - let list = await this.contentServices.getElementsDisplayedSize(); + const list = await this.contentServices.getElementsDisplayedSize(); return this.contentServices.checkElementsSortedAsc(list); } async checkListIsOrderedBySizeDesc() { - let list = await this.contentServices.getElementsDisplayedSize(); + const list = await this.contentServices.getElementsDisplayedSize(); return this.contentServices.checkElementsSortedDesc(list); } diff --git a/e2e/pages/adf/tagPage.ts b/e2e/pages/adf/tagPage.ts index 1cbdf0453b..1bd740a4bb 100644 --- a/e2e/pages/adf/tagPage.ts +++ b/e2e/pages/adf/tagPage.ts @@ -65,14 +65,14 @@ export class TagPage { } deleteTagFromTagListByNodeId(name) { - let deleteChip = element(by.id('tag_chips_delete_' + name)); + const deleteChip = element(by.id('tag_chips_delete_' + name)); Util.waitUntilElementIsVisible(deleteChip); deleteChip.click(); return this; } deleteTagFromTagList(name) { - let deleteChip = element(by.id('tag_chips_delete_' + name)); + const deleteChip = element(by.id('tag_chips_delete_' + name)); Util.waitUntilElementIsVisible(deleteChip); deleteChip.click(); return this; @@ -94,22 +94,22 @@ export class TagPage { } checkTagIsDisplayedInTagList(tagName) { - let tag = element(by.cssContainingText('div[id*="tag_name"]', tagName)); + const tag = element(by.cssContainingText('div[id*="tag_name"]', tagName)); return Util.waitUntilElementIsVisible(tag); } checkTagIsNotDisplayedInTagList(tagName) { - let tag = element(by.cssContainingText('div[id*="tag_name"]', tagName)); + const tag = element(by.cssContainingText('div[id*="tag_name"]', tagName)); return Util.waitUntilElementIsNotOnPage(tag); } checkTagIsNotDisplayedInTagListByNodeId(tagName) { - let tag = element(by.cssContainingText('span[id*="tag_name"]', tagName)); + const tag = element(by.cssContainingText('span[id*="tag_name"]', tagName)); return Util.waitUntilElementIsNotOnPage(tag); } checkTagIsDisplayedInTagListByNodeId(tagName) { - let tag = element(by.cssContainingText('span[id*="tag_name"]', tagName)); + const tag = element(by.cssContainingText('span[id*="tag_name"]', tagName)); return Util.waitUntilElementIsVisible(tag); } @@ -122,7 +122,7 @@ export class TagPage { } checkTagIsDisplayedInTagListContentServices(tagName) { - let tag = element(by.cssContainingText('div[class="adf-list-tag"][id*="tag_name"]', tagName)); + const tag = element(by.cssContainingText('div[class="adf-list-tag"][id*="tag_name"]', tagName)); return Util.waitUntilElementIsVisible(tag); } @@ -132,7 +132,7 @@ export class TagPage { } checkTagListIsOrderedAscending() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.checkListIsSorted(false, this.tagListRowLocator).then((result) => { deferred.fulfill(result); }); @@ -140,7 +140,7 @@ export class TagPage { } checkTagListByNodeIdIsOrderedAscending() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.checkListIsSorted(false, this.tagListByNodeIdRowLocator).then((result) => { deferred.fulfill(result); }); @@ -148,7 +148,7 @@ export class TagPage { } checkTagListContentServicesIsOrderedAscending() { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); this.checkListIsSorted(false, this.tagListContentServicesRowLocator).then((result) => { deferred.fulfill(result); }); @@ -156,10 +156,10 @@ export class TagPage { } checkListIsSorted(sortOrder, locator) { - let deferred = protractor.promise.defer(); - let tagList = element.all(locator); + const deferred = protractor.promise.defer(); + const tagList = element.all(locator); Util.waitUntilElementIsVisible(tagList.first()); - let initialList = []; + const initialList = []; tagList.each(function (currentElement) { currentElement.getText().then(function (text) { initialList.push(text); @@ -176,12 +176,12 @@ export class TagPage { } checkDeleteTagFromTagListByNodeIdIsDisplayed(name) { - let deleteChip = element(by.id('tag_chips_delete_' + name)); + const deleteChip = element(by.id('tag_chips_delete_' + name)); return Util.waitUntilElementIsVisible(deleteChip); } checkDeleteTagFromTagListByNodeIdIsNotDisplayed(name) { - let deleteChip = element(by.id('tag_chips_delete_' + name)); + const deleteChip = element(by.id('tag_chips_delete_' + name)); return Util.waitUntilElementIsNotVisible(deleteChip); } diff --git a/e2e/pages/adf/versionManagerPage.ts b/e2e/pages/adf/versionManagerPage.ts index 6b70c98a2f..6bd2c87e3f 100644 --- a/e2e/pages/adf/versionManagerPage.ts +++ b/e2e/pages/adf/versionManagerPage.ts @@ -77,29 +77,29 @@ export class VersionManagePage { } getFileVersionName(version) { - let fileElement = element(by.css(`[id="adf-version-list-item-name-${version}"]`)); + const fileElement = element(by.css(`[id="adf-version-list-item-name-${version}"]`)); Util.waitUntilElementIsVisible(fileElement); return fileElement.getText(); } checkFileVersionExist(version) { - let fileVersion = element(by.id(`adf-version-list-item-version-${version}`)); + const fileVersion = element(by.id(`adf-version-list-item-version-${version}`)); return Util.waitUntilElementIsVisible(fileVersion); } checkFileVersionNotExist(version) { - let fileVersion = element(by.id(`adf-version-list-item-version-${version}`)); + const fileVersion = element(by.id(`adf-version-list-item-version-${version}`)); return Util.waitUntilElementIsNotVisible(fileVersion); } getFileVersionComment(version) { - let fileComment = element(by.id(`adf-version-list-item-comment-${version}`)); + const fileComment = element(by.id(`adf-version-list-item-comment-${version}`)); Util.waitUntilElementIsVisible(fileComment); return fileComment.getText(); } getFileVersionDate(version) { - let fileDate = element(by.id(`adf-version-list-item-date-${version}`)); + const fileDate = element(by.id(`adf-version-list-item-date-${version}`)); Util.waitUntilElementIsVisible(fileDate); return fileDate.getText(); } @@ -113,13 +113,13 @@ export class VersionManagePage { } clickMajorChange() { - let radioMajor = element(by.id(`adf-new-version-major`)); + const radioMajor = element(by.id(`adf-new-version-major`)); Util.waitUntilElementIsVisible(radioMajor); radioMajor.click(); } clickMinorChange() { - let radioMinor = element(by.id(`adf-new-version-minor`)); + const radioMinor = element(by.id(`adf-new-version-minor`)); Util.waitUntilElementIsVisible(radioMinor); radioMinor.click(); } @@ -186,7 +186,7 @@ export class VersionManagePage { } closeActionButton() { - let container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing')); + const container = element(by.css('div.cdk-overlay-backdrop.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing')); Util.waitUntilElementIsVisible(container); container.click(); Util.waitUntilElementIsNotVisible(container); @@ -195,7 +195,7 @@ export class VersionManagePage { downloadFileVersion(version) { this.clickActionButton(version); - let downloadButton = element(by.id(`adf-version-list-action-download-${version}`)); + const downloadButton = element(by.id(`adf-version-list-action-download-${version}`)); Util.waitUntilElementIsVisible(downloadButton); browser.driver.sleep(500); downloadButton.click(); @@ -204,7 +204,7 @@ export class VersionManagePage { deleteFileVersion(version) { this.clickActionButton(version); - let deleteButton = element(by.id(`adf-version-list-action-delete-${version}`)); + const deleteButton = element(by.id(`adf-version-list-action-delete-${version}`)); Util.waitUntilElementIsVisible(deleteButton); browser.driver.sleep(500); deleteButton.click(); @@ -213,7 +213,7 @@ export class VersionManagePage { restoreFileVersion(version) { this.clickActionButton(version); - let restoreButton = element(by.id(`adf-version-list-action-restore-${version}`)); + const restoreButton = element(by.id(`adf-version-list-action-restore-${version}`)); Util.waitUntilElementIsVisible(restoreButton); browser.driver.sleep(500); restoreButton.click(); diff --git a/e2e/pages/adf/viewerPage.ts b/e2e/pages/adf/viewerPage.ts index 0d6798079c..51361a5bad 100644 --- a/e2e/pages/adf/viewerPage.ts +++ b/e2e/pages/adf/viewerPage.ts @@ -103,7 +103,7 @@ export class ViewerPage { } viewFile(fileName) { - let fileView = element.all(by.css(`#document-list-container div[filename="${fileName}"]`)).first(); + const fileView = element.all(by.css(`#document-list-container div[filename="${fileName}"]`)).first(); Util.waitUntilElementIsVisible(fileView); fileView.click(); browser.actions().sendKeys(protractor.Key.ENTER).perform(); @@ -120,7 +120,7 @@ export class ViewerPage { } exitFullScreen() { - let jsCode = 'document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();'; + const jsCode = 'document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();'; browser.executeScript(jsCode); } @@ -155,12 +155,12 @@ export class ViewerPage { } checkAllThumbnailsDisplayed(nbPages) { - let defaultThumbnailHeight = 143; + const defaultThumbnailHeight = 143; expect(this.thumbnailsContent.getAttribute('style')).toEqual('height: ' + nbPages * defaultThumbnailHeight + 'px; transform: translate(-50%, 0px);'); } checkCurrentThumbnailIsSelected() { - let selectedThumbnail = element(by.css('adf-pdf-thumb[class="adf-pdf-thumbnails__thumb ng-star-inserted adf-pdf-thumbnails__thumb--selected"] > img')); + const selectedThumbnail = element(by.css('adf-pdf-thumb[class="adf-pdf-thumbnails__thumb ng-star-inserted adf-pdf-thumbnails__thumb--selected"] > img')); this.pageSelectorInput.getAttribute('value').then((pageNumber) => { browser.controlFlow().execute(async () => { expect('Page ' + pageNumber).toEqual(await selectedThumbnail.getAttribute('title')); @@ -262,10 +262,10 @@ export class ViewerPage { } checkFileContent(pageNumber, text) { - let allPages = element.all(by.css('div[class="canvasWrapper"] > canvas')).first(); - let pageLoaded = element.all(by.css('div[data-page-number="' + pageNumber + '"][data-loaded="true"]')).first(); - let textLayerLoaded = element.all(by.css('div[data-page-number="' + pageNumber + '"] div[class="textLayer"] > div')).first(); - let specificText = element.all(by.cssContainingText('div[data-page-number="' + pageNumber + '"] div[class="textLayer"] > div', text)).first(); + const allPages = element.all(by.css('div[class="canvasWrapper"] > canvas')).first(); + const pageLoaded = element.all(by.css('div[data-page-number="' + pageNumber + '"][data-loaded="true"]')).first(); + const textLayerLoaded = element.all(by.css('div[data-page-number="' + pageNumber + '"] div[class="textLayer"] > div')).first(); + const specificText = element.all(by.cssContainingText('div[data-page-number="' + pageNumber + '"] div[class="textLayer"] > div', text)).first(); Util.waitUntilElementIsVisible(allPages); Util.waitUntilElementIsVisible(pageLoaded); @@ -306,7 +306,7 @@ export class ViewerPage { } checkRotation(text) { - let rotation = this.imgContainer.getAttribute('style'); + const rotation = this.imgContainer.getAttribute('style'); expect(rotation).toEqual(text); } @@ -337,7 +337,7 @@ export class ViewerPage { } checkTabIsActive(tabName) { - let tab = element(by.cssContainingText('.adf-info-drawer-layout-content div.mat-tab-labels div.mat-tab-label-active .mat-tab-label-content', tabName)); + const tab = element(by.cssContainingText('.adf-info-drawer-layout-content div.mat-tab-labels div.mat-tab-label-active .mat-tab-label-content', tabName)); Util.waitUntilElementIsVisible(tab); return this; } diff --git a/e2e/process-services-cloud/edit-process-filters-component.e2e.ts b/e2e/process-services-cloud/edit-process-filters-component.e2e.ts index f87cdc78c5..5f123bd4c4 100644 --- a/e2e/process-services-cloud/edit-process-filters-component.e2e.ts +++ b/e2e/process-services-cloud/edit-process-filters-component.e2e.ts @@ -31,9 +31,9 @@ describe('Edit process filters cloud', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let appListCloudComponent = new AppListCloudPage(); - let tasksCloudDemoPage = new TasksCloudDemoPage(); - let processCloudDemoPage = new ProcessCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const tasksCloudDemoPage = new TasksCloudDemoPage(); + const processCloudDemoPage = new ProcessCloudDemoPage(); let silentLogin; const simpleApp = 'simple-app'; diff --git a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts index efcf177f36..68fe1fc39f 100644 --- a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts +++ b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts @@ -33,8 +33,8 @@ describe('Edit task filters cloud', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let appListCloudComponent = new AppListCloudPage(); - let tasksCloudDemoPage = new TasksCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const tasksCloudDemoPage = new TasksCloudDemoPage(); const tasksService: Tasks = new Tasks(); let silentLogin; diff --git a/e2e/process-services-cloud/process-custom-filters.e2e.ts b/e2e/process-services-cloud/process-custom-filters.e2e.ts index ae48e12fc0..0a8eee4a8f 100644 --- a/e2e/process-services-cloud/process-custom-filters.e2e.ts +++ b/e2e/process-services-cloud/process-custom-filters.e2e.ts @@ -38,9 +38,9 @@ describe('Process list cloud', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let appListCloudComponent = new AppListCloudPage(); - let processCloudDemoPage = new ProcessCloudDemoPage(); - let tasksCloudDemoPage = new TasksCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const processCloudDemoPage = new ProcessCloudDemoPage(); + const tasksCloudDemoPage = new TasksCloudDemoPage(); const tasksService: Tasks = new Tasks(); const processDefinitionService: ProcessDefinitions = new ProcessDefinitions(); @@ -70,7 +70,7 @@ describe('Process list cloud', () => { configEditorPage.clickSaveButton(); await processDefinitionService.init(user, password); - let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); + const processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); await processInstancesService.init(user, password); await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); runningProcessInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); @@ -78,9 +78,9 @@ describe('Process list cloud', () => { completedProcess = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); await queryService.init(user, password); - let task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, simpleApp); + const task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, simpleApp); await tasksService.init(user, password); - let claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, simpleApp); + const claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, simpleApp); await tasksService.completeTask(claimedTask.entry.id, simpleApp); }); @@ -97,14 +97,14 @@ describe('Process list cloud', () => { processCloudDemoPage.editProcessFilterCloudComponent().clickCustomiseFilterHeader().setStatusFilterDropDown('RUNNING') .setSortFilterDropDown('Name').setOrderFilterDropDown('ASC'); processCloudDemoPage.processListCloudComponent().getAllRowsNameColumn().then(function (list) { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(); expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true); }); processCloudDemoPage.editProcessFilterCloudComponent().setOrderFilterDropDown('DESC'); processCloudDemoPage.processListCloudComponent().getAllRowsNameColumn().then(function (list) { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(); list.reverse(); expect(JSON.stringify(initialList) === JSON.stringify(list)).toEqual(true); @@ -116,7 +116,7 @@ describe('Process list cloud', () => { .setSortFilterDropDown('Id').setOrderFilterDropDown('ASC'); processCloudDemoPage.processListCloudComponent().getDataTable().checkSpinnerIsDisplayed().checkSpinnerIsNotDisplayed(); processCloudDemoPage.getAllRowsByIdColumn().then(function (list) { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(function (firstStr, secondStr) { return firstStr.localeCompare(secondStr); }); @@ -126,7 +126,7 @@ describe('Process list cloud', () => { processCloudDemoPage.editProcessFilterCloudComponent().setOrderFilterDropDown('DESC'); processCloudDemoPage.processListCloudComponent().getDataTable().checkSpinnerIsDisplayed().checkSpinnerIsNotDisplayed(); processCloudDemoPage.getAllRowsByIdColumn().then(function (list) { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(function (firstStr, secondStr) { return firstStr.localeCompare(secondStr); }); diff --git a/e2e/process-services-cloud/process-filters-cloud.e2e.ts b/e2e/process-services-cloud/process-filters-cloud.e2e.ts index e9c6731cd4..8360e86f7b 100644 --- a/e2e/process-services-cloud/process-filters-cloud.e2e.ts +++ b/e2e/process-services-cloud/process-filters-cloud.e2e.ts @@ -36,9 +36,9 @@ describe('Process filters cloud', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let appListCloudComponent = new AppListCloudPage(); - let processCloudDemoPage = new ProcessCloudDemoPage(); - let tasksCloudDemoPage = new TasksCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const processCloudDemoPage = new ProcessCloudDemoPage(); + const tasksCloudDemoPage = new TasksCloudDemoPage(); const tasksService: Tasks = new Tasks(); const processDefinitionService: ProcessDefinitions = new ProcessDefinitions(); @@ -58,15 +58,15 @@ describe('Process filters cloud', () => { loginSSOPage.loginSSOIdentityService(user, password); await processDefinitionService.init(user, password); - let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); + const processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); await processInstancesService.init(user, password); runningProcess = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); completedProcess = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); await queryService.init(user, password); - let task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, simpleApp); + const task = await queryService.getProcessInstanceTasks(completedProcess.entry.id, simpleApp); await tasksService.init(user, password); - let claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, simpleApp); + const claimedTask = await tasksService.claimTask(task.list.entries[0].entry.id, simpleApp); await tasksService.completeTask(claimedTask.entry.id, simpleApp); }); diff --git a/e2e/process-services-cloud/processList-cloud-component.e2e.ts b/e2e/process-services-cloud/processList-cloud-component.e2e.ts index 763f945a5c..b733379589 100644 --- a/e2e/process-services-cloud/processList-cloud-component.e2e.ts +++ b/e2e/process-services-cloud/processList-cloud-component.e2e.ts @@ -35,8 +35,8 @@ describe('Process list cloud', () => { const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); const configEditor = new ConfigEditorPage(); - let appListCloudComponent = new AppListCloudPage(); - let processCloudDemoPage = new ProcessCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const processCloudDemoPage = new ProcessCloudDemoPage(); const processDefinitionService: ProcessDefinitions = new ProcessDefinitions(); const processInstancesService: ProcessInstances = new ProcessInstances(); @@ -55,14 +55,14 @@ describe('Process list cloud', () => { loginSSOPage.loginSSOIdentityService(user, password); await processDefinitionService.init(user, password); - let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); + const processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); await processInstancesService.init(user, password); runningProcess = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); }); beforeEach(async (done) => { - let processListCloudConfiguration = new ProcessListCloudConfiguration(); + const processListCloudConfiguration = new ProcessListCloudConfiguration(); jsonFile = processListCloudConfiguration.getConfiguration(); done(); navigationBarPage.clickConfigEditorButton(); diff --git a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts index 388f0bdea5..84a232ced4 100644 --- a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts @@ -156,7 +156,7 @@ describe('Start Task', () => { .setStatusFilterDropDown('CREATED'); tasksCloudDemoPage.taskListCloudComponent().getDataTable().waitForTableBody(); tasksCloudDemoPage.taskListCloudComponent().checkContentIsDisplayedByName(unassignedTaskName); - let taskId = tasksCloudDemoPage.taskListCloudComponent().getIdCellValue(unassignedTaskName); + const taskId = tasksCloudDemoPage.taskListCloudComponent().getIdCellValue(unassignedTaskName); tasksCloudDemoPage.taskListCloudComponent().selectRow(unassignedTaskName); expect(taskHeaderCloudPage.getTaskDetailsHeader()).toContain(taskId); expect(taskHeaderCloudPage.getAssignee()).toBe('No assignee'); diff --git a/e2e/process-services-cloud/task-details-cloud.e2e.ts b/e2e/process-services-cloud/task-details-cloud.e2e.ts index ec6f5a5b4f..e9168e2382 100644 --- a/e2e/process-services-cloud/task-details-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-details-cloud.e2e.ts @@ -33,12 +33,12 @@ import { browser } from 'protractor'; describe('Task Header cloud component', () => { const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword; - let basicCreatedTaskName = Util.generateRandomString(), completedTaskName = Util.generateRandomString(); + const basicCreatedTaskName = Util.generateRandomString(), completedTaskName = Util.generateRandomString(); let basicCreatedTask, basicCreatedDate, completedTask, completedCreatedDate, subTask, subTaskCreatedDate; const simpleApp = 'simple-app'; - let priority = 30, description = 'descriptionTask', formatDate = 'MMM DD YYYY'; + const priority = 30, description = 'descriptionTask', formatDate = 'MMM DD YYYY'; - let taskHeaderCloudPage = new TaskHeaderCloudPage(); + const taskHeaderCloudPage = new TaskHeaderCloudPage(); const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); @@ -57,19 +57,19 @@ describe('Task Header cloud component', () => { loginSSOPage.loginSSOIdentityService(user, password); await tasksService.init(user, password); - let createdTaskId = await tasksService.createStandaloneTask(basicCreatedTaskName, simpleApp); + const createdTaskId = await tasksService.createStandaloneTask(basicCreatedTaskName, simpleApp); await tasksService.claimTask(createdTaskId.entry.id, simpleApp); basicCreatedTask = await tasksService.getTask(createdTaskId.entry.id, simpleApp); basicCreatedDate = moment(basicCreatedTask.entry.createdDate).format(formatDate); - let completedTaskId = await tasksService.createStandaloneTask(completedTaskName, + const completedTaskId = await tasksService.createStandaloneTask(completedTaskName, simpleApp, {priority: priority, description: description, dueDate: basicCreatedTask.entry.createdDate}); await tasksService.claimTask(completedTaskId.entry.id, simpleApp); await tasksService.completeTask(completedTaskId.entry.id, simpleApp); completedTask = await tasksService.getTask(completedTaskId.entry.id, simpleApp); completedCreatedDate = moment(completedTask.entry.createdDate).format(formatDate); - let subTaskId = await tasksService.createStandaloneSubtask(createdTaskId.entry.id, simpleApp, Util.generateRandomString()); + const subTaskId = await tasksService.createStandaloneSubtask(createdTaskId.entry.id, simpleApp, Util.generateRandomString()); await tasksService.claimTask(subTaskId.entry.id, simpleApp); subTask = await tasksService.getTask(subTaskId.entry.id, simpleApp); subTaskCreatedDate = moment(subTask.entry.createdDate).format(formatDate); diff --git a/e2e/process-services-cloud/task-filters-cloud.e2e.ts b/e2e/process-services-cloud/task-filters-cloud.e2e.ts index 78f02c74f8..304c2d0a87 100644 --- a/e2e/process-services-cloud/task-filters-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-filters-cloud.e2e.ts @@ -32,8 +32,8 @@ describe('Task filters cloud', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let appListCloudComponent = new AppListCloudPage(); - let tasksCloudDemoPage = new TasksCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const tasksCloudDemoPage = new TasksCloudDemoPage(); const tasksService: Tasks = new Tasks(); const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword; @@ -63,7 +63,7 @@ describe('Task filters cloud', () => { it('[C290009] Should display default filters and created task', async () => { await tasksService.init(user, password); - let task = await tasksService.createStandaloneTask(newTask, simpleApp); + const task = await tasksService.createStandaloneTask(newTask, simpleApp); await tasksService.claimTask(task.entry.id, simpleApp); tasksCloudDemoPage.completedTasksFilter().clickTaskFilter(); @@ -78,7 +78,7 @@ describe('Task filters cloud', () => { it('[C289955] Should display task in Complete Tasks List when task is completed', async () => { await tasksService.init(user, password); - let task = await tasksService.createStandaloneTask(completedTask, simpleApp); + const task = await tasksService.createStandaloneTask(completedTask, simpleApp); await tasksService.claimTask(task.entry.id, simpleApp); await tasksService.completeTask(task.entry.id, simpleApp); diff --git a/e2e/process-services-cloud/task-list-properties.e2e.ts b/e2e/process-services-cloud/task-list-properties.e2e.ts index 3428bc06b7..cd73ae7cfc 100644 --- a/e2e/process-services-cloud/task-list-properties.e2e.ts +++ b/e2e/process-services-cloud/task-list-properties.e2e.ts @@ -42,29 +42,29 @@ describe('Edit task filters and task list properties', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let appListCloudComponent = new AppListCloudPage(); - let tasksCloudDemoPage = new TasksCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const tasksCloudDemoPage = new TasksCloudDemoPage(); const tasksService: Tasks = new Tasks(); const processDefinitionService: ProcessDefinitions = new ProcessDefinitions(); const processInstancesService: ProcessInstances = new ProcessInstances(); - let notificationPage = new NotificationPage(); + const notificationPage = new NotificationPage(); let silentLogin; const simpleApp = 'simple-app'; const candidateUserApp = 'candidateuserapp'; - let noTasksFoundMessage = 'No Tasks Found'; + const noTasksFoundMessage = 'No Tasks Found'; const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword; let createdTask, notAssigned, notDisplayedTask, processDefinition, processInstance, priorityTask, subTask; - let priority = 30; + const priority = 30; - let beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY'); - let currentDate = DateUtil.formatDate('DD/MM/YYYY'); - let afterDate = moment().add(1, 'days').format('DD/MM/YYYY'); + const beforeDate = moment().add(-1, 'days').format('DD/MM/YYYY'); + const currentDate = DateUtil.formatDate('DD/MM/YYYY'); + const afterDate = moment().add(1, 'days').format('DD/MM/YYYY'); beforeAll(async (done) => { silentLogin = false; - let jsonFile = new TaskListCloudConfiguration().getConfiguration(); + const jsonFile = new TaskListCloudConfiguration().getConfiguration(); settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; diff --git a/e2e/process-services-cloud/task-list-selection.e2e.ts b/e2e/process-services-cloud/task-list-selection.e2e.ts index 7d184a9b84..b2c9c14af9 100644 --- a/e2e/process-services-cloud/task-list-selection.e2e.ts +++ b/e2e/process-services-cloud/task-list-selection.e2e.ts @@ -32,16 +32,17 @@ describe('Task list cloud - selection', () => { const settingsPage = new SettingsPage(); const loginSSOPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let appListCloudComponent = new AppListCloudPage(); - let tasksCloudDemoPage = new TasksCloudDemoPage(); + const appListCloudComponent = new AppListCloudPage(); + const tasksCloudDemoPage = new TasksCloudDemoPage(); const tasksService: Tasks = new Tasks(); let silentLogin; const simpleApp = 'simple-app'; const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword; - let noOfTasks = 3, response; - let tasks = []; + const noOfTasks = 3; + let response; + const tasks = []; beforeAll(async (done) => { silentLogin = false; diff --git a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts index acdda666c3..b92b12db77 100644 --- a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts +++ b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts @@ -49,8 +49,9 @@ describe('Task filters cloud', () => { const simpleApp = 'simple-app'; const user = TestConfig.adf.adminEmail, password = TestConfig.adf.adminPassword; let assignedTask, deletedTask, suspendedTasks; - let orderByNameAndPriority = ['cCreatedTask', 'dCreatedTask', 'eCreatedTask']; - let priority = 30, nrOfTasks = 3; + const orderByNameAndPriority = ['cCreatedTask', 'dCreatedTask', 'eCreatedTask']; + let priority = 30; + const nrOfTasks = 3; beforeAll(async () => { silentLogin = false; @@ -73,10 +74,10 @@ describe('Task filters cloud', () => { } await processDefinitionService.init(user, password); - let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); + const processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); await processInstancesService.init(user, password); - let processInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); - let secondProcessInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); + const processInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); + const secondProcessInstance = await processInstancesService.createProcessInstance(processDefinition.list.entries[0].entry.key, simpleApp); await queryService.init(user, password); suspendedTasks = await queryService.getProcessInstanceTasks(processInstance.entry.id, simpleApp); await queryService.getProcessInstanceTasks(secondProcessInstance.entry.id, simpleApp); @@ -147,7 +148,7 @@ describe('Task filters cloud', () => { tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed(); tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed(); tasksCloudDemoPage.taskListCloudComponent().getAllRowsNameColumn().then( (list) => { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(function (firstStr, secondStr) { return firstStr.localeCompare(secondStr); }); @@ -158,7 +159,7 @@ describe('Task filters cloud', () => { tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed(); tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed(); tasksCloudDemoPage.taskListCloudComponent().getAllRowsNameColumn().then( (list) => { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(function (firstStr, secondStr) { return firstStr.localeCompare(secondStr); }); @@ -174,7 +175,7 @@ describe('Task filters cloud', () => { tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed(); tasksCloudDemoPage.getAllRowsByIdColumn().then((list) => { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(function (firstStr, secondStr) { return firstStr.localeCompare(secondStr); }); @@ -185,7 +186,7 @@ describe('Task filters cloud', () => { tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsDisplayed(); tasksCloudDemoPage.taskListCloudComponent().getDataTable().checkSpinnerIsNotDisplayed(); tasksCloudDemoPage.getAllRowsByIdColumn().then((list) => { - let initialList = list.slice(0); + const initialList = list.slice(0); list.sort(function (firstStr, secondStr) { return firstStr.localeCompare(secondStr); }); diff --git a/e2e/process-services/apps-section.e2e.ts b/e2e/process-services/apps-section.e2e.ts index 81f41ea622..48af7cc2f4 100644 --- a/e2e/process-services/apps-section.e2e.ts +++ b/e2e/process-services/apps-section.e2e.ts @@ -32,18 +32,18 @@ import { ModelsActions } from '../actions/APS/models.actions'; describe('Modify applications', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let processServicesPage = new ProcessServicesPage(); - let app = resources.Files.APP_WITH_PROCESSES; - let appToBeDeleted = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let replacingApp = resources.Files.WIDGETS_SMOKE_TEST; - let apps = new AppsActions(); - let modelActions = new ModelsActions(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const app = resources.Files.APP_WITH_PROCESSES; + const appToBeDeleted = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const replacingApp = resources.Files.WIDGETS_SMOKE_TEST; + const apps = new AppsActions(); + const modelActions = new ModelsActions(); let firstApp, appVersionToBeDeleted; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -52,7 +52,7 @@ describe('Modify applications', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let user = await users.createTenantAndUser(this.alfrescoJsApi); + const user = await users.createTenantAndUser(this.alfrescoJsApi); await this.alfrescoJsApi.login(user.email, user.password); @@ -145,7 +145,7 @@ describe('Modify applications', () => { }); it('[C260207] Should the app be updated when is edited in APS', async () => { - let newDescription = 'new description'; + const newDescription = 'new description'; navigationBarPage.navigateToProcessServicesPage(); processServicesPage.checkApsContainer(); @@ -154,7 +154,7 @@ describe('Modify applications', () => { expect(processServicesPage.getBackgroundColor(appToBeDeleted.title)).toEqual(CONSTANTS.APP_COLOR.ORANGE); expect(processServicesPage.getDescription(appToBeDeleted.title)).toEqual(appToBeDeleted.description); - let appDefinition = {'appDefinition': {'id': appVersionToBeDeleted.id, 'name': appToBeDeleted.title, + const appDefinition = {'appDefinition': {'id': appVersionToBeDeleted.id, 'name': appToBeDeleted.title, 'description': newDescription, 'definition': {'models': [firstApp.definition.models[0]], 'theme': 'theme-4', 'icon': 'glyphicon-user'}}, 'publish': true}; diff --git a/e2e/process-services/attach-file-widget.e2e.ts b/e2e/process-services/attach-file-widget.e2e.ts index 078c0cba16..7eaa724f31 100644 --- a/e2e/process-services/attach-file-widget.e2e.ts +++ b/e2e/process-services/attach-file-widget.e2e.ts @@ -35,20 +35,20 @@ import { UsersActions } from '../actions/users.actions'; describe('Start Task - Task App', () => { - let loginPage = new LoginPage(); - let viewerPage = new ViewerPage(); - let widget = new Widget(); - let taskPage = new TasksPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const viewerPage = new ViewerPage(); + const widget = new Widget(); + const taskPage = new TasksPage(); + const navigationBarPage = new NavigationBarPage(); let processUserModel; - let app = resources.Files.WIDGETS_SMOKE_TEST; - let pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name }); - let appFields = app.form_fields; + const app = resources.Files.WIDGETS_SMOKE_TEST; + const pdfFile = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PDF.file_name }); + const appFields = app.form_fields; beforeAll(async (done) => { - let users = new UsersActions(); - let apps = new AppsActions(); + const users = new UsersActions(); + const apps = new AppsActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', diff --git a/e2e/process-services/attach-form-component.e2e.ts b/e2e/process-services/attach-form-component.e2e.ts index 0593698dce..31730e5b36 100644 --- a/e2e/process-services/attach-form-component.e2e.ts +++ b/e2e/process-services/attach-form-component.e2e.ts @@ -33,17 +33,17 @@ import { by } from 'protractor'; describe('Attach Form Component', () => { - let loginPage = new LoginPage(); - let taskPage = new TasksPage(); - let attachFormPage = new AttachFormPage(); - let formFields = new FormFields(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const taskPage = new TasksPage(); + const attachFormPage = new AttachFormPage(); + const formFields = new FormFields(); + const navigationBarPage = new NavigationBarPage(); - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let formTextField = app.form_fields.form_fieldId; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const formTextField = app.form_fields.form_fieldId; let user, tenantId, appId; - let testNames = { + const testNames = { taskName: 'Test Task', formTitle: 'Select Form To Attach', formName: 'Simple form', @@ -62,8 +62,8 @@ describe('Attach Form Component', () => { }); beforeEach(async (done) => { - let users = new UsersActions(); - let appsActions = new AppsActions(); + const users = new UsersActions(); + const appsActions = new AppsActions(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); @@ -73,7 +73,7 @@ describe('Attach Form Component', () => { await this.alfrescoJsApi.login(user.email, user.password); - let appModel = await appsActions.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const appModel = await appsActions.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = appModel.id; diff --git a/e2e/process-services/checklist-component.e2e.ts b/e2e/process-services/checklist-component.e2e.ts index bf7d649b35..822035851e 100644 --- a/e2e/process-services/checklist-component.e2e.ts +++ b/e2e/process-services/checklist-component.e2e.ts @@ -35,20 +35,20 @@ import { browser } from 'protractor'; describe('Checklist component', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let taskPage = new TasksPage(); + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const taskPage = new TasksPage(); const processServices = new ProcessServicesPage(); const checklistDialog = new ChecklistDialog(); - let tasks = ['no checklist created task', 'checklist number task', 'remove running checklist', 'remove completed checklist', 'hierarchy']; - let checklists = ['cancelCheckList', 'dialogChecklist', 'addFirstChecklist', 'addSecondChecklist']; - let removeChecklist = ['removeFirstRunningChecklist', 'removeSecondRunningChecklist', 'removeFirstCompletedChecklist', 'removeSecondCompletedChecklist']; - let hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild']; + const tasks = ['no checklist created task', 'checklist number task', 'remove running checklist', 'remove completed checklist', 'hierarchy']; + const checklists = ['cancelCheckList', 'dialogChecklist', 'addFirstChecklist', 'addSecondChecklist']; + const removeChecklist = ['removeFirstRunningChecklist', 'removeSecondRunningChecklist', 'removeFirstCompletedChecklist', 'removeSecondCompletedChecklist']; + const hierarchyChecklist = ['checklistOne', 'checklistTwo', 'checklistOneChild', 'checklistTwoChild']; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -57,12 +57,12 @@ describe('Checklist component', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); - let pathFile = path.join(TestConfig.main.rootPath + app.file_location); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + app.file_location); + const file = fs.createReadStream(pathFile); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); diff --git a/e2e/process-services/comment-component-processes.e2e.ts b/e2e/process-services/comment-component-processes.e2e.ts index 7b8d1f0045..ea3b883321 100644 --- a/e2e/process-services/comment-component-processes.e2e.ts +++ b/e2e/process-services/comment-component-processes.e2e.ts @@ -30,12 +30,12 @@ import { AppsActions } from '../actions/APS/apps.actions'; describe('Comment component for Processes', () => { - let loginPage = new LoginPage(); - let processFiltersPage = new ProcessFiltersPage(); - let commentsPage = new CommentsPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const processFiltersPage = new ProcessFiltersPage(); + const commentsPage = new CommentsPage(); + const navigationBarPage = new NavigationBarPage(); - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; let user, tenantId, appId, processInstanceId, comment, taskComment, addedComment; beforeAll(async(done) => { @@ -44,8 +44,8 @@ describe('Comment component for Processes', () => { hostBpm: TestConfig.adf.url }); - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); @@ -55,10 +55,10 @@ describe('Comment component for Processes', () => { await this.alfrescoJsApi.login(user.email, user.password); - let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = importedApp.id; - let processWithComment = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Comment APS'); + const processWithComment = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Comment APS'); processInstanceId = processWithComment.id; await loginPage.loginToProcessServicesUsingUserModel(user); @@ -113,20 +113,20 @@ describe('Comment component for Processes', () => { processFiltersPage.selectFromProcessList('Comment APS'); browser.controlFlow().execute(async() => { - let taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId}); + const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId}); - let taskId = taskQuery.data[0].id; + const taskId = taskQuery.data[0].id; - let taskComments = await this.alfrescoJsApi.activiti.commentsApi.getTaskComments(taskId, {'latestFirst': true}); + const taskComments = await this.alfrescoJsApi.activiti.commentsApi.getTaskComments(taskId, {'latestFirst': true}); expect(taskComments.total).toEqual(0); }); }); it('[C260466] Should be able to display comments from Task on the related Process', () => { browser.controlFlow().execute(async() => { - let taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId}); + const taskQuery = await this.alfrescoJsApi.activiti.taskApi.listTasks({processInstanceId: processInstanceId}); - let taskId = taskQuery.data[0].id; + const taskId = taskQuery.data[0].id; taskComment = {message: 'Task Comment'}; @@ -139,7 +139,7 @@ describe('Comment component for Processes', () => { processFiltersPage.selectFromProcessList('Comment APS'); browser.controlFlow().execute(async() => { - let addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, {'latestFirst': true}); + const addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, {'latestFirst': true}); commentsPage.checkUserIconIsDisplayed(0); diff --git a/e2e/process-services/comment-component-tasks.e2e.ts b/e2e/process-services/comment-component-tasks.e2e.ts index 3463827786..9084373e67 100644 --- a/e2e/process-services/comment-component-tasks.e2e.ts +++ b/e2e/process-services/comment-component-tasks.e2e.ts @@ -33,15 +33,15 @@ import { AppsActions } from '../actions/APS/apps.actions'; describe('Comment component for Processes', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let taskPage = new TasksPage(); - let commentsPage = new CommentsPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const taskPage = new TasksPage(); + const commentsPage = new CommentsPage(); - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; let user, tenantId, appId, secondUser, newTaskId; - let taskName = { + const taskName = { completed_task: 'Test Completed', multiple_users: 'Test Comment multiple users' }; @@ -53,8 +53,8 @@ describe('Comment component for Processes', () => { hostBpm: TestConfig.adf.url }); - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); @@ -66,7 +66,7 @@ describe('Comment component for Processes', () => { await this.alfrescoJsApi.login(user.email, user.password); - let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = importedApp.id; await loginPage.loginToProcessServicesUsingUserModel(user); @@ -86,9 +86,9 @@ describe('Comment component for Processes', () => { it('[C260237] Should not be able to add a comment on a completed task', () => { browser.controlFlow().execute(async() => { - let newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: taskName.completed_task}); + const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: taskName.completed_task}); - let taskId = newTask.id; + const taskId = newTask.id; this.alfrescoJsApi.activiti.taskActionsApi.completeTask(taskId); }); @@ -103,14 +103,14 @@ describe('Comment component for Processes', () => { it('[C212864] Should be able to add multiple comments on a single task using different users', () => { browser.controlFlow().execute(async() => { - let newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: taskName.multiple_users}); + const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: taskName.multiple_users}); newTaskId = newTask.id; await this.alfrescoJsApi.activiti.taskApi.involveUser(newTaskId, {email: secondUser.email}); - let taskComment = {message: 'Task Comment'}; - let secondTaskComment = {message: 'Second Task Comment'}; + const taskComment = {message: 'Task Comment'}; + const secondTaskComment = {message: 'Second Task Comment'}; await this.alfrescoJsApi.activiti.taskApi.addTaskComment(taskComment, newTaskId); await this.alfrescoJsApi.activiti.taskApi.addTaskComment(secondTaskComment, newTaskId); @@ -123,9 +123,9 @@ describe('Comment component for Processes', () => { taskPage.taskDetails().selectActivityTab(); browser.controlFlow().execute(async() => { - let totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, {'latestFirst': true}); + const totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, {'latestFirst': true}); - let thirdTaskComment = {message: 'Third Task Comment'}; + const thirdTaskComment = {message: 'Third Task Comment'}; await commentsPage.checkUserIconIsDisplayed(0); await commentsPage.checkUserIconIsDisplayed(1); @@ -153,7 +153,7 @@ describe('Comment component for Processes', () => { taskPage.taskDetails().selectActivityTab(); browser.controlFlow().execute(async() => { - let totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, {'latestFirst': true}); + const totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, {'latestFirst': true}); await commentsPage.checkUserIconIsDisplayed(0); await commentsPage.checkUserIconIsDisplayed(1); diff --git a/e2e/process-services/custom-process-filters-sorting.e2e.ts b/e2e/process-services/custom-process-filters-sorting.e2e.ts index 1d06b82313..c383d5e635 100644 --- a/e2e/process-services/custom-process-filters-sorting.e2e.ts +++ b/e2e/process-services/custom-process-filters-sorting.e2e.ts @@ -31,17 +31,17 @@ import { AppsActions } from '../actions/APS/apps.actions'; describe('Sorting for process filters', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let processFiltersPage = new ProcessFiltersPage(); - let filtersPage = new FiltersPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processFiltersPage = new ProcessFiltersPage(); + const filtersPage = new FiltersPage(); - let apps = new AppsActions(); + const apps = new AppsActions(); - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; let tenantId, appId, user, processesQuery; - let processFilter = { + const processFilter = { running_old_first: 'Running - Oldest first', completed_old_first: 'Completed - Oldest first', all_old_first: 'All - Oldest first', @@ -62,7 +62,7 @@ describe('Sorting for process filters', () => { }); beforeEach(async(done) => { - let users = new UsersActions(); + const users = new UsersActions(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); @@ -71,7 +71,7 @@ describe('Sorting for process filters', () => { await this.alfrescoJsApi.login(user.email, user.password); - let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = importedApp.id; loginPage.loginToProcessServicesUsingUserModel(user); @@ -122,9 +122,9 @@ describe('Sorting for process filters', () => { 'filter': {'sort': 'created-asc', 'name': '', 'state': 'completed'} }); - let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); - let secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); - let thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); + const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); + const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); + const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id); @@ -163,9 +163,9 @@ describe('Sorting for process filters', () => { await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); - let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4'); - let secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5'); - let thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6'); + const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4'); + const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5'); + const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6'); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id); @@ -236,9 +236,9 @@ describe('Sorting for process filters', () => { 'filter': {'sort': 'created-desc', 'name': '', 'state': 'completed'} }); - let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); - let secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); - let thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); + const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); + const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); + const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id); @@ -277,9 +277,9 @@ describe('Sorting for process filters', () => { await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); - let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4'); - let secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5'); - let thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6'); + const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 4'); + const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 5'); + const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 6'); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id); @@ -317,9 +317,9 @@ describe('Sorting for process filters', () => { 'filter': {'sort': 'ended-asc', 'name': '', 'state': 'completed'} }); - let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); - let secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); - let thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); + const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); + const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); + const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id); @@ -354,9 +354,9 @@ describe('Sorting for process filters', () => { 'filter': {'sort': 'ended-desc', 'name': '', 'state': 'completed'} }); - let firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); - let secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); - let thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); + const firstProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 1'); + const secondProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 2'); + const thirdProc = await apps.startProcess(this.alfrescoJsApi, 'Task App', 'Process 3'); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(secondProc.id); await this.alfrescoJsApi.activiti.processInstancesApi.deleteProcessInstance(firstProc.id); diff --git a/e2e/process-services/custom-process-filters.e2e.ts b/e2e/process-services/custom-process-filters.e2e.ts index 1c70e05501..8e403f8ddf 100644 --- a/e2e/process-services/custom-process-filters.e2e.ts +++ b/e2e/process-services/custom-process-filters.e2e.ts @@ -30,15 +30,15 @@ import { UsersActions } from '../actions/users.actions'; describe('New Process Filters', () => { - let loginPage = new LoginPage(); - let processFiltersPage = new ProcessFiltersPage(); - let appNavigationBarPage = new AppNavigationBarPage(); - let appSettingsToggles = new AppSettingsToggles(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const processFiltersPage = new ProcessFiltersPage(); + const appNavigationBarPage = new AppNavigationBarPage(); + const appSettingsToggles = new AppSettingsToggles(); + const navigationBarPage = new NavigationBarPage(); let tenantId, user, filterId, customProcessFilter; - let processFilter = { + const processFilter = { running: 'Running', all: 'All', completed: 'Completed', @@ -50,7 +50,7 @@ describe('New Process Filters', () => { }; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', diff --git a/e2e/process-services/custom-tasks-filters.e2e.ts b/e2e/process-services/custom-tasks-filters.e2e.ts index 5bd1d32cbe..298326c2ca 100644 --- a/e2e/process-services/custom-tasks-filters.e2e.ts +++ b/e2e/process-services/custom-tasks-filters.e2e.ts @@ -35,31 +35,33 @@ import { DateUtil } from '../util/dateUtil'; describe('Start Task - Custom App', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let taskListSinglePage = new TaskListDemoPage(); - let paginationPage = new PaginationPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const taskListSinglePage = new TaskListDemoPage(); + const paginationPage = new PaginationPage(); let processUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; let appRuntime, secondAppRuntime; - let secondApp = resources.Files.WIDGETS_SMOKE_TEST; + const secondApp = resources.Files.WIDGETS_SMOKE_TEST; let appModel, secondAppModel; - let completedTasks = []; - let paginationTasksName = ['t01', 't02', 't03', 't04', 't05', 't06', 't07', 't08', 't09', 't10', 't11', 't12', 't13', 'taskOne', 'taskTwo', 'taskOne']; - let completedTasksName = ['completed01', 'completed02', 'completed03']; - let allTasksName = ['t01', 'taskOne', 'taskTwo', 'taskOne', 't13', 't12', 't11', 't10', 't09', 't08', 't07', 't06', 't05', 't04', 't03', 't02', + const completedTasks = []; + const paginationTasksName = ['t01', 't02', 't03', 't04', 't05', 't06', 't07', 't08', 't09', 't10', 't11', 't12', 't13', 'taskOne', 'taskTwo', 'taskOne']; + const completedTasksName = ['completed01', 'completed02', 'completed03']; + const allTasksName = ['t01', 'taskOne', 'taskTwo', 'taskOne', 't13', 't12', 't11', 't10', 't09', 't08', 't07', 't06', 't05', 't04', 't03', 't02', 'User Task', 'User Task', 'User Task', 'User Task']; - let invalidAppId = '1234567890', invalidName = 'invalidName', invalidTaskId = '0000'; - let noTasksFoundMessage = 'No Tasks Found'; - let nrOfTasks = 20, currentPage = 1, totalNrOfPages = 'of 4'; - let currentDateStandardFormat = DateUtil.formatDate('YYYY-MM-DDTHH:mm:ss.SSSZ'); - let currentDate = DateUtil.formatDate('MM/DD/YYYY'); - let beforeDate = moment().add(-1, 'days').format('MM/DD/YYYY'); - let afterDate = moment().add(1, 'days').format('MM/DD/YYYY'); + const invalidAppId = '1234567890', invalidName = 'invalidName', invalidTaskId = '0000'; + const noTasksFoundMessage = 'No Tasks Found'; + const nrOfTasks = 20; + let currentPage = 1; + const totalNrOfPages = 'of 4'; + const currentDateStandardFormat = DateUtil.formatDate('YYYY-MM-DDTHH:mm:ss.SSSZ'); + const currentDate = DateUtil.formatDate('MM/DD/YYYY'); + const beforeDate = moment().add(-1, 'days').format('MM/DD/YYYY'); + const afterDate = moment().add(1, 'days').format('MM/DD/YYYY'); let taskWithDueDate; let processDefinitionId; - let itemsPerPage = { + const itemsPerPage = { five: '5', fiveValue: 5, ten: '10', @@ -72,9 +74,9 @@ describe('Start Task - Custom App', () => { }; beforeAll(async (done) => { - let apps = new AppsActions(); - let appsRuntime = new AppsRuntimeActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const appsRuntime = new AppsRuntimeActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -83,7 +85,7 @@ describe('Start Task - Custom App', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); @@ -516,7 +518,7 @@ describe('Start Task - Custom App', () => { // failing due to ADF-3667, blocked by ACTIVITI-1975 xit('[C286599] Should be able to sort tasks ascending by due date when choosing due(asc) from sort drop down', () => { - let sortAscByDueDate = [taskWithDueDate.name, completedTasks[0].name, completedTasks[1].name, completedTasks[2].name]; + const sortAscByDueDate = [taskWithDueDate.name, completedTasks[0].name, completedTasks[1].name, completedTasks[2].name]; navigationBarPage.clickTaskListButton(); taskListSinglePage.clickResetButton(); @@ -542,7 +544,7 @@ describe('Start Task - Custom App', () => { // failing due to ADF-3667, blocked by ACTIVITI-1975 xit('[C286600] Should be able to sort tasks descending by due date when choosing due(desc) from sort drop down', () => { - let sortDescByDueDate = [completedTasks[2].name, completedTasks[1].name, completedTasks[0].name, taskWithDueDate.name]; + const sortDescByDueDate = [completedTasks[2].name, completedTasks[1].name, completedTasks[0].name, taskWithDueDate.name]; navigationBarPage.clickTaskListButton(); taskListSinglePage.clickResetButton(); @@ -567,7 +569,7 @@ describe('Start Task - Custom App', () => { }); it('[C286622] Should be able to see only tasks that are part of a specific process when processDefinitionId is set', () => { - let processDefinitionIds = [processDefinitionId.processDefinitionId, processDefinitionId.processDefinitionId, + const processDefinitionIds = [processDefinitionId.processDefinitionId, processDefinitionId.processDefinitionId, processDefinitionId.processDefinitionId, processDefinitionId.processDefinitionId]; navigationBarPage.clickTaskListButton(); @@ -591,7 +593,7 @@ describe('Start Task - Custom App', () => { }); it('[C286622] Should be able to see only tasks that are part of a specific process when processInstanceId is set', () => { - let processInstanceIds = [processDefinitionId.id]; + const processInstanceIds = [processDefinitionId.id]; navigationBarPage.clickTaskListButton(); taskListSinglePage.clickResetButton(); diff --git a/e2e/process-services/dynamic-table-date-picker.e2e.ts b/e2e/process-services/dynamic-table-date-picker.e2e.ts index b2f0bcfbe0..2a8987158f 100644 --- a/e2e/process-services/dynamic-table-date-picker.e2e.ts +++ b/e2e/process-services/dynamic-table-date-picker.e2e.ts @@ -32,12 +32,12 @@ import { UsersActions } from '../actions/users.actions'; describe('Dynamic Table', () => { - let loginPage = new LoginPage(); - let processFiltersPage = new ProcessFiltersPage(); - let appNavigationBarPage = new AppNavigationBarPage(); - let dynamicTable = new DynamicTableWidget(); - let datePicker = new DatePickerPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const processFiltersPage = new ProcessFiltersPage(); + const appNavigationBarPage = new AppNavigationBarPage(); + const dynamicTable = new DynamicTableWidget(); + const datePicker = new DatePickerPage(); + const navigationBarPage = new NavigationBarPage(); let user, tenantId, appId, apps, users; beforeAll(async(done) => { @@ -67,20 +67,20 @@ describe('Dynamic Table', () => { }); describe('Date Picker', () => { - let app = resources.Files.DYNAMIC_TABLE_APP; + const app = resources.Files.DYNAMIC_TABLE_APP; - let randomText = { + const randomText = { date: 'HELLO WORLD', dateTime: 'Test', error: `Field 'columnDate' is required.` }; - let rowPosition = 0; + const rowPosition = 0; beforeAll(async(done) => { await this.alfrescoJsApi.login(user.email, user.password); - let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = importedApp.id; await loginPage.loginToProcessServicesUsingUserModel(user); @@ -128,14 +128,14 @@ describe('Dynamic Table', () => { }); describe('Required Dropdown', () => { - let app = resources.Files.APP_DYNAMIC_TABLE_DROPDOWN; - let dropdown = new DropdownWidget(); + const app = resources.Files.APP_DYNAMIC_TABLE_DROPDOWN; + const dropdown = new DropdownWidget(); beforeAll(async(done) => { await this.alfrescoJsApi.login(user.email, user.password); - let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = importedApp.id; await loginPage.loginToProcessServicesUsingUserModel(user); @@ -161,7 +161,7 @@ describe('Dynamic Table', () => { }); it('[C286519] Should be able to save row with required dropdown column', () => { - let dropdownOption = 'Option 1'; + const dropdownOption = 'Option 1'; dynamicTable.clickAddButton(); dropdown.selectOption(dropdownOption); dynamicTable.clickSaveButton(); diff --git a/e2e/process-services/empty-process-list-component.e2e.ts b/e2e/process-services/empty-process-list-component.e2e.ts index a741cd0ecc..b682d04caa 100644 --- a/e2e/process-services/empty-process-list-component.e2e.ts +++ b/e2e/process-services/empty-process-list-component.e2e.ts @@ -31,22 +31,22 @@ import { UsersActions } from '../actions/users.actions'; describe('Empty Process List Test', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let processServicesPage = new ProcessServicesPage(); - let processFiltersPage = new ProcessFiltersPage(); - let processDetailsPage = new ProcessDetailsPage(); - let processListPage = new ProcessListPage(); - let startProcessPage = new StartProcessPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const processFiltersPage = new ProcessFiltersPage(); + const processDetailsPage = new ProcessDetailsPage(); + const processListPage = new ProcessListPage(); + const startProcessPage = new StartProcessPage(); - let appA = resources.Files.APP_WITH_PROCESSES; - let appB = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const appA = resources.Files.APP_WITH_PROCESSES; + const appB = resources.Files.SIMPLE_APP_WITH_USER_FORM; let user; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', diff --git a/e2e/process-services/form-component.e2e.ts b/e2e/process-services/form-component.e2e.ts index c1147093c9..21972bb5ad 100644 --- a/e2e/process-services/form-component.e2e.ts +++ b/e2e/process-services/form-component.e2e.ts @@ -37,13 +37,13 @@ describe('Form Component', () => { let tenantId, user; - let fields = { + const fields = { dateWidgetId: 'label7', numberWidgetId: 'label4', amountWidgetId: 'label11' }; - let message = { + const message = { test: 'Text Test', warningNumberAndAmount: 'Use a different number format', warningDate: 'D-M-YYYY', @@ -59,7 +59,7 @@ describe('Form Component', () => { hostBpm: TestConfig.adf.url }); - let users = new UsersActions(); + const users = new UsersActions(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); diff --git a/e2e/process-services/form-people-widget.e2e.ts b/e2e/process-services/form-people-widget.e2e.ts index f80945ea6a..83b45cc6ca 100644 --- a/e2e/process-services/form-people-widget.e2e.ts +++ b/e2e/process-services/form-people-widget.e2e.ts @@ -34,21 +34,21 @@ import { browser } from 'protractor'; describe('Form widgets - People', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let app = resources.Files.APP_WITH_USER_WIDGET; - let processFiltersPage = new ProcessFiltersPage(); + const app = resources.Files.APP_WITH_USER_WIDGET; + const processFiltersPage = new ProcessFiltersPage(); let appModel; let alfrescoJsApi; - let widget = new Widget(); - let startProcess = new StartProcessPage(); - let processDetailsPage = new ProcessDetailsPage(); - let taskDetails = new TaskDetailsPage(); - let appNavigationBar = new AppNavigationBarPage(); + const widget = new Widget(); + const startProcess = new StartProcessPage(); + const processDetailsPage = new ProcessDetailsPage(); + const taskDetails = new TaskDetailsPage(); + const appNavigationBar = new AppNavigationBarPage(); beforeAll(async (done) => { - let users = new UsersActions(); - let appsActions = new AppsActions(); + const users = new UsersActions(); + const appsActions = new AppsActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -94,9 +94,9 @@ describe('Form widgets - People', () => { processDetailsPage.clickOnActiveTask(); browser.controlFlow().execute(async () => { - let taskId = await taskDetails.getId(); - let taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId); - let userEmail = taskForm['fields'][0].fields['1'][0].value.email; + const taskId = await taskDetails.getId(); + const taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId); + const userEmail = taskForm['fields'][0].fields['1'][0].value.email; expect(userEmail).toEqual(processUserModel.email); }); }); @@ -117,9 +117,9 @@ describe('Form widgets - People', () => { processDetailsPage.clickOnCompletedTask(); browser.controlFlow().execute(async () => { - let taskId = await taskDetails.getId(); - let taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId); - let userEmail = taskForm['fields'][0].fields['1'][0].value.email; + const taskId = await taskDetails.getId(); + const taskForm = await alfrescoJsApi.activiti.taskApi.getTaskForm(taskId); + const userEmail = taskForm['fields'][0].fields['1'][0].value.email; expect(userEmail).toEqual(processUserModel.email); }); }); diff --git a/e2e/process-services/form-widgets-component.e2e.ts b/e2e/process-services/form-widgets-component.e2e.ts index 6b7fef4e94..07ad107a41 100644 --- a/e2e/process-services/form-widgets-component.e2e.ts +++ b/e2e/process-services/form-widgets-component.e2e.ts @@ -33,24 +33,24 @@ import { AppsActions } from '../actions/APS/apps.actions'; import { UsersActions } from '../actions/users.actions'; import { browser } from 'protractor'; -let formInstance = new FormDefinitionModel(); +const formInstance = new FormDefinitionModel(); describe('Form widgets', () => { let alfrescoJsApi; - let taskPage = new TasksPage(); - let newTask = 'First task'; - let loginPage = new LoginPage(); + const taskPage = new TasksPage(); + const newTask = 'First task'; + const loginPage = new LoginPage(); let processUserModel; let appModel; - let widget = new Widget(); + const widget = new Widget(); describe('Form widgets', () => { - let app = resources.Files.WIDGETS_SMOKE_TEST; - let appFields = app.form_fields; + const app = resources.Files.WIDGETS_SMOKE_TEST; + const appFields = app.form_fields; beforeAll(async (done) => { - let users = new UsersActions(); - let appsActions = new AppsActions(); + const users = new UsersActions(); + const appsActions = new AppsActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -178,7 +178,7 @@ describe('Form widgets', () => { }); it('[C272785] Should display checkbox and radio button in form', () => { - let radioOption = 1; + const radioOption = 1; expect(taskPage.formFields().getFieldLabel(appFields.checkbox_id)) .toContain(formInstance.getWidgetBy('id', appFields.checkbox_id).name); @@ -211,13 +211,13 @@ describe('Form widgets', () => { describe('with fields involving other people', () => { - let appsActions = new AppsActions(); - let app = resources.Files.FORM_ADF; + const appsActions = new AppsActions(); + const app = resources.Files.FORM_ADF; let deployedApp, process; - let appFields = app.form_fields; + const appFields = app.form_fields; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -231,7 +231,7 @@ describe('Form widgets', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, app.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -241,7 +241,7 @@ describe('Form widgets', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/pagination-processlist-addingProcesses.e2e.ts b/e2e/process-services/pagination-processlist-addingProcesses.e2e.ts index 90fc71def3..71db5dc9a9 100644 --- a/e2e/process-services/pagination-processlist-addingProcesses.e2e.ts +++ b/e2e/process-services/pagination-processlist-addingProcesses.e2e.ts @@ -31,26 +31,26 @@ import { browser } from 'protractor'; describe('Process List - Pagination when adding processes', () => { - let itemsPerPage = { + const itemsPerPage = { fifteen: '15', fifteenValue: 15 }; - let loginPage = new LoginPage(); - let paginationPage = new PaginationPage(); - let processFiltersPage = new ProcessFiltersPage(); - let processDetailsPage = new ProcessDetailsPage(); + const loginPage = new LoginPage(); + const paginationPage = new PaginationPage(); + const processFiltersPage = new ProcessFiltersPage(); + const processDetailsPage = new ProcessDetailsPage(); let processUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let nrOfProcesses = 25; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const nrOfProcesses = 25; let page, totalPages; let i; - let apps = new AppsActions(); + const apps = new AppsActions(); let resultApp; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', diff --git a/e2e/process-services/pagination-tasklist-addingTasks.e2e.ts b/e2e/process-services/pagination-tasklist-addingTasks.e2e.ts index 385bf8d31b..0516b6fcd5 100644 --- a/e2e/process-services/pagination-tasklist-addingTasks.e2e.ts +++ b/e2e/process-services/pagination-tasklist-addingTasks.e2e.ts @@ -32,23 +32,27 @@ import { browser } from 'protractor'; describe('Items per page set to 15 and adding of tasks', () => { - let loginPage = new LoginPage(); - let taskPage = new TasksPage(); - let paginationPage = new PaginationPage(); + const loginPage = new LoginPage(); + const taskPage = new TasksPage(); + const paginationPage = new PaginationPage(); let processUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let currentPage = 1, nrOfTasks = 25, totalPages = 2, i, resultApp; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + let currentPage = 1; + const nrOfTasks = 25; + const totalPages = 2; + let i; + let resultApp; - let apps = new AppsActions(); + const apps = new AppsActions(); - let itemsPerPage = { + const itemsPerPage = { fifteen: '15', fifteenValue: 15 }; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', diff --git a/e2e/process-services/people-component.e2e.ts b/e2e/process-services/people-component.e2e.ts index 0da1fbf159..cb9f11c0e7 100644 --- a/e2e/process-services/people-component.e2e.ts +++ b/e2e/process-services/people-component.e2e.ts @@ -35,18 +35,18 @@ import { browser } from 'protractor'; describe('People component', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); let processUserModel, assigneeUserModel, secondAssigneeUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let taskPage = new TasksPage(); - let peopleTitle = 'People this task is shared with '; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const taskPage = new TasksPage(); + const peopleTitle = 'People this task is shared with '; const processServices = new ProcessServicesPage(); - let tasks = ['no people involved task', 'remove people task', 'can not complete task', 'multiple users', 'completed filter']; + const tasks = ['no people involved task', 'remove people task', 'can not complete task', 'multiple users', 'completed filter']; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -55,7 +55,7 @@ describe('People component', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); assigneeUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); @@ -63,8 +63,8 @@ describe('People component', () => { processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); - let pathFile = path.join(TestConfig.main.rootPath + app.file_location); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + app.file_location); + const file = fs.createReadStream(pathFile); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); diff --git a/e2e/process-services/process-attachmentList-actionMenu.e2e.ts b/e2e/process-services/process-attachmentList-actionMenu.e2e.ts index 0ef2d1bae0..edfeb6e9fa 100644 --- a/e2e/process-services/process-attachmentList-actionMenu.e2e.ts +++ b/e2e/process-services/process-attachmentList-actionMenu.e2e.ts @@ -36,21 +36,21 @@ import { browser } from 'protractor'; describe('Attachment list action menu for processes', () => { - let loginPage = new LoginPage(); - let processFiltersPage = new ProcessFiltersPage(); - let processDetailsPage = new ProcessDetailsPage(); - let attachmentListPage = new AttachmentListPage(); - let navigationBarPage = new NavigationBarPage(); - let viewerPage = new ViewerPage(); - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let pngFile = new FileModel({ + const loginPage = new LoginPage(); + const processFiltersPage = new ProcessFiltersPage(); + const processDetailsPage = new ProcessDetailsPage(); + const attachmentListPage = new AttachmentListPage(); + const navigationBarPage = new NavigationBarPage(); + const viewerPage = new ViewerPage(); + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const pngFile = new FileModel({ location: resources.Files.ADF_DOCUMENTS.PNG.file_location, name: resources.Files.ADF_DOCUMENTS.PNG.file_name }); - let downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name); + const downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name); let tenantId, appId; - let processName = { + const processName = { active: 'Active Process', completed: 'Completed Process', taskApp: 'Task App Name', @@ -59,8 +59,8 @@ describe('Attachment list action menu for processes', () => { }; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -69,13 +69,13 @@ describe('Attachment list action menu for processes', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let user = await users.createTenantAndUser(this.alfrescoJsApi); + const user = await users.createTenantAndUser(this.alfrescoJsApi); tenantId = user.tenantId; await this.alfrescoJsApi.login(user.email, user.password); - let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = importedApp.id; await apps.startProcess(this.alfrescoJsApi, importedApp, processName.completed); diff --git a/e2e/process-services/process-filters-component.e2e.ts b/e2e/process-services/process-filters-component.e2e.ts index 67f0df957f..a052ee2467 100644 --- a/e2e/process-services/process-filters-component.e2e.ts +++ b/e2e/process-services/process-filters-component.e2e.ts @@ -35,31 +35,31 @@ import { browser } from 'protractor'; describe('Process Filters Test', () => { - let loginPage = new LoginPage(); - let processListPage = new ProcessListPage(); - let navigationBarPage = new NavigationBarPage(); - let processServicesPage = new ProcessServicesPage(); - let startProcessPage = new StartProcessPage(); - let processFiltersPage = new ProcessFiltersPage(); - let appNavigationBarPage = new AppNavigationBarPage(); - let processDetailsPage = new ProcessDetailsPage(); + const loginPage = new LoginPage(); + const processListPage = new ProcessListPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const startProcessPage = new StartProcessPage(); + const processFiltersPage = new ProcessFiltersPage(); + const appNavigationBarPage = new AppNavigationBarPage(); + const processDetailsPage = new ProcessDetailsPage(); let appModel; - let app = resources.Files.APP_WITH_DATE_FIELD_FORM; + const app = resources.Files.APP_WITH_DATE_FIELD_FORM; - let processTitle = { + const processTitle = { running: 'Test_running', completed: 'Test_completed' }; - let processFilter = { + const processFilter = { running: 'Running', all: 'All', completed: 'Completed' }; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -68,7 +68,7 @@ describe('Process Filters Test', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let user = await users.createTenantAndUser(this.alfrescoJsApi); + const user = await users.createTenantAndUser(this.alfrescoJsApi); await this.alfrescoJsApi.login(user.email, user.password); @@ -132,12 +132,12 @@ describe('Process Filters Test', () => { it('[C280407] Should be able to access the filters with URL', async () => { - let defaultFiltersNumber = 3; + const defaultFiltersNumber = 3; let deployedApp, processFilterUrl; - let taskAppFilters = await browser.controlFlow().execute(async() => { + const taskAppFilters = await browser.controlFlow().execute(async() => { - let appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { diff --git a/e2e/process-services/processList-component.e2e.ts b/e2e/process-services/processList-component.e2e.ts index 670f12cc63..19e8179ce4 100644 --- a/e2e/process-services/processList-component.e2e.ts +++ b/e2e/process-services/processList-component.e2e.ts @@ -31,20 +31,20 @@ describe('Process List Test', () => { const loginPage = new LoginPage(); const processListDemoPage = new ProcessListDemoPage(); - let appWithDateField = resources.Files.APP_WITH_DATE_FIELD_FORM; - let appWithUserWidget = resources.Files.APP_WITH_USER_WIDGET; + const appWithDateField = resources.Files.APP_WITH_DATE_FIELD_FORM; + const appWithUserWidget = resources.Files.APP_WITH_USER_WIDGET; let appDateModel, appUserWidgetModel, user; - let processList = ['Process With Date', 'Process With Date 2', 'Process With User Widget', 'Process With User Widget 2']; + const processList = ['Process With Date', 'Process With Date 2', 'Process With User Widget', 'Process With User Widget 2']; - let processName = { + const processName = { procWithDate: 'Process With Date', completedProcWithDate: 'Process With Date 2', procWithUserWidget: 'Process With User Widget', completedProcWithUserWidget: 'Process With User Widget 2' }; - let errorMessages = { + const errorMessages = { appIdNumber: 'App ID must be a number', insertAppId: 'Insert App ID' }; @@ -53,8 +53,8 @@ describe('Process List Test', () => { let procWithDate, completedProcWithDate, completedProcWithUserWidget; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -79,8 +79,8 @@ describe('Process List Test', () => { appWithDateFieldId = await apps.getAppDefinitionId(this.alfrescoJsApi, appDateModel.id); - let procWithDateTaskId = await apps.getProcessTaskId(this.alfrescoJsApi, completedProcWithDate.id); - let procWithUserWidgetTaskId = await apps.getProcessTaskId(this.alfrescoJsApi, completedProcWithUserWidget.id); + const procWithDateTaskId = await apps.getProcessTaskId(this.alfrescoJsApi, completedProcWithDate.id); + const procWithUserWidgetTaskId = await apps.getProcessTaskId(this.alfrescoJsApi, completedProcWithUserWidget.id); await this.alfrescoJsApi.activiti.taskApi.completeTaskForm(procWithDateTaskId, {values: {label: null }}); await this.alfrescoJsApi.activiti.taskFormsApi.completeTaskForm(procWithUserWidgetTaskId, {values: {label: null }}); diff --git a/e2e/process-services/processlist-pagination.e2e.ts b/e2e/process-services/processlist-pagination.e2e.ts index 336d773e49..0b9344c47e 100644 --- a/e2e/process-services/processlist-pagination.e2e.ts +++ b/e2e/process-services/processlist-pagination.e2e.ts @@ -30,7 +30,7 @@ import { UsersActions } from '../actions/users.actions'; describe('Process List - Pagination', function () { - let itemsPerPage = { + const itemsPerPage = { five: '5', fiveValue: 5, ten: '10', @@ -42,22 +42,24 @@ describe('Process List - Pagination', function () { default: '25' }; - let processFilterRunning = 'Running'; + const processFilterRunning = 'Running'; - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let paginationPage = new PaginationPage(); - let processFiltersPage = new ProcessFiltersPage(); - let processDetailsPage = new ProcessDetailsPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const paginationPage = new PaginationPage(); + const processFiltersPage = new ProcessFiltersPage(); + const processDetailsPage = new ProcessDetailsPage(); let deployedTestApp; let processUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let nrOfProcesses = 20; - let page, totalPages, processNameBase = 'process'; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const nrOfProcesses = 20; + let page; + let totalPages; + const processNameBase = 'process'; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -89,7 +91,7 @@ describe('Process List - Pagination', function () { describe('With processes Pagination', function () { beforeAll(async (done) => { - let apps = new AppsActions(); + const apps = new AppsActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', diff --git a/e2e/process-services/sort-tasklist-pagination.e2e.ts b/e2e/process-services/sort-tasklist-pagination.e2e.ts index e5919a711a..ac7205b20b 100644 --- a/e2e/process-services/sort-tasklist-pagination.e2e.ts +++ b/e2e/process-services/sort-tasklist-pagination.e2e.ts @@ -32,16 +32,17 @@ import { UsersActions } from '../actions/users.actions'; describe('Task List Pagination - Sorting', () => { - let loginPage = new LoginPage(); - let taskPage = new TasksPage(); - let paginationPage = new PaginationPage(); + const loginPage = new LoginPage(); + const taskPage = new TasksPage(); + const paginationPage = new PaginationPage(); - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let nrOfTasks = 20, processUserModel; - let taskNameBase = 'Task'; - let taskNames = Util.generateSequenceFiles(10, nrOfTasks + 9, taskNameBase, ''); + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const nrOfTasks = 20; + let processUserModel; + const taskNameBase = 'Task'; + const taskNames = Util.generateSequenceFiles(10, nrOfTasks + 9, taskNameBase, ''); - let itemsPerPage = { + const itemsPerPage = { five: '5', fiveValue: 5, ten: '10', @@ -51,8 +52,8 @@ describe('Task List Pagination - Sorting', () => { }; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', diff --git a/e2e/process-services/standalone-task.e2e.ts b/e2e/process-services/standalone-task.e2e.ts index 0e77fd077e..56cd579b67 100644 --- a/e2e/process-services/standalone-task.e2e.ts +++ b/e2e/process-services/standalone-task.e2e.ts @@ -36,16 +36,16 @@ import path = require('path'); describe('Start Task - Task App', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); let processUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let taskPage = new TasksPage(); - let tasks = ['Standalone task', 'Completed standalone task', 'Add a form', 'Remove form']; - let noFormMessage = 'No forms attached'; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const taskPage = new TasksPage(); + const tasks = ['Standalone task', 'Completed standalone task', 'Add a form', 'Remove form']; + const noFormMessage = 'No forms attached'; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -54,12 +54,12 @@ describe('Start Task - Task App', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); - let pathFile = path.join(TestConfig.main.rootPath + app.file_location); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + app.file_location); + const file = fs.createReadStream(pathFile); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); diff --git a/e2e/process-services/start-process-component.e2e.ts b/e2e/process-services/start-process-component.e2e.ts index 715bfad82a..be45253e7f 100644 --- a/e2e/process-services/start-process-component.e2e.ts +++ b/e2e/process-services/start-process-component.e2e.ts @@ -41,26 +41,26 @@ import path = require('path'); describe('Start Process Component', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let processServicesPage = new ProcessServicesPage(); - let startProcessPage = new StartProcessPage(); - let processFiltersPage = new ProcessFiltersPage(); - let appNavigationBarPage = new AppNavigationBarPage(); - let processDetailsPage = new ProcessDetailsPage(); - let attachmentListPage = new AttachmentListPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const startProcessPage = new StartProcessPage(); + const processFiltersPage = new ProcessFiltersPage(); + const appNavigationBarPage = new AppNavigationBarPage(); + const processDetailsPage = new ProcessDetailsPage(); + const attachmentListPage = new AttachmentListPage(); const apps = new AppsActions(); - let app = resources.Files.APP_WITH_PROCESSES; - let simpleApp = resources.Files.WIDGETS_SMOKE_TEST; + const app = resources.Files.APP_WITH_PROCESSES; + const simpleApp = resources.Files.WIDGETS_SMOKE_TEST; let appId, procUserModel, secondProcUserModel, tenantId, simpleAppCreated; - let processModelWithSe = 'process_with_se', processModelWithoutSe = 'process_without_se'; + const processModelWithSe = 'process_with_se', processModelWithoutSe = 'process_without_se'; const processName255Characters = Util.generateRandomString(255); const processNameBiggerThen255Characters = Util.generateRandomString(256); const lengthValidationError = 'Length exceeded, 255 characters max.'; - let auditLogFile = path.join('../e2e/download/', 'Audit.pdf'); + const auditLogFile = path.join('../e2e/download/', 'Audit.pdf'); - let jpgFile = new FileModel({ + const jpgFile = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.JPG.file_location, 'name': resources.Files.ADF_DOCUMENTS.JPG.file_name }); @@ -73,7 +73,7 @@ describe('Start Process Component', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); tenantId = newTenant.id; procUserModel = new User({ tenantId: tenantId }); @@ -89,7 +89,7 @@ describe('Start Process Component', () => { await this.alfrescoJsApiUserTwo.login(secondProcUserModel.email, secondProcUserModel.password); - let appCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, app.file_location); + const appCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, app.file_location); simpleAppCreated = await apps.importPublishDeployApp(this.alfrescoJsApiUserTwo, simpleApp.file_location); @@ -197,7 +197,7 @@ describe('Start Process Component', () => { startProcessPage.clickFormStartProcessButton(); processDetailsPage.checkDetailsAreDisplayed(); browser.controlFlow().execute(async () => { - let processId = await processDetailsPage.getId(); + const processId = await processDetailsPage.getId(); await this.alfrescoJsApi.activiti.processApi.getProcessInstance(processId).then(function (response) { expect(processDetailsPage.getProcessStatus()).toEqual(CONSTANTS.PROCESS_STATUS.RUNNING); expect(processDetailsPage.getEndDate()).toEqual(CONSTANTS.PROCESS_END_DATE); diff --git a/e2e/process-services/start-task-custom-app.e2e.ts b/e2e/process-services/start-task-custom-app.e2e.ts index 34ba464179..240bae6944 100644 --- a/e2e/process-services/start-task-custom-app.e2e.ts +++ b/e2e/process-services/start-task-custom-app.e2e.ts @@ -38,28 +38,28 @@ import CONSTANTS = require('../util/constants'); describe('Start Task - Custom App', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let attachmentListPage = new AttachmentListPage(); - let appNavigationBarPage = new AppNavigationBarPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const attachmentListPage = new AttachmentListPage(); + const appNavigationBarPage = new AppNavigationBarPage(); let processUserModel, assigneeUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let formTextField = app.form_fields.form_fieldId; - let formFieldValue = 'First value '; - let taskPage = new TasksPage(); - let firstComment = 'comm1', firstChecklist = 'checklist1'; - let tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File', 'Spinner']; - let showHeaderTask = 'Show Header'; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const formTextField = app.form_fields.form_fieldId; + const formFieldValue = 'First value '; + const taskPage = new TasksPage(); + const firstComment = 'comm1', firstChecklist = 'checklist1'; + const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File', 'Spinner']; + const showHeaderTask = 'Show Header'; let appModel; - let pngFile = new FileModel({ + const pngFile = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location, 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name }); beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -68,7 +68,7 @@ describe('Start Task - Custom App', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); assigneeUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); diff --git a/e2e/process-services/start-task-task-app.e2e.ts b/e2e/process-services/start-task-task-app.e2e.ts index 1b12c915fd..fbe87390ff 100644 --- a/e2e/process-services/start-task-task-app.e2e.ts +++ b/e2e/process-services/start-task-task-app.e2e.ts @@ -39,29 +39,29 @@ import path = require('path'); describe('Start Task - Task App', () => { - let loginPage = new LoginPage(); - let attachmentListPage = new AttachmentListPage(); - let appNavigationBarPage = new AppNavigationBarPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const attachmentListPage = new AttachmentListPage(); + const appNavigationBarPage = new AppNavigationBarPage(); + const navigationBarPage = new NavigationBarPage(); let processUserModel, assigneeUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let formTextField = app.form_fields.form_fieldId; - let formFieldValue = 'First value '; - let taskPage = new TasksPage(); - let firstComment = 'comm1', firstChecklist = 'checklist1'; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const formTextField = app.form_fields.form_fieldId; + const formFieldValue = 'First value '; + const taskPage = new TasksPage(); + const firstComment = 'comm1', firstChecklist = 'checklist1'; const taskName255Characters = Util.generateRandomString(255); const taskNameBiggerThen255Characters = Util.generateRandomString(256); const lengthValidationError = 'Length exceeded, 255 characters max.'; - let tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File']; - let showHeaderTask = 'Show Header'; - let jpgFile = new FileModel({ + const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File']; + const showHeaderTask = 'Show Header'; + const jpgFile = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.JPG.file_location, 'name': resources.Files.ADF_DOCUMENTS.JPG.file_name }); beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -70,14 +70,14 @@ describe('Start Task - Task App', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); assigneeUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); - let pathFile = path.join(TestConfig.main.rootPath + app.file_location); - let file = fs.createReadStream(pathFile); + const pathFile = path.join(TestConfig.main.rootPath + app.file_location); + const file = fs.createReadStream(pathFile); await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); diff --git a/e2e/process-services/task-attachmentList-actionMenu.e2e.ts b/e2e/process-services/task-attachmentList-actionMenu.e2e.ts index fa99f0b788..c20dcb1134 100644 --- a/e2e/process-services/task-attachmentList-actionMenu.e2e.ts +++ b/e2e/process-services/task-attachmentList-actionMenu.e2e.ts @@ -39,19 +39,19 @@ import { FileModel } from '../models/ACS/fileModel'; describe('Attachment list action menu for tasks', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let taskPage = new TasksPage(); - let attachmentListPage = new AttachmentListPage(); - let viewerPage = new ViewerPage(); - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let pngFile = new FileModel({ + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const taskPage = new TasksPage(); + const attachmentListPage = new AttachmentListPage(); + const viewerPage = new ViewerPage(); + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const pngFile = new FileModel({ location: resources.Files.ADF_DOCUMENTS.PNG.file_location, name: resources.Files.ADF_DOCUMENTS.PNG.file_name }); - let downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name); + const downloadedPngFile = path.join(__dirname, 'downloads', pngFile.name); let tenantId, appId, relatedContent, relatedContentId; - let taskName = { + const taskName = { active: 'Active Task', completed: 'Completed Task', taskApp: 'Task App Name', @@ -59,8 +59,8 @@ describe('Attachment list action menu for tasks', () => { }; beforeAll(async(done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -69,13 +69,13 @@ describe('Attachment list action menu for tasks', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let user = await users.createTenantAndUser(this.alfrescoJsApi); + const user = await users.createTenantAndUser(this.alfrescoJsApi); tenantId = user.tenantId; await this.alfrescoJsApi.login(user.email, user.password); - let importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = importedApp.id; await loginPage.loginToProcessServicesUsingUserModel(user); @@ -179,13 +179,13 @@ describe('Attachment list action menu for tasks', () => { it('[C260234] Should be able to attache a file on a task on APS and check on ADF', () => { browser.controlFlow().execute(async() => { - let newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: 'SHARE KNOWLEDGE'}); + const newTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask({name: 'SHARE KNOWLEDGE'}); - let newTaskId = newTask.id; + const newTaskId = newTask.id; - let filePath = path.join(TestConfig.main.rootPath + pngFile.location); + const filePath = path.join(TestConfig.main.rootPath + pngFile.location); - let file = fs.createReadStream(filePath); + const file = fs.createReadStream(filePath); relatedContent = await this.alfrescoJsApi.activiti.contentApi.createRelatedContentOnTask(newTaskId, file, {'isRelatedContent': true}); relatedContentId = relatedContent.id; diff --git a/e2e/process-services/task-audit.e2e.ts b/e2e/process-services/task-audit.e2e.ts index 1f6c50acfb..7e2f87cf95 100644 --- a/e2e/process-services/task-audit.e2e.ts +++ b/e2e/process-services/task-audit.e2e.ts @@ -36,20 +36,20 @@ import { browser } from 'protractor'; describe('Task Audit', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let taskPage = new TasksPage(); + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const taskPage = new TasksPage(); const processServices = new ProcessServicesPage(); - let taskTaskApp = 'Audit task task app'; - let taskCustomApp = 'Audit task custom app'; - let taskCompleteCustomApp = 'Audit completed task custom app'; - let auditLogFile = path.join('./e2e/download/', 'Audit.pdf'); + const taskTaskApp = 'Audit task task app'; + const taskCustomApp = 'Audit task custom app'; + const taskCompleteCustomApp = 'Audit completed task custom app'; + const auditLogFile = path.join('./e2e/download/', 'Audit.pdf'); let appModel; beforeAll(async (done) => { - let users = new UsersActions(); - let apps = new AppsActions(); + const users = new UsersActions(); + const apps = new AppsActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -58,7 +58,7 @@ describe('Task Audit', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); diff --git a/e2e/process-services/task-details-form.e2e.ts b/e2e/process-services/task-details-form.e2e.ts index 8bc686ff9d..b77a7bd348 100644 --- a/e2e/process-services/task-details-form.e2e.ts +++ b/e2e/process-services/task-details-form.e2e.ts @@ -32,28 +32,28 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api'; import { UsersActions } from '../actions/users.actions'; describe('Task Details - Form', () => { - let loginPage = new LoginPage(); - let tasksListPage = new TasksListPage(); - let taskDetailsPage = new TaskDetailsPage(); - let filtersPage = new FiltersPage(); + const loginPage = new LoginPage(); + const tasksListPage = new TasksListPage(); + const taskDetailsPage = new TaskDetailsPage(); + const filtersPage = new FiltersPage(); let task, otherTask, user, newForm, attachedForm, otherAttachedForm; beforeAll(async (done) => { - let users = new UsersActions(); - let attachedFormModel = { + const users = new UsersActions(); + const attachedFormModel = { 'name': Util.generateRandomString(), 'description': '', 'modelType': 2, 'stencilSet': 0 }; - let otherTaskModel = new StandaloneTask(); - let otherAttachedFormModel = { + const otherTaskModel = new StandaloneTask(); + const otherAttachedFormModel = { 'name': Util.generateRandomString(), 'description': '', 'modelType': 2, 'stencilSet': 0 }; - let newFormModel = { 'name': Util.generateRandomString(), 'description': '', 'modelType': 2, 'stencilSet': 0 }; + const newFormModel = { 'name': Util.generateRandomString(), 'description': '', 'modelType': 2, 'stencilSet': 0 }; this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -70,7 +70,7 @@ describe('Task Details - Form', () => { newForm = await this.alfrescoJsApi.activiti.modelsApi.createModel(newFormModel); - let otherEmptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(otherTaskModel); + const otherEmptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(otherTaskModel); otherAttachedForm = await this.alfrescoJsApi.activiti.modelsApi.createModel(otherAttachedFormModel); @@ -84,9 +84,9 @@ describe('Task Details - Form', () => { }); beforeEach(async (done) => { - let taskModel = new StandaloneTask(); + const taskModel = new StandaloneTask(); - let emptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(taskModel); + const emptyTask = await this.alfrescoJsApi.activiti.taskApi.createNewTask(taskModel); await this.alfrescoJsApi.activiti.taskApi.attachForm(emptyTask.id, { 'formId': attachedForm.id }); diff --git a/e2e/process-services/task-details-no-form.e2e.ts b/e2e/process-services/task-details-no-form.e2e.ts index cb62537167..e1cd4d886b 100644 --- a/e2e/process-services/task-details-no-form.e2e.ts +++ b/e2e/process-services/task-details-no-form.e2e.ts @@ -32,17 +32,17 @@ import { AppsActions } from '../actions/APS/apps.actions'; describe('Task Details - No form', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); let processUserModel; - let app = resources.Files.NO_FORM_APP; - let taskPage = new TasksPage(); - let noFormMessage = 'No forms attached'; - let apps = new AppsActions(); + const app = resources.Files.NO_FORM_APP; + const taskPage = new TasksPage(); + const noFormMessage = 'No forms attached'; + const apps = new AppsActions(); let importedApp; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -51,7 +51,7 @@ describe('Task Details - No form', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); diff --git a/e2e/process-services/task-details.e2e.ts b/e2e/process-services/task-details.e2e.ts index ff00e21aef..4f3029c24a 100644 --- a/e2e/process-services/task-details.e2e.ts +++ b/e2e/process-services/task-details.e2e.ts @@ -38,17 +38,17 @@ describe('Task Details component', () => { const processServices = new ProcessServicesPage(); let processUserModel, appModel; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File']; - let TASK_DATA_FORMAT = 'mmm dd yyyy'; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + const tasks = ['Modifying task', 'Information box', 'No form', 'Not Created', 'Refreshing form', 'Assignee task', 'Attach File']; + const TASK_DATA_FORMAT = 'mmm dd yyyy'; let formModel; let apps; - let loginPage = new LoginPage(); - let taskPage = new TasksPage(); + const loginPage = new LoginPage(); + const taskPage = new TasksPage(); beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); apps = new AppsActions(); this.alfrescoJsApi = new AlfrescoApi({ @@ -58,7 +58,7 @@ describe('Task Details component', () => { await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); + const newTenant = await this.alfrescoJsApi.activiti.adminTenantsApi.createTenant(new Tenant()); processUserModel = await users.createApsUser(this.alfrescoJsApi, newTenant.id); @@ -86,11 +86,11 @@ describe('Task Details component', () => { .clickStartButton(); expect(taskPage.taskDetails().getTitle()).toEqual('Activities'); - let allTasks = await browser.controlFlow().execute(async () => { + const allTasks = await browser.controlFlow().execute(async () => { return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); }); - let taskModel = new TaskModel(allTasks.data[0]); + const taskModel = new TaskModel(allTasks.data[0]); taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT)); expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId()); @@ -104,7 +104,7 @@ describe('Task Details component', () => { expect(taskPage.taskDetails().getEndDate()).toEqual(''); expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING); - let taskForm = await browser.controlFlow().execute(async () => { + const taskForm = await browser.controlFlow().execute(async () => { return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id); }); @@ -123,11 +123,11 @@ describe('Task Details component', () => { .clickStartButton(); expect(taskPage.taskDetails().getTitle()).toEqual('Activities'); - let allTasks = await browser.controlFlow().execute(async () => { + const allTasks = await browser.controlFlow().execute(async () => { return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); }); - let taskModel = new TaskModel(allTasks.data[0]); + const taskModel = new TaskModel(allTasks.data[0]); taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT)); @@ -142,7 +142,7 @@ describe('Task Details component', () => { expect(taskPage.taskDetails().getParentTaskId()).toEqual(''); expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING); - let taskForm = await browser.controlFlow().execute(async () => { + const taskForm = await browser.controlFlow().execute(async () => { return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id); }); @@ -161,11 +161,11 @@ describe('Task Details component', () => { expect(taskPage.taskDetails().getTitle()).toEqual('Activities'); - let allTasks = await browser.controlFlow().execute(async () => { + const allTasks = await browser.controlFlow().execute(async () => { return await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({sort: 'created-desc'})); }); - let taskModel = new TaskModel(allTasks.data[0]); + const taskModel = new TaskModel(allTasks.data[0]); taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT)); @@ -180,7 +180,7 @@ describe('Task Details component', () => { expect(taskPage.taskDetails().getParentTaskId()).toEqual(''); expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING); - let taskForm = await browser.controlFlow().execute(async () => { + const taskForm = await browser.controlFlow().execute(async () => { return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id); }); @@ -200,11 +200,11 @@ describe('Task Details component', () => { expect(taskPage.taskDetails().getTitle()).toEqual('Activities'); - let allTasks = await browser.controlFlow().execute(async () => { + const allTasks = await browser.controlFlow().execute(async () => { return await this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({sort: 'created-desc'})); }); - let taskModel = new TaskModel(allTasks.data[0]); + const taskModel = new TaskModel(allTasks.data[0]); taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT)); @@ -219,7 +219,7 @@ describe('Task Details component', () => { expect(taskPage.taskDetails().getParentTaskId()).toEqual(''); expect(taskPage.taskDetails().getStatus()).toEqual(CONSTANTS.TASK_STATUS.RUNNING); - let taskForm = await browser.controlFlow().execute(async () => { + const taskForm = await browser.controlFlow().execute(async () => { return await this.alfrescoJsApi.activiti.taskFormsApi.getTaskForm(allTasks.data[0].id); }); @@ -230,8 +230,8 @@ describe('Task Details component', () => { }); it('[C286708] Should display task details for subtask - Task App', async() => { - let taskName = 'TaskAppSubtask'; - let checklistName = 'TaskAppChecklist'; + const taskName = 'TaskAppSubtask'; + const checklistName = 'TaskAppChecklist'; browser.controlFlow().execute(async () => { await this.alfrescoJsApi.activiti.taskApi.createNewTask({'name': taskName}); }); @@ -247,11 +247,11 @@ describe('Task Details component', () => { taskPage.tasksListPage().checkContentIsDisplayed(checklistName); taskPage.tasksListPage().selectRow(checklistName); - let allTasks = await browser.controlFlow().execute(async () => { + const allTasks = await browser.controlFlow().execute(async () => { return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); }); - let taskModel = new TaskModel(allTasks.data[0]); + const taskModel = new TaskModel(allTasks.data[0]); taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT)); expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId()); @@ -267,7 +267,7 @@ describe('Task Details component', () => { }); it('[C286707] Should display task details for subtask - Custom App', async() => { - let checklistName = 'CustomAppChecklist'; + const checklistName = 'CustomAppChecklist'; browser.controlFlow().execute(async () => { await apps.startProcess(this.alfrescoJsApi, appModel); @@ -284,11 +284,11 @@ describe('Task Details component', () => { taskPage.tasksListPage().checkContentIsDisplayed(checklistName); taskPage.tasksListPage().selectRow(checklistName); - let allTasks = await browser.controlFlow().execute(async () => { + const allTasks = await browser.controlFlow().execute(async () => { return this.alfrescoJsApi.activiti.taskApi.listTasks(new Task({ sort: 'created-desc' })); }); - let taskModel = new TaskModel(allTasks.data[0]); + const taskModel = new TaskModel(allTasks.data[0]); taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT)); expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId()); @@ -304,8 +304,8 @@ describe('Task Details component', () => { }); it('[C286709] Should display task details for completed task - Task App', async() => { - let taskName = 'TaskAppCompleted'; - let taskId = await browser.controlFlow().execute(async () => { + const taskName = 'TaskAppCompleted'; + const taskId = await browser.controlFlow().execute(async () => { return this.alfrescoJsApi.activiti.taskApi.createNewTask({'name': taskName}); }); @@ -317,11 +317,11 @@ describe('Task Details component', () => { taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.COMPLETED_TASKS); taskPage.tasksListPage().selectRow(taskName); - let getTaskResponse = await browser.controlFlow().execute(async () => { + const getTaskResponse = await browser.controlFlow().execute(async () => { return this.alfrescoJsApi.activiti.taskApi.getTask(taskId.id); }); - let taskModel = new TaskModel(getTaskResponse); + const taskModel = new TaskModel(getTaskResponse); taskPage.tasksListPage().checkContentIsDisplayed(taskModel.getName()); expect(taskPage.taskDetails().getCreated()).toEqual(dateFormat(taskModel.getCreated(), TASK_DATA_FORMAT)); expect(taskPage.taskDetails().getId()).toEqual(taskModel.getId()); diff --git a/e2e/process-services/task-filters-component.e2e.ts b/e2e/process-services/task-filters-component.e2e.ts index 060873cd77..1cafd90540 100644 --- a/e2e/process-services/task-filters-component.e2e.ts +++ b/e2e/process-services/task-filters-component.e2e.ts @@ -37,15 +37,15 @@ describe('Task', () => { describe('Filters', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let processServicesPage = new ProcessServicesPage(); - let tasksPage = new TasksPage(); - let tasksListPage = new TasksListPage(); - let taskDetailsPage = new TaskDetailsPage(); - let taskFiltersDemoPage = new TaskFiltersDemoPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const tasksPage = new TasksPage(); + const tasksListPage = new TasksListPage(); + const taskDetailsPage = new TaskDetailsPage(); + const taskFiltersDemoPage = new TaskFiltersDemoPage(); - let app = resources.Files.APP_WITH_DATE_FIELD_FORM; + const app = resources.Files.APP_WITH_DATE_FIELD_FORM; let appId, tenantId; beforeAll(async (done) => { @@ -60,18 +60,18 @@ describe('Task', () => { beforeEach(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); await this.alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - let user = await users.createTenantAndUser(this.alfrescoJsApi); + const user = await users.createTenantAndUser(this.alfrescoJsApi); tenantId = user.tenantId; await this.alfrescoJsApi.login(user.email, user.password); - let appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const appModel = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); appId = appModel.id; @@ -201,12 +201,12 @@ describe('Task', () => { describe('Custom Filters', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let processServicesPage = new ProcessServicesPage(); - let appNavigationBarPage = new AppNavigationBarPage(); - let appSettingsToggles = new AppSettingsToggles(); - let taskFiltersDemoPage = new TaskFiltersDemoPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const appNavigationBarPage = new AppNavigationBarPage(); + const appSettingsToggles = new AppSettingsToggles(); + const taskFiltersDemoPage = new TaskFiltersDemoPage(); let user; let appId; @@ -214,11 +214,11 @@ describe('Task', () => { let taskFilterId; - let app = resources.Files.APP_WITH_PROCESSES; + const app = resources.Files.APP_WITH_PROCESSES; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -233,7 +233,7 @@ describe('Task', () => { importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - let appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); appId = appDefinitions.data.find((currentApp) => { return currentApp.modelId === importedApp.id; @@ -253,13 +253,13 @@ describe('Task', () => { it('[C260350] Should display a new filter when a filter is added', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'New Task Filter'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); taskFilterId = result.id; return result; @@ -270,20 +270,20 @@ describe('Task', () => { taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed(); browser.controlFlow().execute(() => { - let result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); + const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); return result; }); }); it('[C286447] Should display the task filter icon when a custom filter is added', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'New Task Filter with icon'; newFilter.appId = appId; newFilter.icon = 'glyphicon-cloud'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); taskFilterId = result.id; return result; @@ -299,7 +299,7 @@ describe('Task', () => { expect(taskFiltersDemoPage.customTaskFilter('New Task Filter with icon').getTaskFilterIcon()).toEqual('cloud'); browser.controlFlow().execute(() => { - let result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); + const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); return result; }); }); @@ -317,13 +317,13 @@ describe('Task', () => { it('[C260353] Should display changes on a filter when this filter is edited', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'New Task Filter'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); taskFilterId = result.id; return result; @@ -334,13 +334,13 @@ describe('Task', () => { taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed(); browser.controlFlow().execute(() => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Task Filter Edited'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = this.alfrescoJsApi.activiti.userFiltersApi.updateUserTaskFilter(taskFilterId, newFilter); + const result = this.alfrescoJsApi.activiti.userFiltersApi.updateUserTaskFilter(taskFilterId, newFilter); return result; }); @@ -349,20 +349,20 @@ describe('Task', () => { taskFiltersDemoPage.customTaskFilter('Task Filter Edited').checkTaskFilterIsDisplayed(); browser.controlFlow().execute(() => { - let result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); + const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); return result; }); }); it('[C286448] Should display changes on a task filter when this filter icon is edited', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Task Filter Edited icon'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); taskFilterId = result.id; return result; @@ -373,13 +373,13 @@ describe('Task', () => { taskFiltersDemoPage.customTaskFilter('Task Filter Edited icon').checkTaskFilterIsDisplayed(); browser.controlFlow().execute(() => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Task Filter Edited icon'; newFilter.appId = appId; newFilter.icon = 'glyphicon-cloud'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = this.alfrescoJsApi.activiti.userFiltersApi.updateUserTaskFilter(taskFilterId, newFilter); + const result = this.alfrescoJsApi.activiti.userFiltersApi.updateUserTaskFilter(taskFilterId, newFilter); return result; }); @@ -397,13 +397,13 @@ describe('Task', () => { it('[C260354] Should not display task filter when this filter is deleted', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'New Task Filter'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); taskFilterId = result.id; return result; @@ -414,7 +414,7 @@ describe('Task', () => { taskFiltersDemoPage.customTaskFilter('New Task Filter').checkTaskFilterIsDisplayed(); browser.controlFlow().execute(() => { - let result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); + const result = this.alfrescoJsApi.activiti.userFiltersApi.deleteUserTaskFilter(taskFilterId); return result; }); diff --git a/e2e/process-services/task-filters-sorting.e2e.ts b/e2e/process-services/task-filters-sorting.e2e.ts index 5c8003d607..ae21785790 100644 --- a/e2e/process-services/task-filters-sorting.e2e.ts +++ b/e2e/process-services/task-filters-sorting.e2e.ts @@ -32,21 +32,21 @@ import { browser } from 'protractor'; describe('Task Filters Sorting', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let processServicesPage = new ProcessServicesPage(); - let tasksPage = new TasksPage(); - let tasksListPage = new TasksListPage(); - let taskDetailsPage = new TaskDetailsPage(); - let taskFiltersDemoPage = new TaskFiltersDemoPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const processServicesPage = new ProcessServicesPage(); + const tasksPage = new TasksPage(); + const tasksListPage = new TasksListPage(); + const taskDetailsPage = new TaskDetailsPage(); + const taskFiltersDemoPage = new TaskFiltersDemoPage(); let user; let appId; let importedApp; - let app = resources.Files.APP_WITH_PROCESSES; + const app = resources.Files.APP_WITH_PROCESSES; - let tasks = [ + const tasks = [ { name: 'Task 1 Completed', dueDate: '01/01/2019' }, { name: 'Task 2 Completed', dueDate: '02/01/2019' }, { name: 'Task 3 Completed', dueDate: '03/01/2019' }, @@ -55,8 +55,8 @@ describe('Task Filters Sorting', () => { { name: 'Task 6', dueDate: '03/01/2019' }]; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -71,7 +71,7 @@ describe('Task Filters Sorting', () => { importedApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); - let appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await this.alfrescoJsApi.activiti.appsApi.getAppDefinitions(); appId = appDefinitions.data.find((currentApp) => { return currentApp.modelId === importedApp.id; @@ -102,13 +102,13 @@ describe('Task Filters Sorting', () => { it('[C277254] Should display tasks under new filter from newest to oldest when they are completed', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Newest first'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-desc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); @@ -125,13 +125,13 @@ describe('Task Filters Sorting', () => { it('[C277255] Should display tasks under new filter from oldest to newest when they are completed', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Newest last'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-asc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); @@ -147,13 +147,13 @@ describe('Task Filters Sorting', () => { it('[C277256] Should display tasks under new filter from closest due date to farthest when they are completed', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Due first'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'due-desc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); @@ -169,13 +169,13 @@ describe('Task Filters Sorting', () => { it('[C277257] Should display tasks under new filter from farthest due date to closest when they are completed', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Due last'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'due-asc', state: 'completed', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); @@ -191,13 +191,13 @@ describe('Task Filters Sorting', () => { it('[C277258] Should display tasks under new filter from newest to oldest when they are open ', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Newest first Open'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-desc', state: 'open', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); @@ -213,13 +213,13 @@ describe('Task Filters Sorting', () => { it('[C277259] Should display tasks under new filter from oldest to newest when they are open', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Newest last Open'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'created-asc', state: 'open', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); @@ -235,13 +235,13 @@ describe('Task Filters Sorting', () => { it('[C277260] Should display tasks under new filter from closest due date to farthest when they are open', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Due first Open'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'due-desc', state: 'open', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); @@ -257,13 +257,13 @@ describe('Task Filters Sorting', () => { it('[C277261] Should display tasks under new filter from farthest due date to closest when they are open', () => { browser.controlFlow().execute(async () => { - let newFilter: any = new UserProcessInstanceFilterRepresentation(); + const newFilter: any = new UserProcessInstanceFilterRepresentation(); newFilter.name = 'Due last Open'; newFilter.appId = appId; newFilter.icon = 'glyphicon-filter'; newFilter.filter = { sort: 'due-asc', state: 'open', assignment: 'involved' }; - let result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); + const result = await this.alfrescoJsApi.activiti.userFiltersApi.createUserTaskFilter(newFilter); return result; }); diff --git a/e2e/process-services/task-list-pagination.e2e.ts b/e2e/process-services/task-list-pagination.e2e.ts index 4d79b24446..b65f420b75 100644 --- a/e2e/process-services/task-list-pagination.e2e.ts +++ b/e2e/process-services/task-list-pagination.e2e.ts @@ -31,16 +31,18 @@ import { UsersActions } from '../actions/users.actions'; describe('Task List Pagination', () => { - let loginPage = new LoginPage(); - let navigationBarPage = new NavigationBarPage(); - let taskPage = new TasksPage(); - let paginationPage = new PaginationPage(); + const loginPage = new LoginPage(); + const navigationBarPage = new NavigationBarPage(); + const taskPage = new TasksPage(); + const paginationPage = new PaginationPage(); let processUserModel, processUserModelEmpty; - let app = resources.Files.SIMPLE_APP_WITH_USER_FORM; - let currentPage = 1, nrOfTasks = 20, totalPages; + const app = resources.Files.SIMPLE_APP_WITH_USER_FORM; + let currentPage = 1; + const nrOfTasks = 20; + let totalPages; - let itemsPerPage = { + const itemsPerPage = { five: '5', fiveValue: 5, ten: '10', @@ -53,8 +55,8 @@ describe('Task List Pagination', () => { }; beforeAll(async (done) => { - let apps = new AppsActions(); - let users = new UsersActions(); + const apps = new AppsActions(); + const users = new UsersActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -68,7 +70,7 @@ describe('Task List Pagination', () => { await this.alfrescoJsApi.login(processUserModel.email, processUserModel.password); - let resultApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); + const resultApp = await apps.importPublishDeployApp(this.alfrescoJsApi, app.file_location); for (let i = 0; i < nrOfTasks; i++) { await apps.startProcess(this.alfrescoJsApi, resultApp); diff --git a/e2e/process-services/widgets/amount-widget.e2e.ts b/e2e/process-services/widgets/amount-widget.e2e.ts index 877b6707a3..de643d7f88 100644 --- a/e2e/process-services/widgets/amount-widget.e2e.ts +++ b/e2e/process-services/widgets/amount-widget.e2e.ts @@ -29,19 +29,19 @@ import resources = require('../../util/resources'); describe('Amount Widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.AMOUNT; + const app = resources.Files.WIDGET_CHECK_APP.AMOUNT; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -55,7 +55,7 @@ describe('Amount Widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -65,7 +65,7 @@ describe('Amount Widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/attach-folder-widget.e2e.ts b/e2e/process-services/widgets/attach-folder-widget.e2e.ts index 96bee87462..4e525f947f 100644 --- a/e2e/process-services/widgets/attach-folder-widget.e2e.ts +++ b/e2e/process-services/widgets/attach-folder-widget.e2e.ts @@ -27,18 +27,18 @@ import TestConfig = require('../../test.config'); import resources = require('../../util/resources'); describe('Attach Folder widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.ATTACH_FOLDER; + const app = resources.Files.WIDGET_CHECK_APP.ATTACH_FOLDER; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -52,7 +52,7 @@ describe('Attach Folder widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -62,7 +62,7 @@ describe('Attach Folder widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/checkbox-widget.e2e.ts b/e2e/process-services/widgets/checkbox-widget.e2e.ts index 210e578222..d219301e2e 100644 --- a/e2e/process-services/widgets/checkbox-widget.e2e.ts +++ b/e2e/process-services/widgets/checkbox-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Checkbox Widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.CHECKBOX; + const app = resources.Files.WIDGET_CHECK_APP.CHECKBOX; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Checkbox Widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Checkbox Widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/date-time-widget.e2e.ts b/e2e/process-services/widgets/date-time-widget.e2e.ts index 5a98f527df..38b298ccbf 100644 --- a/e2e/process-services/widgets/date-time-widget.e2e.ts +++ b/e2e/process-services/widgets/date-time-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Date and time widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.DATETIME; + const app = resources.Files.WIDGET_CHECK_APP.DATETIME; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Date and time widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Date and time widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/date-widget.e2e.ts b/e2e/process-services/widgets/date-widget.e2e.ts index 53f063f669..bbb05992f0 100644 --- a/e2e/process-services/widgets/date-widget.e2e.ts +++ b/e2e/process-services/widgets/date-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Date widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.DATE; + const app = resources.Files.WIDGET_CHECK_APP.DATE; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Date widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Date widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/document-template-widget.e2e.ts b/e2e/process-services/widgets/document-template-widget.e2e.ts index 4394594e57..dbb1362504 100644 --- a/e2e/process-services/widgets/document-template-widget.e2e.ts +++ b/e2e/process-services/widgets/document-template-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Document Template widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.FILE_FORM_ADF; + const app = resources.Files.FILE_FORM_ADF; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Document Template widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, app.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Document Template widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/dropdown-widget.e2e.ts b/e2e/process-services/widgets/dropdown-widget.e2e.ts index e7508c37f1..f6b70432ff 100644 --- a/e2e/process-services/widgets/dropdown-widget.e2e.ts +++ b/e2e/process-services/widgets/dropdown-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Dropdown widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.DROPDOWN; + const app = resources.Files.WIDGET_CHECK_APP.DROPDOWN; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Dropdown widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Dropdown widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/dynamic-table-widget.e2e.ts b/e2e/process-services/widgets/dynamic-table-widget.e2e.ts index f3b04f0809..dce1b407f3 100644 --- a/e2e/process-services/widgets/dynamic-table-widget.e2e.ts +++ b/e2e/process-services/widgets/dynamic-table-widget.e2e.ts @@ -28,20 +28,20 @@ import resources = require('../../util/resources'); describe('Dynamic Table widget ', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; let deployedApp, process; describe('with Date Time Widget App', () => { - let app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE; + const app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -55,7 +55,7 @@ describe('Dynamic Table widget ', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -65,7 +65,7 @@ describe('Dynamic Table widget ', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); @@ -99,10 +99,10 @@ describe('Dynamic Table widget ', () => { describe('with People Widget App', () => { - let app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE_USERS; + const app = resources.Files.WIDGET_CHECK_APP.DYNAMIC_TABLE_USERS; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -116,7 +116,7 @@ describe('Dynamic Table widget ', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -126,7 +126,7 @@ describe('Dynamic Table widget ', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/header-widget.e2e.ts b/e2e/process-services/widgets/header-widget.e2e.ts index ce98f1bbbe..4db48bb3ac 100644 --- a/e2e/process-services/widgets/header-widget.e2e.ts +++ b/e2e/process-services/widgets/header-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Header widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.HEADER; + const app = resources.Files.WIDGET_CHECK_APP.HEADER; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Header widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Header widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/hyperlink-widget.e2e.ts b/e2e/process-services/widgets/hyperlink-widget.e2e.ts index cb0d6ccdbf..ac32b0a821 100644 --- a/e2e/process-services/widgets/hyperlink-widget.e2e.ts +++ b/e2e/process-services/widgets/hyperlink-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Hyperlink widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.HYPERLINK; + const app = resources.Files.WIDGET_CHECK_APP.HYPERLINK; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Hyperlink widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Hyperlink widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/multi-line-widget.e2e.ts b/e2e/process-services/widgets/multi-line-widget.e2e.ts index e407db01a2..17a2c7c498 100644 --- a/e2e/process-services/widgets/multi-line-widget.e2e.ts +++ b/e2e/process-services/widgets/multi-line-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Multi-line Widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.MULTILINE_TEXT; + const app = resources.Files.WIDGET_CHECK_APP.MULTILINE_TEXT; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Multi-line Widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Multi-line Widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); @@ -77,10 +77,10 @@ describe('Multi-line Widget', () => { }); it('[C268182] Should be able to set general properties for Multi-line Text Widget', () => { - let label = widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple); + const label = widget.multilineTextWidget().getFieldLabel(app.FIELD.multiSimple); expect(label).toBe('multiSimple*'); expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy(); - let placeHolder = widget.multilineTextWidget().getFieldPlaceHolder(app.FIELD.multiSimple); + const placeHolder = widget.multilineTextWidget().getFieldPlaceHolder(app.FIELD.multiSimple); expect(placeHolder).toBe('Type something...'); widget.multilineTextWidget().setValue(app.FIELD.multiSimple, 'TEST'); expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy(); diff --git a/e2e/process-services/widgets/number-widget.e2e.ts b/e2e/process-services/widgets/number-widget.e2e.ts index ebb05d3647..1eceff1581 100644 --- a/e2e/process-services/widgets/number-widget.e2e.ts +++ b/e2e/process-services/widgets/number-widget.e2e.ts @@ -29,18 +29,18 @@ import resources = require('../../util/resources'); describe('Number widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.NUMBER; + const app = resources.Files.WIDGET_CHECK_APP.NUMBER; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -54,7 +54,7 @@ describe('Number widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -64,7 +64,7 @@ describe('Number widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/people-widget.e2e.ts b/e2e/process-services/widgets/people-widget.e2e.ts index 0f9c4822e4..c699259f09 100644 --- a/e2e/process-services/widgets/people-widget.e2e.ts +++ b/e2e/process-services/widgets/people-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('People widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.ADD_PEOPLE; + const app = resources.Files.WIDGET_CHECK_APP.ADD_PEOPLE; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('People widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('People widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); @@ -81,7 +81,7 @@ describe('People widget', () => { widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id); taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id); - let admin = processUserModel.firstName + ' ' + processUserModel.lastName; + const admin = processUserModel.firstName + ' ' + processUserModel.lastName; widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0)); widget.peopleWidget().checkDropDownListIsDisplayed(); widget.peopleWidget().checkUserIsListed(admin); @@ -93,7 +93,7 @@ describe('People widget', () => { widget.checkboxWidget().clickCheckboxInput(app.FIELD.checkbox_id); taskPage.formFields().checkWidgetIsVisible(app.FIELD.widget_id); - let admin = processUserModel.firstName + ' ' + processUserModel.lastName; + const admin = processUserModel.firstName + ' ' + processUserModel.lastName; widget.peopleWidget().insertUser(app.FIELD.widget_id, admin.charAt(0)); widget.peopleWidget().checkDropDownListIsDisplayed(); widget.peopleWidget().checkUserIsListed(admin); diff --git a/e2e/process-services/widgets/radio-buttons-widget.e2e.ts b/e2e/process-services/widgets/radio-buttons-widget.e2e.ts index 72dfceadfd..9334770a86 100644 --- a/e2e/process-services/widgets/radio-buttons-widget.e2e.ts +++ b/e2e/process-services/widgets/radio-buttons-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Radio Buttons Widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.RADIO_BUTTONS; + const app = resources.Files.WIDGET_CHECK_APP.RADIO_BUTTONS; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Radio Buttons Widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -65,7 +65,7 @@ describe('Radio Buttons Widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); diff --git a/e2e/process-services/widgets/text-widget.e2e.ts b/e2e/process-services/widgets/text-widget.e2e.ts index e0bc6abdc3..43095cd11e 100644 --- a/e2e/process-services/widgets/text-widget.e2e.ts +++ b/e2e/process-services/widgets/text-widget.e2e.ts @@ -28,18 +28,18 @@ import resources = require('../../util/resources'); describe('Text widget', () => { - let loginPage = new LoginPage(); + const loginPage = new LoginPage(); let processUserModel; - let taskPage = new TasksPage(); - let widget = new Widget(); + const taskPage = new TasksPage(); + const widget = new Widget(); let alfrescoJsApi; - let appsActions = new AppsActions(); + const appsActions = new AppsActions(); let appModel; - let app = resources.Files.WIDGET_CHECK_APP.TEXT; + const app = resources.Files.WIDGET_CHECK_APP.TEXT; let deployedApp, process; beforeAll(async (done) => { - let users = new UsersActions(); + const users = new UsersActions(); alfrescoJsApi = new AlfrescoApi({ provider: 'BPM', @@ -53,7 +53,7 @@ describe('Text widget', () => { await alfrescoJsApi.login(processUserModel.email, processUserModel.password); appModel = await appsActions.importPublishDeployApp(alfrescoJsApi, resources.Files.WIDGET_CHECK_APP.file_location); - let appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); + const appDefinitions = await alfrescoJsApi.activiti.appsApi.getAppDefinitions(); deployedApp = appDefinitions.data.find((currentApp) => { return currentApp.modelId === appModel.id; }); @@ -63,7 +63,7 @@ describe('Text widget', () => { }); beforeEach(() => { - let urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; + const urlToNavigateTo = `${TestConfig.adf.url}/activiti/apps/${deployedApp.id}/tasks/`; browser.get(urlToNavigateTo); taskPage.filtersPage().goToFilter(CONSTANTS.TASK_FILTERS.MY_TASKS); taskPage.formFields().checkFormIsDisplayed(); @@ -77,10 +77,10 @@ describe('Text widget', () => { }); it('[C268157] Should be able to set general properties for Text widget', async () => { - let label = widget.textWidget().getFieldLabel(app.FIELD.simpleText); + const label = widget.textWidget().getFieldLabel(app.FIELD.simpleText); expect(label).toBe('textSimple*'); expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeTruthy(); - let placeHolder = widget.textWidget().getFieldPlaceHolder(app.FIELD.simpleText); + const placeHolder = widget.textWidget().getFieldPlaceHolder(app.FIELD.simpleText); expect(placeHolder).toBe('Type something...'); widget.textWidget().setValue(app.FIELD.simpleText, 'TEST'); expect(taskPage.formFields().isCompleteFormButtonDisabled()).toBeFalsy(); diff --git a/e2e/search/components/search-checkList.e2e.ts b/e2e/search/components/search-checkList.e2e.ts index d970c7d760..f4a0b2139d 100644 --- a/e2e/search/components/search-checkList.e2e.ts +++ b/e2e/search/components/search-checkList.e2e.ts @@ -42,17 +42,17 @@ describe('Search Checklist Component', () => { const searchDialog = new SearchDialog(); const searchResults = new SearchResultsPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); - let filterType = { + const filterType = { folder: 'Folder', document: 'Document', custom: 'TEST_NAME' }; - let randomName = Util.generateRandomString(); - let nodeNames = { + const randomName = Util.generateRandomString(); + const nodeNames = { document: `${randomName}.txt`, folder: `${randomName}Folder` }; @@ -135,7 +135,7 @@ describe('Search Checklist Component', () => { let jsonFile; beforeEach(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); @@ -299,7 +299,7 @@ describe('Search Checklist Component', () => { let jsonFile; beforeEach(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); diff --git a/e2e/search/components/search-date-range.e2e.ts b/e2e/search/components/search-date-range.e2e.ts index fd26c93720..5751f72eca 100644 --- a/e2e/search/components/search-date-range.e2e.ts +++ b/e2e/search/components/search-date-range.e2e.ts @@ -33,15 +33,15 @@ import { DateUtil } from '../../util/dateUtil'; describe('Search Date Range Filter', () => { - let loginPage = new LoginPage(); - let searchDialog = new SearchDialog(); - let searchFilters = new SearchFiltersPage(); - let dateRangeFilter = searchFilters.createdDateRangeFilterPage(); - let searchResults = new SearchResultsPage(); - let datePicker = new DatePickerPage(); - let navigationBar = new NavigationBarPage(); - let configEditor = new ConfigEditorPage(); - let dataTable = new DataTableComponentPage(); + const loginPage = new LoginPage(); + const searchDialog = new SearchDialog(); + const searchFilters = new SearchFiltersPage(); + const dateRangeFilter = searchFilters.createdDateRangeFilterPage(); + const searchResults = new SearchResultsPage(); + const datePicker = new DatePickerPage(); + const navigationBar = new NavigationBarPage(); + const configEditor = new ConfigEditorPage(); + const dataTable = new DataTableComponentPage(); beforeAll(async (done) => { @@ -89,7 +89,7 @@ describe('Search Date Range Filter', () => { }); it('[C277105] Should be able to type a date', () => { - let date = '01-May-18'; + const date = '01-May-18'; dateRangeFilter.putFromDate(date); browser.controlFlow().execute(async () => { await expect(dateRangeFilter.getFromCalendarSelectedDate()).toEqual(dateRangeFilter.getFromDate()); @@ -138,11 +138,11 @@ describe('Search Date Range Filter', () => { searchResults.sortByCreated(true); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Created'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Created'); + for (const currentResult of results) { currentResult.getAttribute('title').then(async (currentDate) => { - let currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a'); + const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a'); await expect(currentDateFormatted <= DateUtil.parse(toDate, 'DD-MM-YY')).toBe(true); await expect(currentDateFormatted >= DateUtil.parse(fromDate, 'DD-MM-YY')).toBe(true); @@ -162,8 +162,8 @@ describe('Search Date Range Filter', () => { }); it('[C277114] Should display warning message if user doesn\'t set the date range properly', () => { - let toDate = '01-May-18'; - let fromDate = '16-May-18'; + const toDate = '01-May-18'; + const fromDate = '16-May-18'; dateRangeFilter.checkToFieldIsDisplayed() .putToDate(toDate) @@ -193,7 +193,7 @@ describe('Search Date Range Filter', () => { let jsonFile; beforeAll(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); @@ -213,7 +213,7 @@ describe('Search Date Range Filter', () => { dateRangeFilter.checkFromFieldIsDisplayed() .openFromDatePicker(); - let todayDate = DateUtil.formatDate('MM-DD-YY'); + const todayDate = DateUtil.formatDate('MM-DD-YY'); datePicker.selectTodayDate(); browser.controlFlow().execute(async () => { diff --git a/e2e/search/components/search-number-range.e2e.ts b/e2e/search/components/search-number-range.e2e.ts index 88f80a4705..dd6426da91 100644 --- a/e2e/search/components/search-number-range.e2e.ts +++ b/e2e/search/components/search-number-range.e2e.ts @@ -114,7 +114,7 @@ describe('Search Number Range Filter', () => { }); it('[C276922] Should be keep value when Number Range widget is collapsed', () => { - let size = 5; + const size = 5; sizeRangeFilter.putFromNumber(size); sizeRangeFilter.putToNumber(size); searchFilters.clickSizeRangeFilterHeader() @@ -159,8 +159,8 @@ describe('Search Number Range Filter', () => { }); it('[C276943] Should be able to put a big value in To field', () => { - let toSize = 999999999; - let fromSize = 0; + const toSize = 999999999; + const fromSize = 0; sizeRangeFilter.checkToFieldIsDisplayed() .putToNumber(toSize) .putFromNumber(fromSize); @@ -172,10 +172,10 @@ describe('Search Number Range Filter', () => { searchResults.sortBySize(false); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(parseInt(currentSize, 10) <= toSize).toBe(true); } @@ -186,9 +186,9 @@ describe('Search Number Range Filter', () => { }); it('[C276944] Should be able to filter by name when size range filter is applied', () => { - let nameFilter = searchFilters.textFiltersPage(); - let toSize = 40; - let fromSize = 0; + const nameFilter = searchFilters.textFiltersPage(); + const toSize = 40; + const fromSize = 0; searchFilters.checkNameFilterIsDisplayed() .checkNameFilterIsExpanded(); nameFilter.searchByName('*'); @@ -203,10 +203,10 @@ describe('Search Number Range Filter', () => { searchResults.sortBySize(false); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(parseInt(currentSize, 10) <= toSize).toBe(true); } @@ -221,10 +221,10 @@ describe('Search Number Range Filter', () => { searchResults.sortBySize(false); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(parseInt(currentSize, 10) <= toSize).toBe(true); } @@ -234,10 +234,10 @@ describe('Search Number Range Filter', () => { }); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Display name'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Display name'); + for (const currentResult of results) { try { - let name = await currentResult.getAttribute('title'); + const name = await currentResult.getAttribute('title'); if (name && name.trim() !== '') { await expect(/z*/i.test(name)).toBe(true); } @@ -277,10 +277,10 @@ describe('Search Number Range Filter', () => { searchResults.sortBySize(false); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(currentSize === '0').toBe(true); } @@ -315,11 +315,11 @@ describe('Search Number Range Filter', () => { searchResults.sortBySize(false); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(parseInt(currentSize, 10) <= 1000).toBe(true); } @@ -334,11 +334,11 @@ describe('Search Number Range Filter', () => { expect(sizeRangeFilter.getToNumber()).toEqual(''); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(parseInt(currentSize, 10) >= 1000).toBe(true); } @@ -394,7 +394,7 @@ describe('Search Number Range Filter', () => { let jsonFile; beforeEach(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); @@ -414,8 +414,8 @@ describe('Search Number Range Filter', () => { .clickSizeRangeFilterHeader() .checkSizeRangeFilterIsExpanded(); - let fromYear = (new Date()).getFullYear(); - let toYear = fromYear + 1; + const fromYear = (new Date()).getFullYear(); + const toYear = fromYear + 1; sizeRangeFilter.checkToFieldIsDisplayed() .putToNumber(toYear) @@ -427,10 +427,10 @@ describe('Search Number Range Filter', () => { searchResults.sortByCreated(false); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Created'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Created'); + for (const currentResult of results) { currentResult.getAttribute('title').then(async (currentDate) => { - let currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a'); + const currentDateFormatted = DateUtil.parse(currentDate, 'MMM DD, YYYY, h:mm:ss a'); await expect(currentDateFormatted.getFullYear() <= toYear).toBe(true); await expect(currentDateFormatted.getFullYear() >= fromYear).toBe(true); diff --git a/e2e/search/components/search-radio.e2e.ts b/e2e/search/components/search-radio.e2e.ts index 52f69681c5..6f86234e75 100644 --- a/e2e/search/components/search-radio.e2e.ts +++ b/e2e/search/components/search-radio.e2e.ts @@ -42,10 +42,10 @@ describe('Search Radio Component', () => { const searchDialog = new SearchDialog(); const searchResults = new SearchResultsPage(); - let acsUser = new AcsUserModel(); - let uploadActions = new UploadActions(); + const acsUser = new AcsUserModel(); + const uploadActions = new UploadActions(); - let filterType = { + const filterType = { none: 'None', all: 'All', folder: 'Folder', @@ -53,8 +53,8 @@ describe('Search Radio Component', () => { custom: 'TEST_NAME' }; - let randomName = Util.generateRandomString(); - let nodeNames = { + const randomName = Util.generateRandomString(); + const nodeNames = { document: `${randomName}.txt`, folder: `${randomName}Folder` }; @@ -137,7 +137,7 @@ describe('Search Radio Component', () => { let jsonFile; beforeEach(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); @@ -281,7 +281,7 @@ describe('Search Radio Component', () => { let jsonFile; beforeEach(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); diff --git a/e2e/search/components/search-slider.e2e.ts b/e2e/search/components/search-slider.e2e.ts index 1f31aa657c..edad2a798f 100644 --- a/e2e/search/components/search-slider.e2e.ts +++ b/e2e/search/components/search-slider.e2e.ts @@ -106,7 +106,7 @@ describe('Search Number Range Filter', () => { }); it('[C276972] Should be keep value when Search Size Slider is collapsed', () => { - let size = 5; + const size = 5; sizeSliderFilter.checkSliderIsDisplayed().setValue(size); searchFilters.clickSizeSliderFilterHeader() .checkSizeSliderFilterIsCollapsed() @@ -117,16 +117,16 @@ describe('Search Number Range Filter', () => { }); it('[C276981] Should be able to clear value in Search Size Slider', () => { - let size = 5; + const size = 5; sizeSliderFilter.checkSliderIsDisplayed().setValue(size); searchResults.sortBySize(false) .tableIsLoaded(); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(parseInt(currentSize, 10) <= 5000).toBe(true); } @@ -142,11 +142,11 @@ describe('Search Number Range Filter', () => { .tableIsLoaded(); browser.controlFlow().execute(async () => { - let results = await dataTable.geCellElementDetail('Size'); - for (let currentResult of results) { + const results = await dataTable.geCellElementDetail('Size'); + for (const currentResult of results) { try { - let currentSize = await currentResult.getAttribute('title'); + const currentSize = await currentResult.getAttribute('title'); if (currentSize && currentSize.trim() !== '') { await expect(parseInt(currentSize, 10) >= 5000).toBe(true); } @@ -160,7 +160,7 @@ describe('Search Number Range Filter', () => { let jsonFile; beforeEach(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); @@ -184,7 +184,7 @@ describe('Search Number Range Filter', () => { }); it('[C276985] Should be able to set min value for Search Size Slider', () => { - let minSize = 3; + const minSize = 3; jsonFile.categories[2].component.settings.min = minSize; navigationBar.clickConfigEditorButton(); @@ -206,7 +206,7 @@ describe('Search Number Range Filter', () => { }); it('[C276986] Should be able to set max value for Search Size Slider', () => { - let maxSize = 50; + const maxSize = 50; jsonFile.categories[2].component.settings.max = maxSize; navigationBar.clickConfigEditorButton(); @@ -228,7 +228,7 @@ describe('Search Number Range Filter', () => { }); it('[C276987] Should be able to set steps for Search Size Slider', () => { - let step = 10; + const step = 10; jsonFile.categories[2].component.settings.step = step; navigationBar.clickConfigEditorButton(); @@ -244,7 +244,7 @@ describe('Search Number Range Filter', () => { .clickSizeSliderFilterHeader() .checkSizeSliderFilterIsExpanded(); - let randomValue = 5; + const randomValue = 5; sizeSliderFilter.checkSliderIsDisplayed() .setValue(randomValue); expect(sizeSliderFilter.getValue()).toEqual(`0`); diff --git a/e2e/search/components/search-sorting-picker.e2e.ts b/e2e/search/components/search-sorting-picker.e2e.ts index fdec031ef5..9ee4513dcf 100644 --- a/e2e/search/components/search-sorting-picker.e2e.ts +++ b/e2e/search/components/search-sorting-picker.e2e.ts @@ -113,7 +113,7 @@ describe('Search Sorting Picker', () => { }); it('[C277271] Should be able to add a custom search sorter in the "sort by" option', () => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); navigationBar.clickConfigEditorButton(); configEditor.clickSearchConfiguration(); @@ -133,12 +133,12 @@ describe('Search Sorting Picker', () => { }); it('[C277272] Should be able to exclude a standard search sorter from the sorting option', () => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); navigationBar.clickConfigEditorButton(); configEditor.clickSearchConfiguration(); configEditor.clickClearButton(); - let removedOption = jsonFile.sorting.options.splice(0, 1); + const removedOption = jsonFile.sorting.options.splice(0, 1); configEditor.enterBigConfigurationText(JSON.stringify(jsonFile)); configEditor.clickSaveButton(); @@ -153,7 +153,7 @@ describe('Search Sorting Picker', () => { }); it('[C277273] Should be able to set a default order for a search sorting option', () => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); navigationBar.clickConfigEditorButton(); configEditor.clickSearchConfiguration(); @@ -200,7 +200,7 @@ describe('Search Sorting Picker', () => { it('[C277286] Should be able to sort the search results by "Created Date" ASC', () => { searchResults.sortByCreated(true); browser.controlFlow().execute(async () => { - let results = await searchResults. dataTable.geCellElementDetail('Created'); + const results = await searchResults. dataTable.geCellElementDetail('Created'); expect(contentServices.checkElementsDateSortedAsc(results)).toBe(true); }); }); @@ -208,13 +208,13 @@ describe('Search Sorting Picker', () => { it('[C277287] Should be able to sort the search results by "Created Date" DESC', () => { searchResults.sortByCreated(false); browser.controlFlow().execute(async () => { - let results = await searchResults. dataTable.geCellElementDetail('Created'); + const results = await searchResults. dataTable.geCellElementDetail('Created'); expect(contentServices.checkElementsDateSortedDesc(results)).toBe(true); }); }); it('[C277288] Should be able to sort the search results by "Modified Date" ASC', () => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); navigationBar.clickConfigEditorButton(); configEditor.clickSearchConfiguration(); @@ -231,11 +231,11 @@ describe('Search Sorting Picker', () => { .sortBy(true, 'Modified Date'); browser.controlFlow().execute(async () => { - let idList = await contentServices.getElementsDisplayedId(); - let numberOfElements = await contentServices.numberOfResultsDisplayed(); + const idList = await contentServices.getElementsDisplayedId(); + const numberOfElements = await contentServices.numberOfResultsDisplayed(); - let nodeList = await nodeActions.getNodesDisplayed(this.alfrescoJsApi, idList, numberOfElements); - let modifiedDateList = []; + const nodeList = await nodeActions.getNodesDisplayed(this.alfrescoJsApi, idList, numberOfElements); + const modifiedDateList = []; for (let i = 0; i < nodeList.length; i++) { modifiedDateList.push(new Date(nodeList[i].entry.modifiedAt)); } @@ -254,7 +254,7 @@ describe('Search Sorting Picker', () => { }); it('[C277301] Should be able to change default sorting option for the search results', () => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); navigationBar.clickConfigEditorButton(); configEditor.clickSearchConfiguration(); diff --git a/e2e/search/components/search-text.e2e.ts b/e2e/search/components/search-text.e2e.ts index 6b2b82eaab..25359fd54f 100644 --- a/e2e/search/components/search-text.e2e.ts +++ b/e2e/search/components/search-text.e2e.ts @@ -39,12 +39,12 @@ describe('Search component - Text widget', () => { const navigationBarPage = new NavigationBarPage(); const searchFiltersPage = new SearchFiltersPage(); - let loginPage = new LoginPage(); - let searchDialog = new SearchDialog(); - let searchResultPage = new SearchResultsPage(); + const loginPage = new LoginPage(); + const searchDialog = new SearchDialog(); + const searchResultPage = new SearchResultsPage(); - let acsUser = new AcsUserModel(); - let newFolderModel = new FolderModel({'name': 'newFolder', 'description': 'newDescription'}); + const acsUser = new AcsUserModel(); + const newFolderModel = new FolderModel({'name': 'newFolder', 'description': 'newDescription'}); beforeAll(async (done) => { @@ -88,7 +88,7 @@ describe('Search component - Text widget', () => { let jsonFile; beforeAll(() => { - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); }); diff --git a/e2e/search/search-component.e2e.ts b/e2e/search/search-component.e2e.ts index 6b66e2af70..ff3063fd7f 100644 --- a/e2e/search/search-component.e2e.ts +++ b/e2e/search/search-component.e2e.ts @@ -38,7 +38,7 @@ import { SearchConfiguration } from './search.config'; describe('Search component - Search Bar', () => { - let search = { + const search = { inactive: { firstChar: 'x', secondChar: 'y', @@ -47,32 +47,36 @@ describe('Search component - Search Bar', () => { } }; - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let searchDialog = new SearchDialog(); - let searchResultPage = new SearchResultsPage(); - let filePreviewPage = new FilePreviewPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const searchDialog = new SearchDialog(); + const searchResultPage = new SearchResultsPage(); + const filePreviewPage = new FilePreviewPage(); - let acsUser = new AcsUserModel(); + const searchDialog = new SearchDialog(); + const searchResultPage = new SearchResultsPage(); + const filePreviewPage = new FilePreviewPage(); + + const acsUser = new AcsUserModel(); const uploadActions = new UploadActions(); - let filename = Util.generateRandomString(16); - let firstFolderName = Util.generateRandomString(16); - let secondFolderName = Util.generateRandomString(16); - let thirdFolderName = Util.generateRandomString(16); - let filesToDelete = []; + const filename = Util.generateRandomString(16); + const firstFolderName = Util.generateRandomString(16); + const secondFolderName = Util.generateRandomString(16); + const thirdFolderName = Util.generateRandomString(16); + const filesToDelete = []; - let firstFileModel = new FileModel({ + const firstFileModel = new FileModel({ 'name': filename, 'shortName': filename.substring(0, 8) }); - let firstFolderModel = new FolderModel({ + const firstFolderModel = new FolderModel({ 'name': firstFolderName, 'shortName': firstFolderName.substring(0, 8) }); - let secondFolder = new FolderModel({ + const secondFolder = new FolderModel({ 'name': secondFolderName, 'shortName': secondFolderName.substring(0, 8) }); - let thirdFolder = new FolderModel({ + const thirdFolder = new FolderModel({ 'name': thirdFolderName, 'shortName': thirdFolderName.substring(0, 8) }); @@ -93,7 +97,7 @@ describe('Search component - Search Bar', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); - let firstFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-'); + const firstFileUploaded = await uploadActions.uploadFile(this.alfrescoJsApi, firstFileModel.location, firstFileModel.name, '-my-'); Object.assign(firstFileModel, firstFileUploaded.entry); fileHighlightUploaded = await this.alfrescoJsApi.nodes.addNode('-my-', { diff --git a/e2e/search/search-filters.e2e.ts b/e2e/search/search-filters.e2e.ts index 022bbd1d98..72395d6edb 100644 --- a/e2e/search/search-filters.e2e.ts +++ b/e2e/search/search-filters.e2e.ts @@ -38,51 +38,51 @@ import { SearchConfiguration } from './search.config'; describe('Search Filters', () => { - let loginPage = new LoginPage(); - let searchDialog = new SearchDialog(); - let searchFiltersPage = new SearchFiltersPage(); - let uploadActions = new UploadActions(); - let paginationPage = new PaginationPage(); - let contentList = new DocumentListPage(); - let navigationBar = new NavigationBarPage(); - let configEditor = new ConfigEditorPage(); - let searchResults = new SearchResultsPage(); + const loginPage = new LoginPage(); + const searchDialog = new SearchDialog(); + const searchFiltersPage = new SearchFiltersPage(); + const uploadActions = new UploadActions(); + const paginationPage = new PaginationPage(); + const contentList = new DocumentListPage(); + const navigationBar = new NavigationBarPage(); + const configEditor = new ConfigEditorPage(); + const searchResults = new SearchResultsPage(); - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let filename = Util.generateRandomString(16); - let fileNamePrefix = Util.generateRandomString(5); - let uniqueFileName1 = fileNamePrefix + Util.generateRandomString(5); - let uniqueFileName2 = fileNamePrefix + Util.generateRandomString(5); - let uniqueFileName3 = fileNamePrefix + Util.generateRandomString(5); + const filename = Util.generateRandomString(16); + const fileNamePrefix = Util.generateRandomString(5); + const uniqueFileName1 = fileNamePrefix + Util.generateRandomString(5); + const uniqueFileName2 = fileNamePrefix + Util.generateRandomString(5); + const uniqueFileName3 = fileNamePrefix + Util.generateRandomString(5); - let fileModel = new FileModel({ + const fileModel = new FileModel({ 'name': filename, 'shortName': filename.substring(0, 8) }); - let pngFileModel = new FileModel({ + const pngFileModel = new FileModel({ 'name': resources.Files.ADF_DOCUMENTS.PNG.file_name, 'location': resources.Files.ADF_DOCUMENTS.PNG.file_location }); - let txtFileModel1 = new FileModel({ + const txtFileModel1 = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location, 'name': `${uniqueFileName1}.txt` }); - let jpgFileModel = new FileModel({ + const jpgFileModel = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.JPG.file_location, 'name': `${uniqueFileName2}.jpg` }); - let txtFileModel2 = new FileModel({ + const txtFileModel2 = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location, 'name': `${uniqueFileName3}.txt` }); let fileUploaded, fileTypePng, fileTypeTxt1, fileTypeJpg, fileTypeTxt2; - let filter = { type: 'TYPE-PNG Image' }; + const filter = { type: 'TYPE-PNG Image' }; let jsonFile; @@ -116,7 +116,7 @@ describe('Search Filters', () => { searchDialog.checkSearchIconIsVisible(); searchDialog.clickOnSearchIcon(); - let searchConfiguration = new SearchConfiguration(); + const searchConfiguration = new SearchConfiguration(); jsonFile = searchConfiguration.getConfiguration(); done(); @@ -139,7 +139,7 @@ describe('Search Filters', () => { searchFiltersPage.checkSearchFiltersIsDisplayed(); - let userOption = `${acsUser.firstName} ${acsUser.lastName}`; + const userOption = `${acsUser.firstName} ${acsUser.lastName}`; searchFiltersPage.creatorCheckListFiltersPage().filterBy(userOption) .checkChipIsDisplayed(userOption) .removeFilterOption(userOption) @@ -175,9 +175,9 @@ describe('Search Filters', () => { searchFiltersPage.fileTypeCheckListFiltersPage().clickCheckListOption('PNG Image'); - let bucketNumberForFilter = searchFiltersPage.fileTypeCheckListFiltersPage().getBucketNumberOfFilterType(filter.type); + const bucketNumberForFilter = searchFiltersPage.fileTypeCheckListFiltersPage().getBucketNumberOfFilterType(filter.type); - let resultFileNames = contentList.getAllRowsColumnValues('Display name'); + const resultFileNames = contentList.getAllRowsColumnValues('Display name'); expect(bucketNumberForFilter).not.toEqual('0'); diff --git a/e2e/search/search-multiselect.e2e.ts b/e2e/search/search-multiselect.e2e.ts index daa2a5e70b..8d19614bcf 100644 --- a/e2e/search/search-multiselect.e2e.ts +++ b/e2e/search/search-multiselect.e2e.ts @@ -33,11 +33,11 @@ import { AcsUserModel } from '../models/ACS/acsUserModel'; import { FileModel } from '../models/ACS/fileModel'; describe('Search Component - Multi-Select Facet', () => { - let loginPage = new LoginPage(); - let searchDialog = new SearchDialog(); - let searchResultsPage = new SearchResultsPage(); - let uploadActions = new UploadActions(); - let searchFiltersPage = new SearchFiltersPage(); + const loginPage = new LoginPage(); + const searchDialog = new SearchDialog(); + const searchResultsPage = new SearchResultsPage(); + const uploadActions = new UploadActions(); + const searchFiltersPage = new SearchFiltersPage(); let site, userOption; beforeAll(() => { @@ -49,14 +49,14 @@ describe('Search Component - Multi-Select Facet', () => { describe('', () => { let jpgFile, jpgFileSite, txtFile, txtFileSite; - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let randomName = Util.generateRandomString(); - let jpgFileInfo = new FileModel({ + const randomName = Util.generateRandomString(); + const jpgFileInfo = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.JPG.file_location, 'name': `${randomName}.jpg` }); - let txtFileInfo = new FileModel({ + const txtFileInfo = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location, 'name': `${randomName}.txt` }); @@ -129,15 +129,15 @@ describe('Search Component - Multi-Select Facet', () => { describe('', () => { let jpgFile, txtFile; - let userUploadingTxt = new AcsUserModel(); - let userUploadingImg = new AcsUserModel(); + const userUploadingTxt = new AcsUserModel(); + const userUploadingImg = new AcsUserModel(); - let randomName = Util.generateRandomString(); - let jpgFileInfo = new FileModel({ + const randomName = Util.generateRandomString(); + const jpgFileInfo = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.JPG.file_location, 'name': `${randomName}.jpg` }); - let txtFileInfo = new FileModel({ + const txtFileInfo = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location, 'name': `${randomName}.txt` }); @@ -199,10 +199,10 @@ describe('Search Component - Multi-Select Facet', () => { describe('', () => { let txtFile; - let acsUser = new AcsUserModel(); + const acsUser = new AcsUserModel(); - let randomName = Util.generateRandomString(); - let txtFileInfo = new FileModel({ + const randomName = Util.generateRandomString(); + const txtFileInfo = new FileModel({ 'location': resources.Files.ADF_DOCUMENTS.TXT_0B.file_location, 'name': `${randomName}.txt` }); diff --git a/e2e/search/search-page-component.e2e.ts b/e2e/search/search-page-component.e2e.ts index 3c19795c81..24c5fba447 100644 --- a/e2e/search/search-page-component.e2e.ts +++ b/e2e/search/search-page-component.e2e.ts @@ -36,7 +36,7 @@ import { AlfrescoApiCompatibility as AlfrescoApi } from '@alfresco/js-api'; import { UploadActions } from '../actions/ACS/upload.actions'; describe('Search component - Search Page', () => { - let search = { + const search = { active: { firstFile: null, secondFile: null, @@ -49,17 +49,20 @@ describe('Search component - Search Page', () => { } }; - let loginPage = new LoginPage(); - let contentServicesPage = new ContentServicesPage(); - let searchDialog = new SearchDialog(); - let searchResultPage = new SearchResultsPage(); - let filePreviewPage = new FilePreviewPage(); + const loginPage = new LoginPage(); + const contentServicesPage = new ContentServicesPage(); + const searchDialog = new SearchDialog(); + const searchResultPage = new SearchResultsPage(); + const filePreviewPage = new FilePreviewPage(); - let acsUser = new AcsUserModel(); - let emptyFolderModel = new FolderModel({ 'name': 'search' + Util.generateRandomString() }); + const acsUser = new AcsUserModel(); + const emptyFolderModel = new FolderModel({ 'name': 'search' + Util.generateRandomString() }); let firstFileModel; - let newFolderModel = new FolderModel({ 'name': 'newFolder' }); - let fileNames = [], adminFileNames = [], nrOfFiles = 15, adminNrOfFiles = 5; + const newFolderModel = new FolderModel({ 'name': 'newFolder' }); + let fileNames = []; + let adminFileNames = []; + const nrOfFiles = 15; + const adminNrOfFiles = 5; beforeAll(async (done) => { fileNames = Util.generateSequenceFiles(1, nrOfFiles, search.active.base, search.active.extension); @@ -73,7 +76,7 @@ describe('Search component - Search Page', () => { 'location': resources.Files.ADF_DOCUMENTS.TXT.file_location }); - let uploadActions = new UploadActions(); + const uploadActions = new UploadActions(); this.alfrescoJsApi = new AlfrescoApi({ provider: 'ECM', @@ -87,7 +90,7 @@ describe('Search component - Search Page', () => { await this.alfrescoJsApi.login(acsUser.id, acsUser.password); await uploadActions.createFolder(this.alfrescoJsApi, emptyFolderModel.name, '-my-'); - let newFolderModelUploaded = await uploadActions.createFolder(this.alfrescoJsApi, newFolderModel.name, '-my-'); + const newFolderModelUploaded = await uploadActions.createFolder(this.alfrescoJsApi, newFolderModel.name, '-my-'); await uploadActions.createEmptyFiles(this.alfrescoJsApi, fileNames, newFolderModelUploaded.entry.id); @@ -105,7 +108,7 @@ describe('Search component - Search Page', () => { }); it('[C260264] Should display message when no results are found', () => { - let notExistentFileName = Util.generateRandomString(); + const notExistentFileName = Util.generateRandomString(); searchDialog.checkSearchBarIsNotVisible().checkSearchIconIsVisible().clickOnSearchIcon() .enterTextAndPressEnter(notExistentFileName); searchResultPage.checkNoResultMessageIsDisplayed(); diff --git a/e2e/util/util.ts b/e2e/util/util.ts index ab25fc7ff7..27a7272c35 100644 --- a/e2e/util/util.ts +++ b/e2e/util/util.ts @@ -20,8 +20,8 @@ import fs = require('fs'); import path = require('path'); import TestConfig = require('../test.config'); -let until = protractor.ExpectedConditions; -let DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout, 10); +const until = protractor.ExpectedConditions; +const DEFAULT_TIMEOUT = parseInt(TestConfig.main.timeout, 10); export class Util { @@ -29,7 +29,7 @@ export class Util { * creates an absolute path string if multiple file uploads are required */ static uploadParentFolder(filePath) { - let parentFolder = path.resolve(path.join(__dirname, 'test')); + const parentFolder = path.resolve(path.join(__dirname, 'test')); return path.resolve(path.join(parentFolder, filePath)); } @@ -42,7 +42,7 @@ export class Util { */ static generateRandomString(length: number = 8): string { let text = ''; - let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; for (let i = 0; i < length; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); @@ -53,9 +53,9 @@ export class Util { static generatePasswordString(length: number = 8): string { let text = ''; - let possibleUpperCase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - let possibleLowerCase = 'abcdefghijklmnopqrstuvwxyz'; - let lowerCaseLimit = Math.floor(length / 2); + const possibleUpperCase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + const possibleLowerCase = 'abcdefghijklmnopqrstuvwxyz'; + const lowerCaseLimit = Math.floor(length / 2); for (let i = 0; i < lowerCaseLimit; i++) { text += possibleLowerCase.charAt(Math.floor(Math.random() * possibleLowerCase.length)); @@ -77,7 +77,7 @@ export class Util { */ static generateRandomStringDigits(length: number = 8): string { let text = ''; - let possible = '0123456789'; + const possible = '0123456789'; for (let i = 0; i < length; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); @@ -95,7 +95,7 @@ export class Util { */ static generateRandomStringNonLatin(length: number = 3): string { let text = ''; - let possible = '密码你好𠮷'; + const possible = '密码你好𠮷'; for (let i = 0; i < length; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); @@ -137,7 +137,7 @@ export class Util { * @method generateSequenceFiles */ static generateSequenceFiles(startIndex, endIndex, baseName, extension) { - let fileNames = []; + const fileNames = []; for (let i = startIndex; i <= endIndex; i++) { fileNames.push(baseName + i + extension); } @@ -165,7 +165,7 @@ export class Util { */ static generateRandomEmail(length: number = 5): string { let email = ''; - let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; for (let i = 0; i < length; i++) { email += possible.charAt(Math.floor(Math.random() * possible.length)); @@ -181,9 +181,9 @@ export class Util { * @method generateRandomDateFormat */ static generateRandomDateFormat(): string { - let day = Math.floor(Math.random() * (29 - 1) + 1); - let month = Math.floor(Math.random() * (12 - 1) + 1); - let year = Math.floor(Math.random() * (2100 - 1990) + 1990); + const day = Math.floor(Math.random() * (29 - 1) + 1); + const month = Math.floor(Math.random() * (12 - 1) + 1); + const year = Math.floor(Math.random() * (2100 - 1990) + 1990); return day + '.' + month + '.' + year; } @@ -194,17 +194,18 @@ export class Util { * @method generateRandomDate */ static generateRandomDate(): string { - let dayText, monthText; + let dayText; + let monthText; - let day = (Math.floor(Math.random() * (29 - 1) + 1)); + const day = (Math.floor(Math.random() * (29 - 1) + 1)); if (day < 10) { dayText = '0' + day.toString(); } - let month = Math.floor(Math.random() * (12 - 1) + 1); + const month = Math.floor(Math.random() * (12 - 1) + 1); if (month < 10) { monthText = '0' + month.toString(); } - let year = Math.floor(Math.random() * (2100 - 1990) + 1990); + const year = Math.floor(Math.random() * (2100 - 1990) + 1990); return dayText + '-' + monthText + '-' + year.toString(); } @@ -235,7 +236,7 @@ export class Util { * @method readFile */ static readFile(filePath, callback) { - let absolutePath = path.join(TestConfig.main.rootPath + filePath); + const absolutePath = path.join(TestConfig.main.rootPath + filePath); fs.readFile(absolutePath, { encoding: 'utf8' }, function (err, data) { if (err) { throw err; @@ -333,7 +334,7 @@ export class Util { */ static waitForPage() { browser.wait(function () { - let deferred = protractor.promise.defer(); + const deferred = protractor.promise.defer(); browser.executeScript('return document.readyState').then((text) => { deferred.fulfill(() => { return text === 'complete'; @@ -363,7 +364,7 @@ export class Util { static fileExists(filePath, retries) { let tries = 0; return new Promise(function (resolve, reject) { - let checkExist = setInterval(() => { + const checkExist = setInterval(() => { fs.stat(filePath, function (error, stats) { tries++; diff --git a/lib/content-services/breadcrumb/breadcrumb.component.spec.ts b/lib/content-services/breadcrumb/breadcrumb.component.spec.ts index 7f6320c268..3a1f4292de 100644 --- a/lib/content-services/breadcrumb/breadcrumb.component.spec.ts +++ b/lib/content-services/breadcrumb/breadcrumb.component.spec.ts @@ -46,7 +46,7 @@ describe('Breadcrumb', () => { }); it('should prevent default click behavior', () => { - let event = jasmine.createSpyObj('event', ['preventDefault']); + const event = jasmine.createSpyObj('event', ['preventDefault']); component.onRoutePathClick(null, event); expect(event.preventDefault).toHaveBeenCalled(); }); @@ -60,7 +60,7 @@ describe('Breadcrumb', () => { }); it('should emit navigation event', (done) => { - let node = { id: '-id-', name: 'name' }; + const node = { id: '-id-', name: 'name' }; component.navigate.subscribe((val) => { expect(val).toBe(node); done(); @@ -72,7 +72,7 @@ describe('Breadcrumb', () => { it('should update document list on click', (done) => { spyOn(documentList, 'loadFolderByNodeId').and.stub(); - let node = { id: '-id-', name: 'name' }; + const node = { id: '-id-', name: 'name' }; component.target = documentList; component.onRoutePathClick(node, null); diff --git a/lib/content-services/breadcrumb/breadcrumb.component.ts b/lib/content-services/breadcrumb/breadcrumb.component.ts index cb68cc0925..f152ac87b7 100644 --- a/lib/content-services/breadcrumb/breadcrumb.component.ts +++ b/lib/content-services/breadcrumb/breadcrumb.component.ts @@ -108,7 +108,7 @@ export class BreadcrumbComponent implements OnInit, OnChanges { } protected recalculateNodes(): void { - let node: Node = this.transform ? this.transform(this.folderNode) : this.folderNode; + const node: Node = this.transform ? this.transform(this.folderNode) : this.folderNode; this.route = this.parseRoute(node); diff --git a/lib/content-services/breadcrumb/dropdown-breadcrumb.component.spec.ts b/lib/content-services/breadcrumb/dropdown-breadcrumb.component.spec.ts index 4ba7612337..12983a1385 100644 --- a/lib/content-services/breadcrumb/dropdown-breadcrumb.component.spec.ts +++ b/lib/content-services/breadcrumb/dropdown-breadcrumb.component.spec.ts @@ -63,7 +63,7 @@ describe('DropdownBreadcrumb', () => { } it('should display only the current folder name if there is no previous folders', (done) => { - let fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); + const fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); fakeNodeWithCreatePermissionInstance.path.elements = []; triggerComponentChange(fakeNodeWithCreatePermissionInstance); @@ -83,7 +83,7 @@ describe('DropdownBreadcrumb', () => { }); it('should display only the path in the selectBox', (done) => { - let fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); + const fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); fakeNodeWithCreatePermissionInstance.path.elements = [ { id: '1', name: 'Stark Industries' }, { id: '2', name: 'User Homes' }, @@ -105,7 +105,7 @@ describe('DropdownBreadcrumb', () => { }); xit('should display the path in reverse order', (done) => { - let fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); + const fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); fakeNodeWithCreatePermissionInstance.path.elements = [ { id: '1', name: 'Stark Industries' }, { id: '2', name: 'User Homes' }, @@ -130,7 +130,7 @@ describe('DropdownBreadcrumb', () => { }); it('should emit navigation event when clicking on an option', (done) => { - let fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); + const fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); fakeNodeWithCreatePermissionInstance.path.elements = [{ id: '1', name: 'Stark Industries' }]; triggerComponentChange(fakeNodeWithCreatePermissionInstance); @@ -153,7 +153,7 @@ describe('DropdownBreadcrumb', () => { it('should update document list when clicking on an option', (done) => { spyOn(documentList, 'loadFolderByNodeId').and.stub(); component.target = documentList; - let fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); + const fakeNodeWithCreatePermissionInstance = JSON.parse(JSON.stringify(fakeNodeWithCreatePermission)); fakeNodeWithCreatePermissionInstance.path.elements = [{ id: '1', name: 'Stark Industries' }]; triggerComponentChange(fakeNodeWithCreatePermissionInstance); diff --git a/lib/content-services/breadcrumb/dropdown-breadcrumb.component.ts b/lib/content-services/breadcrumb/dropdown-breadcrumb.component.ts index a5ad0ebbb6..aab5f4dec0 100644 --- a/lib/content-services/breadcrumb/dropdown-breadcrumb.component.ts +++ b/lib/content-services/breadcrumb/dropdown-breadcrumb.component.ts @@ -41,7 +41,7 @@ export class DropdownBreadcrumbComponent extends BreadcrumbComponent implements * Calculate the current and previous nodes from the route array */ protected recalculateNodes(): void { - let node: Node = this.transform ? this.transform(this.folderNode) : this.folderNode; + const node: Node = this.transform ? this.transform(this.folderNode) : this.folderNode; this.route = this.parseRoute(node); this.currentNode = this.route[this.route.length - 1]; diff --git a/lib/content-services/content-metadata/components/content-metadata-card/content-metadata-card.component.spec.ts b/lib/content-services/content-metadata/components/content-metadata-card/content-metadata-card.component.spec.ts index 4e6265c1dc..7c1f730fa1 100644 --- a/lib/content-services/content-metadata/components/content-metadata-card/content-metadata-card.component.spec.ts +++ b/lib/content-services/content-metadata/components/content-metadata-card/content-metadata-card.component.spec.ts @@ -28,7 +28,7 @@ describe('ContentMetadataCardComponent', () => { let component: ContentMetadataCardComponent; let fixture: ComponentFixture; let node: Node; - let preset = 'custom-preset'; + const preset = 'custom-preset'; setupTestBed({ imports: [ContentTestingModule] diff --git a/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.spec.ts b/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.spec.ts index 64d6b78b9c..ac6bfd0dec 100644 --- a/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.spec.ts +++ b/lib/content-services/content-metadata/components/content-metadata/content-metadata.component.spec.ts @@ -33,7 +33,7 @@ describe('ContentMetadataComponent', () => { let fixture: ComponentFixture; let node: Node; let folderNode: Node; - let preset = 'custom-preset'; + const preset = 'custom-preset'; setupTestBed({ imports: [ContentTestingModule], diff --git a/lib/content-services/content-metadata/services/config/layout-oriented-config.service.ts b/lib/content-services/content-metadata/services/config/layout-oriented-config.service.ts index 680135cb31..d9a867318e 100644 --- a/lib/content-services/content-metadata/services/config/layout-oriented-config.service.ts +++ b/lib/content-services/content-metadata/services/config/layout-oriented-config.service.ts @@ -37,7 +37,7 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig { public reorganiseByConfig(propertyGroups: PropertyGroupContainer): OrganisedPropertyGroup[] { const layoutBlocks = this.config.filter((itemsGroup) => itemsGroup.items); - let organisedPropertyGroup = layoutBlocks.map((layoutBlock) => { + const organisedPropertyGroup = layoutBlocks.map((layoutBlock) => { const flattenedItems = this.flattenItems(layoutBlock.items), properties = flattenedItems.reduce((props, explodedItem) => { const property = getProperty(propertyGroups, explodedItem.groupName, explodedItem.propertyName) || []; @@ -82,7 +82,7 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig { } public isIncludeAllEnabled() { - let includeAllProperty = this.config + const includeAllProperty = this.config .map((config) => config.includeAll) .find((includeAll) => includeAll !== undefined); diff --git a/lib/content-services/content-metadata/services/property-groups-translator.service.ts b/lib/content-services/content-metadata/services/property-groups-translator.service.ts index 8f35d7dcb4..2833552aba 100644 --- a/lib/content-services/content-metadata/services/property-groups-translator.service.ts +++ b/lib/content-services/content-metadata/services/property-groups-translator.service.ts @@ -73,7 +73,7 @@ export class PropertyGroupTranslatorService { const prefix = 'properties.'; - let propertyDefinition: CardViewItemProperties = { + const propertyDefinition: CardViewItemProperties = { label: property.title || property.name, value: propertyValue, key: `${prefix}${property.name}`, diff --git a/lib/content-services/content-node-selector/content-node-dialog.service.spec.ts b/lib/content-services/content-node-selector/content-node-dialog.service.spec.ts index c11321aaa9..95d14a43fb 100644 --- a/lib/content-services/content-node-selector/content-node-dialog.service.spec.ts +++ b/lib/content-services/content-node-selector/content-node-dialog.service.spec.ts @@ -71,7 +71,7 @@ describe('ContentNodeDialogService', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; service = TestBed.get(ContentNodeDialogService); diff --git a/lib/content-services/content-node-selector/content-node-dialog.service.ts b/lib/content-services/content-node-selector/content-node-dialog.service.ts index 5cc98ab687..b1ef6e41ce 100644 --- a/lib/content-services/content-node-selector/content-node-dialog.service.ts +++ b/lib/content-services/content-node-selector/content-node-dialog.service.ts @@ -151,7 +151,7 @@ export class ContentNodeDialogService { return select; } else { - let errors = new Error(JSON.stringify({ error: { statusCode: 403 } })); + const errors = new Error(JSON.stringify({ error: { statusCode: 403 } })); return throwError(errors); } } diff --git a/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts b/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts index 693dddee91..06eaf1aed0 100644 --- a/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts +++ b/lib/content-services/content-node-selector/content-node-selector-panel.component.spec.ts @@ -60,7 +60,7 @@ describe('ContentNodeSelectorComponent', () => { let _observer: Observer; function typeToSearchBox(searchTerm = 'string-to-search') { - let searchInput = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-input"]')); + const searchInput = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-input"]')); searchInput.nativeElement.value = searchTerm; component.searchInput.setValue(searchTerm); fixture.detectChanges(); @@ -323,11 +323,11 @@ describe('ContentNodeSelectorComponent', () => { describe('Search functionality', () => { let getCorrespondingNodeIdsSpy; - let defaultSearchOptions = (searchTerm, rootNodeId = undefined, skipCount = 0) => { + const defaultSearchOptions = (searchTerm, rootNodeId = undefined, skipCount = 0) => { const parentFiltering = rootNodeId ? [{ query: `ANCESTOR:'workspace://SpacesStore/${rootNodeId}'` }] : []; - let defaultSearchNode: any = { + const defaultSearchNode: any = { query: { query: searchTerm ? `${searchTerm}* OR name:${searchTerm}*` : searchTerm }, @@ -507,8 +507,8 @@ describe('ContentNodeSelectorComponent', () => { fixture.detectChanges(); tick(debounceSearch); - let searchIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-icon"]')); - let clearIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-clear"]')); + const searchIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-icon"]')); + const clearIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-clear"]')); expect(searchIcon).not.toBeNull('Search icon should be in the DOM'); expect(clearIcon).toBeNull('Clear icon should NOT be in the DOM'); @@ -521,8 +521,8 @@ describe('ContentNodeSelectorComponent', () => { fixture.detectChanges(); - let searchIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-icon"]')); - let clearIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-clear"]')); + const searchIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-icon"]')); + const clearIcon = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-clear"]')); expect(searchIcon).toBeNull('Search icon should NOT be in the DOM'); expect(clearIcon).not.toBeNull('Clear icon should be in the DOM'); @@ -602,13 +602,13 @@ describe('ContentNodeSelectorComponent', () => { })); it('should show the current folder\'s content instead of search results if search was not performed', () => { - let documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); + const documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.currentFolderId).toBe('cat-girl-nuku-nuku'); }); it('should pass through the rowFilter to the documentList', () => { - let filter = (shareDataRow: ShareDataRow) => { + const filter = (shareDataRow: ShareDataRow) => { if (shareDataRow.node.entry.name === 'impossible-name') { return true; } @@ -618,7 +618,7 @@ describe('ContentNodeSelectorComponent', () => { fixture.detectChanges(); - let documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); + const documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.rowFilter({ node: { @@ -643,7 +643,7 @@ describe('ContentNodeSelectorComponent', () => { fixture.detectChanges(); - let documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); + const documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.rowFilter).toBeTruthy('Document list should have had a rowFilter'); @@ -658,7 +658,7 @@ describe('ContentNodeSelectorComponent', () => { fixture.detectChanges(); - let documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); + const documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.imageResolver).toBe(resolver); }); @@ -670,7 +670,7 @@ describe('ContentNodeSelectorComponent', () => { respondWithSearchResults(ONE_FOLDER_RESULT); fixture.detectChanges(); - let documentList = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-document-list"]')); + const documentList = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-document-list"]')); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.currentFolderId).toBeNull(); done(); @@ -700,12 +700,12 @@ describe('ContentNodeSelectorComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let clearButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-clear"]')); + const clearButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-search-clear"]')); expect(clearButton).not.toBeNull('Clear button should be in DOM'); clearButton.triggerEventHandler('click', {}); fixture.detectChanges(); - let documentList = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-document-list"]')); + const documentList = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-document-list"]')); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.currentFolderId).toBe('cat-girl-nuku-nuku'); done(); @@ -726,7 +726,7 @@ describe('ContentNodeSelectorComponent', () => { fixture.detectChanges(); - let documentList = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-document-list"]')); + const documentList = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-document-list"]')); expect(documentList.componentInstance.currentFolderId).toBe('cat-girl-nuku-nuku'); })); diff --git a/lib/content-services/content-node-selector/content-node-selector.component.spec.ts b/lib/content-services/content-node-selector/content-node-selector.component.spec.ts index 75ede2ffe0..260d2a3edf 100644 --- a/lib/content-services/content-node-selector/content-node-selector.component.spec.ts +++ b/lib/content-services/content-node-selector/content-node-selector.component.spec.ts @@ -33,7 +33,7 @@ describe('ContentNodeSelectorDialogComponent', () => { let component: ContentNodeSelectorComponent; let fixture: ComponentFixture; - let data: any = { + const data: any = { title: 'Move along citizen...', actionName: 'move', select: new EventEmitter(), @@ -87,13 +87,13 @@ describe('ContentNodeSelectorDialogComponent', () => { }); it('should pass through the injected currentFolderId to the documentList', () => { - let documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); + const documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.currentFolderId).toBe('cat-girl-nuku-nuku'); }); it('should pass through the injected rowFilter to the documentList', () => { - let documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); + const documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.rowFilter({ node: { @@ -114,7 +114,7 @@ describe('ContentNodeSelectorDialogComponent', () => { }); it('should pass through the injected imageResolver to the documentList', () => { - let documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); + const documentList = fixture.debugElement.query(By.directive(DocumentListComponent)); expect(documentList).not.toBeNull('Document list should be shown'); expect(documentList.componentInstance.imageResolver).toBe(data.imageResolver); }); @@ -150,7 +150,7 @@ describe('ContentNodeSelectorDialogComponent', () => { it('should be disabled by default', () => { fixture.detectChanges(); - let actionButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]')); + const actionButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]')); expect(actionButton.nativeElement.disabled).toBeTruthy(); }); @@ -158,7 +158,7 @@ describe('ContentNodeSelectorDialogComponent', () => { component.onSelect([new Node({ id: 'fake' })]); fixture.detectChanges(); - let actionButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]')); + const actionButton = fixture.debugElement.query(By.css('[data-automation-id="content-node-selector-actions-choose"]')); expect(actionButton.nativeElement.disabled).toBeFalsy(); }); diff --git a/lib/content-services/content-node-selector/content-node-selector.service.ts b/lib/content-services/content-node-selector/content-node-selector.service.ts index 147dd9b513..a725d6cf67 100644 --- a/lib/content-services/content-node-selector/content-node-selector.service.ts +++ b/lib/content-services/content-node-selector/content-node-selector.service.ts @@ -56,7 +56,7 @@ export class ContentNodeSelectorService { const parentFiltering = rootNodeId ? [{ query: `ANCESTOR:'workspace://SpacesStore/${rootNodeId}'${extraParentFiltering}` }] : []; - let defaultSearchNode: any = { + const defaultSearchNode: any = { query: { query: `${searchTerm}* OR name:${searchTerm}*` }, diff --git a/lib/content-services/content-node-share/content-node-share.dialog.spec.ts b/lib/content-services/content-node-share/content-node-share.dialog.spec.ts index 73b16865c6..3df697907e 100644 --- a/lib/content-services/content-node-share/content-node-share.dialog.spec.ts +++ b/lib/content-services/content-node-share/content-node-share.dialog.spec.ts @@ -34,7 +34,7 @@ import moment from 'moment-es6'; describe('ShareDialogComponent', () => { let node; let matDialog: MatDialog; - let notificationServiceMock = { + const notificationServiceMock = { openSnackMessage: jasmine.createSpy('openSnackMessage') }; let sharedLinksApiService: SharedLinksApiService; diff --git a/lib/content-services/dialogs/folder.dialog.spec.ts b/lib/content-services/dialogs/folder.dialog.spec.ts index 5676939a34..d68a05bdf7 100644 --- a/lib/content-services/dialogs/folder.dialog.spec.ts +++ b/lib/content-services/dialogs/folder.dialog.spec.ts @@ -29,7 +29,7 @@ describe('FolderDialogComponent', () => { let fixture: ComponentFixture; let component: FolderDialogComponent; let nodesApi: NodesApiService; - let dialogRef = { + const dialogRef = { close: jasmine.createSpy('close') }; diff --git a/lib/content-services/dialogs/folder.dialog.ts b/lib/content-services/dialogs/folder.dialog.ts index 1daddd116d..c1aeea14a5 100644 --- a/lib/content-services/dialogs/folder.dialog.ts +++ b/lib/content-services/dialogs/folder.dialog.ts @@ -99,13 +99,13 @@ export class FolderDialogComponent implements OnInit { } get name(): string { - let { name } = this.form.value; + const { name } = this.form.value; return (name || '').trim(); } get description(): string { - let { description } = this.form.value; + const { description } = this.form.value; return (description || '').trim(); } diff --git a/lib/content-services/dialogs/node-lock.dialog.spec.ts b/lib/content-services/dialogs/node-lock.dialog.spec.ts index 03548d0432..40fa07162c 100644 --- a/lib/content-services/dialogs/node-lock.dialog.spec.ts +++ b/lib/content-services/dialogs/node-lock.dialog.spec.ts @@ -83,7 +83,7 @@ describe('NodeLockDialogComponent', () => { }); it('should update form inputs', () => { - let newTime = moment(); + const newTime = moment(); component.form.controls['isLocked'].setValue(false); component.form.controls['allowOwner'].setValue(false); component.form.controls['isTimeLock'].setValue(false); diff --git a/lib/content-services/dialogs/node-lock.dialog.ts b/lib/content-services/dialogs/node-lock.dialog.ts index d5f2e0b375..fa4875ef3b 100644 --- a/lib/content-services/dialogs/node-lock.dialog.ts +++ b/lib/content-services/dialogs/node-lock.dialog.ts @@ -59,7 +59,7 @@ export class NodeLockDialogComponent implements OnInit { private get lockTimeInSeconds(): number { if (this.form.value.isTimeLock) { - let duration = moment.duration(moment(this.form.value.time).diff(moment())); + const duration = moment.duration(moment(this.form.value.time).diff(moment())); return duration.asSeconds(); } diff --git a/lib/content-services/document-list/components/content-action/content-action-list.component.spec.ts b/lib/content-services/document-list/components/content-action/content-action-list.component.spec.ts index e32c336012..fa130a5f0c 100644 --- a/lib/content-services/document-list/components/content-action/content-action-list.component.spec.ts +++ b/lib/content-services/document-list/components/content-action/content-action-list.component.spec.ts @@ -41,8 +41,8 @@ describe('ContentColumnList', () => { it('should register action', () => { spyOn(documentList.actions, 'push').and.callThrough(); - let action = new ContentActionModel(); - let result = actionList.registerAction(action); + const action = new ContentActionModel(); + const result = actionList.registerAction(action); expect(result).toBeTruthy(); expect(documentList.actions.push).toHaveBeenCalledWith(action); @@ -50,13 +50,13 @@ describe('ContentColumnList', () => { it('should require document list instance to register action', () => { actionList = new ContentActionListComponent(null); - let action = new ContentActionModel(); + const action = new ContentActionModel(); expect(actionList.registerAction(action)).toBeFalsy(); }); it('should require action instance to register', () => { spyOn(documentList.actions, 'push').and.callThrough(); - let result = actionList.registerAction(null); + const result = actionList.registerAction(null); expect(result).toBeFalsy(); expect(documentList.actions.push).not.toHaveBeenCalled(); diff --git a/lib/content-services/document-list/components/content-action/content-action.component.spec.ts b/lib/content-services/document-list/components/content-action/content-action.component.spec.ts index 9c35e0bd7f..91d47c6ba9 100644 --- a/lib/content-services/document-list/components/content-action/content-action.component.spec.ts +++ b/lib/content-services/document-list/components/content-action/content-action.component.spec.ts @@ -58,14 +58,14 @@ describe('ContentAction', () => { it('should register within parent actions list', () => { spyOn(actionList, 'registerAction').and.stub(); - let action = new ContentActionComponent(actionList, null, null); + const action = new ContentActionComponent(actionList, null, null); action.ngOnInit(); expect(actionList.registerAction).toHaveBeenCalled(); }); it('should setup and register model', () => { - let action = new ContentActionComponent(actionList, null, null); + const action = new ContentActionComponent(actionList, null, null); action.target = 'document'; action.title = ''; action.icon = '<icon>'; @@ -75,14 +75,14 @@ describe('ContentAction', () => { expect(documentList.actions.length).toBe(1); - let model = documentList.actions[0]; + const model = documentList.actions[0]; expect(model.target).toBe(action.target); expect(model.title).toBe(action.title); expect(model.icon).toBe(action.icon); }); it('should update visibility binding', () => { - let action = new ContentActionComponent(actionList, null, null); + const action = new ContentActionComponent(actionList, null, null); action.target = 'document'; action.title = '<title>'; action.icon = '<icon>'; @@ -101,11 +101,11 @@ describe('ContentAction', () => { it('should get action handler from document actions service', () => { - let handler = function () { + const handler = function () { }; spyOn(documentActions, 'getHandler').and.returnValue(handler); - let action = new ContentActionComponent(actionList, documentActions, null); + const action = new ContentActionComponent(actionList, documentActions, null); action.target = 'document'; action.handler = '<handler>'; action.ngOnInit(); @@ -113,16 +113,16 @@ describe('ContentAction', () => { expect(documentActions.getHandler).toHaveBeenCalledWith(action.handler); expect(documentList.actions.length).toBe(1); - let model = documentList.actions[0]; + const model = documentList.actions[0]; expect(model.handler).toBe(handler); }); it('should get action handler from folder actions service', () => { - let handler = function () { + const handler = function () { }; spyOn(folderActions, 'getHandler').and.returnValue(handler); - let action = new ContentActionComponent(actionList, null, folderActions); + const action = new ContentActionComponent(actionList, null, folderActions); action.target = 'folder'; action.handler = '<handler>'; action.ngOnInit(); @@ -130,7 +130,7 @@ describe('ContentAction', () => { expect(folderActions.getHandler).toHaveBeenCalledWith(action.handler); expect(documentList.actions.length).toBe(1); - let model = documentList.actions[0]; + const model = documentList.actions[0]; expect(model.handler).toBe(handler); }); @@ -138,7 +138,7 @@ describe('ContentAction', () => { spyOn(folderActions, 'getHandler').and.stub(); spyOn(documentActions, 'getHandler').and.stub(); - let action = new ContentActionComponent(actionList, documentActions, folderActions); + const action = new ContentActionComponent(actionList, documentActions, folderActions); action.handler = '<handler>'; action.ngOnInit(); @@ -151,7 +151,7 @@ describe('ContentAction', () => { spyOn(folderActions, 'getHandler').and.stub(); spyOn(documentActions, 'getHandler').and.stub(); - let action = new ContentActionComponent(actionList, documentActions, folderActions); + const action = new ContentActionComponent(actionList, documentActions, folderActions); action.handler = '<handler>'; action.target = 'document'; @@ -165,7 +165,7 @@ describe('ContentAction', () => { spyOn(folderActions, 'getHandler').and.stub(); spyOn(documentActions, 'getHandler').and.stub(); - let action = new ContentActionComponent(actionList, documentActions, folderActions); + const action = new ContentActionComponent(actionList, documentActions, folderActions); action.handler = '<handler>'; action.target = 'folder'; @@ -178,7 +178,7 @@ describe('ContentAction', () => { it('should be case insensitive for document target', () => { spyOn(documentActions, 'getHandler').and.stub(); - let action = new ContentActionComponent(actionList, documentActions, null); + const action = new ContentActionComponent(actionList, documentActions, null); action.target = 'DoCuMeNt'; action.handler = '<handler>'; @@ -189,7 +189,7 @@ describe('ContentAction', () => { it('should be case insensitive for folder target', () => { spyOn(folderActions, 'getHandler').and.stub(); - let action = new ContentActionComponent(actionList, null, folderActions); + const action = new ContentActionComponent(actionList, null, folderActions); action.target = 'FoLdEr'; action.handler = '<handler>'; @@ -198,46 +198,46 @@ describe('ContentAction', () => { }); it('should use custom "execute" emitter', (done) => { - let emitter = new EventEmitter(); + const emitter = new EventEmitter(); emitter.subscribe((e) => { expect(e.value).toBe('<obj>'); done(); }); - let action = new ContentActionComponent(actionList, null, null); + const action = new ContentActionComponent(actionList, null, null); action.target = 'document'; action.execute = emitter; action.ngOnInit(); expect(documentList.actions.length).toBe(1); - let model = documentList.actions[0]; + const model = documentList.actions[0]; model.execute('<obj>'); }); it('should not find document action handler with missing service', () => { - let action = new ContentActionComponent(actionList, null, null); + const action = new ContentActionComponent(actionList, null, null); expect(action.getSystemHandler('document', 'name')).toBeNull(); }); it('should not find folder action handler with missing service', () => { - let action = new ContentActionComponent(actionList, null, null); + const action = new ContentActionComponent(actionList, null, null); expect(action.getSystemHandler('folder', 'name')).toBeNull(); }); it('should find document action handler via service', () => { - let handler = <ContentActionHandler> function (obj: any, target?: any) { + const handler = <ContentActionHandler> function (obj: any, target?: any) { }; - let action = new ContentActionComponent(actionList, documentActions, null); + const action = new ContentActionComponent(actionList, documentActions, null); spyOn(documentActions, 'getHandler').and.returnValue(handler); expect(action.getSystemHandler('document', 'name')).toBe(handler); }); it('should find folder action handler via service', () => { - let handler = <ContentActionHandler> function (obj: any, target?: any) { + const handler = <ContentActionHandler> function (obj: any, target?: any) { }; - let action = new ContentActionComponent(actionList, null, folderActions); + const action = new ContentActionComponent(actionList, null, folderActions); spyOn(folderActions, 'getHandler').and.returnValue(handler); expect(action.getSystemHandler('folder', 'name')).toBe(handler); }); @@ -246,7 +246,7 @@ describe('ContentAction', () => { spyOn(folderActions, 'getHandler').and.stub(); spyOn(documentActions, 'getHandler').and.stub(); - let action = new ContentActionComponent(actionList, documentActions, folderActions); + const action = new ContentActionComponent(actionList, documentActions, folderActions); expect(action.getSystemHandler('unknown', 'name')).toBeNull(); expect(folderActions.getHandler).not.toHaveBeenCalled(); @@ -255,10 +255,10 @@ describe('ContentAction', () => { }); it('should wire model with custom event handler', async(() => { - let action = new ContentActionComponent(actionList, documentActions, folderActions); - let file = new FileNode(); + const action = new ContentActionComponent(actionList, documentActions, folderActions); + const file = new FileNode(); - let handler = new EventEmitter(); + const handler = new EventEmitter(); handler.subscribe((e) => { expect(e.value).toBe(file); }); @@ -270,7 +270,7 @@ describe('ContentAction', () => { })); it('should allow registering model without handler', () => { - let action = new ContentActionComponent(actionList, documentActions, folderActions); + const action = new ContentActionComponent(actionList, documentActions, folderActions); spyOn(actionList, 'registerAction').and.callThrough(); action.execute = null; @@ -282,7 +282,7 @@ describe('ContentAction', () => { }); it('should register on init', () => { - let action = new ContentActionComponent(actionList, null, null); + const action = new ContentActionComponent(actionList, null, null); spyOn(action, 'register').and.callThrough(); action.ngOnInit(); diff --git a/lib/content-services/document-list/components/content-column/content-column-list.component.spec.ts b/lib/content-services/document-list/components/content-column/content-column-list.component.spec.ts index fad9274365..80babccd6b 100644 --- a/lib/content-services/document-list/components/content-column/content-column-list.component.spec.ts +++ b/lib/content-services/document-list/components/content-column/content-column-list.component.spec.ts @@ -43,11 +43,11 @@ describe('ContentColumnList', () => { }); it('should register column within parent document list', () => { - let columns = documentList.data.getColumns(); + const columns = documentList.data.getColumns(); expect(columns.length).toBe(0); - let column = <DataColumn> {}; - let result = columnList.registerColumn(column); + const column = <DataColumn> {}; + const result = columnList.registerColumn(column); expect(result).toBeTruthy(); expect(columns.length).toBe(1); @@ -56,13 +56,13 @@ describe('ContentColumnList', () => { it('should require document list instance to register action', () => { columnList = new ContentColumnListComponent(null, logService); - let col = <DataColumn> {}; + const col = <DataColumn> {}; expect(columnList.registerColumn(col)).toBeFalsy(); }); it('should require action instance to register', () => { spyOn(documentList.actions, 'push').and.callThrough(); - let result = columnList.registerColumn(null); + const result = columnList.registerColumn(null); expect(result).toBeFalsy(); expect(documentList.actions.push).not.toHaveBeenCalled(); diff --git a/lib/content-services/document-list/components/content-column/content-column-list.component.ts b/lib/content-services/document-list/components/content-column/content-column-list.component.ts index 98894c2605..b1bc665692 100644 --- a/lib/content-services/document-list/components/content-column/content-column-list.component.ts +++ b/lib/content-services/document-list/components/content-column/content-column-list.component.ts @@ -39,7 +39,7 @@ export class ContentColumnListComponent { */ registerColumn(column: DataColumn): boolean { if (this.documentList && column) { - let columns = this.documentList.data.getColumns(); + const columns = this.documentList.data.getColumns(); columns.push(column); return true; } diff --git a/lib/content-services/document-list/components/content-column/content-column.component.spec.ts b/lib/content-services/document-list/components/content-column/content-column.component.spec.ts index 14f8100a4e..d657efd697 100644 --- a/lib/content-services/document-list/components/content-column/content-column.component.spec.ts +++ b/lib/content-services/document-list/components/content-column/content-column.component.spec.ts @@ -45,18 +45,18 @@ describe('ContentColumn', () => { it('should register model within parent column list', () => { spyOn(columnList, 'registerColumn').and.callThrough(); - let column = new ContentColumnComponent(columnList, logService); + const column = new ContentColumnComponent(columnList, logService); column.ngAfterContentInit(); expect(columnList.registerColumn).toHaveBeenCalled(); - let columns = documentList.data.getColumns(); + const columns = documentList.data.getColumns(); expect(columns.length).toBe(1); expect(columns[0]).toBe(column); }); it('should setup screen reader title for thumbnail column', () => { - let column = new ContentColumnComponent(columnList, logService); + const column = new ContentColumnComponent(columnList, logService); column.key = '$thumbnail'; column.ngOnInit(); @@ -64,7 +64,7 @@ describe('ContentColumn', () => { }); it('should register on init', () => { - let column = new ContentColumnComponent(columnList, logService); + const column = new ContentColumnComponent(columnList, logService); spyOn(column, 'register').and.callThrough(); column.ngAfterContentInit(); diff --git a/lib/content-services/document-list/components/document-list.component.spec.ts b/lib/content-services/document-list/components/document-list.component.spec.ts index 6a6989a9db..a563bbcd20 100644 --- a/lib/content-services/document-list/components/document-list.component.spec.ts +++ b/lib/content-services/document-list/components/document-list.component.spec.ts @@ -107,7 +107,7 @@ describe('DocumentList', () => { it('should add the custom columns', () => { fixture.detectChanges(); - let column = <DataColumn> { + const column = <DataColumn> { title: 'title', key: 'source', cssClass: 'css', @@ -116,7 +116,7 @@ describe('DocumentList', () => { format: '' }; - let columns = documentList.data.getColumns(); + const columns = documentList.data.getColumns(); columns.push(column); documentList.ngAfterContentInit(); @@ -125,8 +125,8 @@ describe('DocumentList', () => { }); it('should call action\'s handler with node', () => { - let node = new FileNode(); - let action = new ContentActionModel(); + const node = new FileNode(); + const action = new ContentActionModel(); action.handler = () => { }; @@ -138,8 +138,8 @@ describe('DocumentList', () => { }); it('should call action\'s handler with node and permission', () => { - let node = new FileNode(); - let action = new ContentActionModel(); + const node = new FileNode(); + const action = new ContentActionModel(); action.handler = () => { }; action.permission = 'fake-permission'; @@ -151,8 +151,8 @@ describe('DocumentList', () => { }); it('should call action\'s execute with node if it is defined', () => { - let node = new FileNode(); - let action = new ContentActionModel(); + const node = new FileNode(); + const action = new ContentActionModel(); action.execute = () => { }; spyOn(action, 'execute').and.stub(); @@ -164,8 +164,8 @@ describe('DocumentList', () => { it('should call action\'s execute only after the handler has been executed', () => { const deleteObservable: Subject<any> = new Subject<any>(); - let node = new FileNode(); - let action = new ContentActionModel(); + const node = new FileNode(); + const action = new ContentActionModel(); action.handler = () => deleteObservable; action.execute = () => { }; @@ -260,7 +260,7 @@ describe('DocumentList', () => { }); it('should not execute action without node provided', () => { - let action = new ContentActionModel(); + const action = new ContentActionModel(); action.handler = function () { }; @@ -270,15 +270,15 @@ describe('DocumentList', () => { }); it('should not give node actions for empty target', () => { - let actions = documentList.getNodeActions(null); + const actions = documentList.getNodeActions(null); expect(actions.length).toBe(0); }); it('should filter content actions for various targets', () => { - let folderMenu = new ContentActionModel(); + const folderMenu = new ContentActionModel(); folderMenu.target = 'folder'; - let documentMenu = new ContentActionModel(); + const documentMenu = new ContentActionModel(); documentMenu.target = 'document'; documentList.actions = [ @@ -297,7 +297,7 @@ describe('DocumentList', () => { it('should disable the action if there is no permission for the file and disableWithNoPermission true', () => { documentList.currentFolderId = 'fake-node-id'; - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ disableWithNoPermission: true, permission: 'delete', target: 'document', @@ -308,9 +308,9 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; + const nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FileAction'); expect(actions[0].disabled).toBe(true); @@ -382,7 +382,7 @@ describe('DocumentList', () => { }); it('should not disable the action if there is copy permission', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ disableWithNoPermission: true, permission: 'copy', target: 'document', @@ -393,9 +393,9 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; + const nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FileAction'); expect(actions[0].disabled).toBeFalsy(); @@ -403,7 +403,7 @@ describe('DocumentList', () => { }); it('should disable the action if there is no permission for the folder and disableWithNoPermission true', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ disableWithNoPermission: true, permission: 'delete', target: 'folder', @@ -414,9 +414,9 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; + const nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: ['create', 'update'] } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FolderAction'); expect(actions[0].disabled).toBe(true); @@ -424,7 +424,7 @@ describe('DocumentList', () => { }); it('should not disable the action if there is the right permission for the file', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ disableWithNoPermission: true, permission: 'delete', target: 'document', @@ -435,16 +435,16 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete'] } }; + const nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete'] } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FileAction'); expect(actions[0].disabled).toBeFalsy(); }); it('should not disable the action if there is the right permission for the folder', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ disableWithNoPermission: true, permission: 'delete', target: 'folder', @@ -455,16 +455,16 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete'] } }; + const nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: ['create', 'update', 'delete'] } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FolderAction'); expect(actions[0].disabled).toBeFalsy(); }); it('should not disable the action if there are no permissions for the file and disable with no permission is false', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ permission: 'delete', target: 'document', title: 'FileAction', @@ -475,16 +475,16 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: null } }; + const nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: null } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FileAction'); expect(actions[0].disabled).toBeFalsy(); }); it('should not disable the action if there are no permissions for the folder and disable with no permission is false', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ permission: 'delete', target: 'folder', title: 'FolderAction', @@ -495,16 +495,16 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: null } }; + const nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: null } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FolderAction'); expect(actions[0].disabled).toBeFalsy(); }); it('should disable the action if there are no permissions for the file and disable with no permission is true', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ permission: 'delete', target: 'document', title: 'FileAction', @@ -515,9 +515,9 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: null } }; + const nodeFile = { entry: { isFile: true, name: 'xyz', allowableOperations: null } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FileAction'); expect(actions[0].disabled).toBeDefined(); @@ -525,7 +525,7 @@ describe('DocumentList', () => { }); it('should disable the action if there are no permissions for the folder and disable with no permission is true', () => { - let documentMenu = new ContentActionModel({ + const documentMenu = new ContentActionModel({ permission: 'delete', target: 'folder', title: 'FolderAction', @@ -536,9 +536,9 @@ describe('DocumentList', () => { documentMenu ]; - let nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: null } }; + const nodeFile = { entry: { isFolder: true, name: 'xyz', allowableOperations: null } }; - let actions = documentList.getNodeActions(nodeFile); + const actions = documentList.getNodeActions(nodeFile); expect(actions.length).toBe(1); expect(actions[0].title).toEqual('FolderAction'); expect(actions[0].disabled).toBeDefined(); @@ -546,7 +546,7 @@ describe('DocumentList', () => { }); it('should find no content actions', () => { - let documentButton = new ContentActionModel(); + const documentButton = new ContentActionModel(); documentButton.target = 'document'; documentList.actions = [documentButton]; @@ -560,8 +560,8 @@ describe('DocumentList', () => { }); it('should emit nodeClick event', (done) => { - let node = new FileNode(); - let disposableClick = documentList.nodeClick.subscribe((e) => { + const node = new FileNode(); + const disposableClick = documentList.nodeClick.subscribe((e) => { expect(e.value).toBe(node); disposableClick.unsubscribe(); done(); @@ -570,7 +570,7 @@ describe('DocumentList', () => { }); it('should display folder content on click', () => { - let node = new FolderNode('<display name>'); + const node = new FolderNode('<display name>'); spyOn(documentList, 'loadFolder').and.returnValue(Promise.resolve(true)); @@ -593,7 +593,7 @@ describe('DocumentList', () => { expect(documentList.navigate).toBe(true); spyOn(documentList, 'loadFolder').and.stub(); - let node = new FileNode(); + const node = new FileNode(); documentList.onNodeClick(node); expect(documentList.loadFolder).not.toHaveBeenCalled(); @@ -602,7 +602,7 @@ describe('DocumentList', () => { it('should not display folder content on click when navigation is off', () => { spyOn(documentList, 'loadFolder').and.stub(); - let node = new FolderNode('<display name>'); + const node = new FolderNode('<display name>'); documentList.navigate = false; documentList.onNodeClick(node); @@ -610,7 +610,7 @@ describe('DocumentList', () => { }); it('should execute context action on callback', () => { - let action = { + const action = { node: {}, model: {} }; @@ -629,7 +629,7 @@ describe('DocumentList', () => { it('should subscribe to context action handler', () => { spyOn(documentList, 'loadFolder').and.stub(); spyOn(documentList, 'contextActionCallback').and.stub(); - let value = {}; + const value = {}; documentList.ngOnInit(); documentList.contextActionHandler.next(value); expect(documentList.contextActionCallback).toHaveBeenCalledWith(value); @@ -650,8 +650,8 @@ describe('DocumentList', () => { }); it('should emit file preview event on single click', (done) => { - let file = new FileNode(); - let disposablePreview = documentList.preview.subscribe((e) => { + const file = new FileNode(); + const disposablePreview = documentList.preview.subscribe((e) => { expect(e.value).toBe(file); disposablePreview.unsubscribe(); done(); @@ -661,8 +661,8 @@ describe('DocumentList', () => { }); it('should emit file preview event on double click', (done) => { - let file = new FileNode(); - let disposablePreview = documentList.preview.subscribe((e) => { + const file = new FileNode(); + const disposablePreview = documentList.preview.subscribe((e) => { expect(e.value).toBe(file); disposablePreview.unsubscribe(); done(); @@ -672,7 +672,7 @@ describe('DocumentList', () => { }); it('should perform folder navigation on single click', () => { - let folder = new FolderNode(); + const folder = new FolderNode(); spyOn(documentList, 'navigateTo').and.stub(); documentList.navigationMode = DocumentListComponent.SINGLE_CLICK_NAVIGATION; @@ -681,7 +681,7 @@ describe('DocumentList', () => { }); it('should perform folder navigation on double click', () => { - let folder = new FolderNode(); + const folder = new FolderNode(); spyOn(documentList, 'navigateTo').and.stub(); documentList.navigationMode = DocumentListComponent.DOUBLE_CLICK_NAVIGATION; @@ -690,7 +690,7 @@ describe('DocumentList', () => { }); it('should not perform folder navigation on double click when single mode', () => { - let folder = new FolderNode(); + const folder = new FolderNode(); spyOn(documentList, 'navigateTo').and.stub(); documentList.navigationMode = DocumentListComponent.SINGLE_CLICK_NAVIGATION; @@ -700,7 +700,7 @@ describe('DocumentList', () => { }); it('should not perform folder navigation on double click when navigation off', () => { - let folder = new FolderNode(); + const folder = new FolderNode(); spyOn(documentList, 'navigateTo').and.stub(); documentList.navigate = false; @@ -711,8 +711,8 @@ describe('DocumentList', () => { }); it('should perform navigation for folder node only', () => { - let folder = new FolderNode(); - let file = new FileNode(); + const folder = new FolderNode(); + const file = new FileNode(); spyOn(documentList, 'loadFolder').and.stub(); @@ -722,7 +722,7 @@ describe('DocumentList', () => { }); it('should perform navigation through corret linked folder', () => { - let linkFolder = new FolderNode(); + const linkFolder = new FolderNode(); linkFolder.entry.id = 'link-folder'; linkFolder.entry.nodeType = 'app:folderlink'; linkFolder.entry.properties['cm:destination'] = 'normal-folder'; @@ -734,7 +734,7 @@ describe('DocumentList', () => { }); it('should require valid node for file preview', () => { - let file = new FileNode(); + const file = new FileNode(); file.entry = null; let called = false; @@ -750,7 +750,7 @@ describe('DocumentList', () => { }); it('should require valid node for folder navigation', () => { - let folder = new FolderNode(); + const folder = new FolderNode(); folder.entry = null; spyOn(documentList, 'navigateTo').and.stub(); @@ -781,18 +781,18 @@ describe('DocumentList', () => { it('should require node to resolve context menu actions', () => { expect(documentList.getContextActions(null)).toBeNull(); - let file = new FileNode(); + const file = new FileNode(); file.entry = null; expect(documentList.getContextActions(file)).toBeNull(); }); it('should fetch context menu actions for a file node', () => { - let actionModel: any = {}; + const actionModel: any = {}; spyOn(documentList, 'getNodeActions').and.returnValue([actionModel]); - let file = new FileNode(); - let actions = documentList.getContextActions(file); + const file = new FileNode(); + const actions = documentList.getContextActions(file); expect(documentList.getNodeActions).toHaveBeenCalledWith(file); expect(actions.length).toBe(1); @@ -802,11 +802,11 @@ describe('DocumentList', () => { }); it('should fetch context menu actions for a folder node', () => { - let actionModel: any = {}; + const actionModel: any = {}; spyOn(documentList, 'getNodeActions').and.returnValue([actionModel]); - let folder = new FolderNode(); - let actions = documentList.getContextActions(folder); + const folder = new FolderNode(); + const actions = documentList.getContextActions(folder); expect(documentList.getNodeActions).toHaveBeenCalledWith(folder); expect(actions.length).toBe(1); @@ -818,19 +818,19 @@ describe('DocumentList', () => { it('should fetch no context menu actions for unknown type', () => { spyOn(documentList, 'getNodeActions').and.stub(); - let node = new FileNode(); + const node = new FileNode(); node.entry.isFile = false; node.entry.isFolder = false; - let actions = documentList.getContextActions(node); + const actions = documentList.getContextActions(node); expect(actions).toBeNull(); }); it('should return null value when no content actions found', () => { spyOn(documentList, 'getNodeActions').and.returnValue([]); - let file = new FileNode(); - let actions = documentList.getContextActions(file); + const file = new FileNode(); + const actions = documentList.getContextActions(file); expect(actions).toBeNull(); expect(documentList.getNodeActions).toHaveBeenCalled(); @@ -872,7 +872,7 @@ describe('DocumentList', () => { it('should set row filter and reload contents if currentFolderId is set when setting rowFilter', () => { fixture.detectChanges(); - let filter = <RowFilter> {}; + const filter = <RowFilter> {}; documentList.currentFolderId = 'id'; spyOn(documentList.data, 'setFilter').and.callThrough(); spyOn(documentListService, 'getFolder').and.callThrough(); @@ -894,7 +894,7 @@ describe('DocumentList', () => { it('should set image resolver for underlying adapter', () => { fixture.detectChanges(); - let resolver = <ImageResolver> {}; + const resolver = <ImageResolver> {}; spyOn(documentList.data, 'setImageResolver').and.callThrough(); documentList.ngOnChanges({ imageResolver: new SimpleChange(null, resolver, true) }); @@ -903,7 +903,7 @@ describe('DocumentList', () => { }); it('should emit [nodeClick] event on row click', () => { - let node = new NodeMinimalEntry(); + const node = new NodeMinimalEntry(); spyOn(documentList, 'onNodeClick').and.callThrough(); documentList.onNodeClick(node); @@ -911,7 +911,7 @@ describe('DocumentList', () => { }); it('should emit node-click DOM event', (done) => { - let node = new NodeMinimalEntry(); + const node = new NodeMinimalEntry(); document.addEventListener('node-click', (customEvent: CustomEvent) => { done(); @@ -921,7 +921,7 @@ describe('DocumentList', () => { }); it('should emit [nodeDblClick] event on row double-click', () => { - let node = new NodeMinimalEntry(); + const node = new NodeMinimalEntry(); spyOn(documentList, 'onNodeDblClick').and.callThrough(); documentList.onNodeDblClick(node); @@ -929,7 +929,7 @@ describe('DocumentList', () => { }); it('should emit node-dblclick DOM event', (done) => { - let node = new NodeMinimalEntry(); + const node = new NodeMinimalEntry(); document.addEventListener('node-dblclick', (customEvent: CustomEvent) => { done(); @@ -952,7 +952,7 @@ describe('DocumentList', () => { const error = { message: '{ "error": { "statusCode": 501 } }' }; spyOn(documentListService, 'getFolder').and.returnValue(throwError(error)); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe(error); disposableError.unsubscribe(); done(); @@ -975,7 +975,7 @@ describe('DocumentList', () => { const error = { message: '{ "error": { "statusCode": 403 } }' }; spyOn(documentListService, 'getFolder').and.returnValue(throwError(error)); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe(error); expect(documentList.noPermission).toBe(true); disposableError.unsubscribe(); @@ -1020,7 +1020,7 @@ describe('DocumentList', () => { spyOn(documentListService, 'getFolder').and.returnValue(throwError(error)); documentList.loadFolder(); - let clickedFolderNode = new FolderNode('fake-folder-node'); + const clickedFolderNode = new FolderNode('fake-folder-node'); documentList.onNodeDblClick(clickedFolderNode); expect(documentList.noPermission).toBeTruthy(); @@ -1049,7 +1049,7 @@ describe('DocumentList', () => { it('should emit error when fetch trashcan fails', (done) => { spyOn(apiService.nodesApi, 'getDeletedNodes').and.returnValue(Promise.reject('error')); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe('error'); disposableError.unsubscribe(); done(); @@ -1070,7 +1070,7 @@ describe('DocumentList', () => { spyOn(apiService.getInstance().core.sharedlinksApi, 'findSharedLinks') .and.returnValue(Promise.reject('error')); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe('error'); disposableError.unsubscribe(); done(); @@ -1089,7 +1089,7 @@ describe('DocumentList', () => { it('should emit error when fetch sites fails', (done) => { spyGetSites.and.returnValue(Promise.reject('error')); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe('error'); disposableError.unsubscribe(); done(); @@ -1101,7 +1101,7 @@ describe('DocumentList', () => { it('should assure that sites have name property set', (done) => { fixture.detectChanges(); - let disposableReady = documentList.ready.subscribe((page) => { + const disposableReady = documentList.ready.subscribe((page) => { const entriesWithoutName = page.list.entries.filter((item) => !item.entry.name); expect(entriesWithoutName.length).toBe(0); disposableReady.unsubscribe(); @@ -1114,7 +1114,7 @@ describe('DocumentList', () => { it('should assure that sites have name property set correctly', (done) => { fixture.detectChanges(); - let disposableReady = documentList.ready.subscribe((page) => { + const disposableReady = documentList.ready.subscribe((page) => { const wrongName = page.list.entries.filter((item) => (item.entry.name !== item.entry.title)); expect(wrongName.length).toBe(0); disposableReady.unsubscribe(); @@ -1136,7 +1136,7 @@ describe('DocumentList', () => { spyOn(apiService.getInstance().core.peopleApi, 'listSiteMembershipsForPerson') .and.returnValue(Promise.reject('error')); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe('error'); disposableError.unsubscribe(); done(); @@ -1153,7 +1153,7 @@ describe('DocumentList', () => { documentList.loadFolderByNodeId('-mysites-'); expect(peopleApi.listSiteMembershipsForPerson).toHaveBeenCalled(); - let disposableReady = documentList.ready.subscribe((page) => { + const disposableReady = documentList.ready.subscribe((page) => { const entriesWithoutName = page.list.entries.filter((item) => !item.entry.name); expect(entriesWithoutName.length).toBe(0); disposableReady.unsubscribe(); @@ -1169,7 +1169,7 @@ describe('DocumentList', () => { documentList.loadFolderByNodeId('-mysites-'); expect(peopleApi.listSiteMembershipsForPerson).toHaveBeenCalled(); - let disposableReady = documentList.ready.subscribe((page) => { + const disposableReady = documentList.ready.subscribe((page) => { const wrongName = page.list.entries.filter((item) => (item.entry.name !== item.entry.title)); expect(wrongName.length).toBe(0); disposableReady.unsubscribe(); @@ -1188,7 +1188,7 @@ describe('DocumentList', () => { it('should emit error when fetch favorites fails', (done) => { spyFavorite.and.returnValue(Promise.reject('error')); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe('error'); disposableError.unsubscribe(); done(); @@ -1200,7 +1200,7 @@ describe('DocumentList', () => { it('should fetch recent', () => { const person = { entry: { id: 'person ' } }; - let getPersonSpy = spyOn(apiService.peopleApi, 'getPerson').and.returnValue(Promise.resolve(person)); + const getPersonSpy = spyOn(apiService.peopleApi, 'getPerson').and.returnValue(Promise.resolve(person)); documentList.loadFolderByNodeId('-recent-'); @@ -1210,7 +1210,7 @@ describe('DocumentList', () => { it('should emit error when fetch recent fails on getPerson call', (done) => { spyOn(apiService.peopleApi, 'getPerson').and.returnValue(Promise.reject('error')); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe('error'); disposableError.unsubscribe(); done(); @@ -1222,7 +1222,7 @@ describe('DocumentList', () => { it('should emit error when fetch recent fails on search call', (done) => { spyOn(customResourcesService, 'loadFolderByNodeId').and.returnValue(throwError('error')); - let disposableError = documentList.error.subscribe((val) => { + const disposableError = documentList.error.subscribe((val) => { expect(val).toBe('error'); disposableError.unsubscribe(); done(); @@ -1297,7 +1297,7 @@ describe('DocumentList', () => { }); it('should reset the pagination when enter in a new folder', () => { - let folder = new FolderNode(); + const folder = new FolderNode(); documentList.navigationMode = DocumentListComponent.SINGLE_CLICK_NAVIGATION; documentList.updatePagination({ maxItems: 10, diff --git a/lib/content-services/document-list/components/document-list.component.ts b/lib/content-services/document-list/components/document-list.component.ts index 41dd8ee3d3..35f23419e6 100644 --- a/lib/content-services/document-list/components/document-list.component.ts +++ b/lib/content-services/document-list/components/document-list.component.ts @@ -334,7 +334,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte getContextActions(node: NodeEntry) { if (node && node.entry) { - let actions = this.getNodeActions(node); + const actions = this.getNodeActions(node); if (actions && actions.length > 0) { return actions.map((currentAction: ContentActionModel) => { return { @@ -419,7 +419,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte this.data.setColumns(schema); } - let columns = this.data.getColumns(); + const columns = this.data.getColumns(); if (!columns || columns.length === 0) { this.setupDefaultColumns(this._currentFolderId); } @@ -445,7 +445,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte if (this.data) { if (changes.node && changes.node.currentValue) { - let merge = this._pagination ? this._pagination.merge : false; + const merge = this._pagination ? this._pagination.merge : false; this.data.loadPage(changes.node.currentValue, merge); this.onDataReady(changes.node.currentValue); @@ -492,7 +492,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte return actions; } - let actionsByTarget = this.actions + const actionsByTarget = this.actions .filter((entry) => { const isVisible = (typeof entry.visible === 'function') ? entry.visible(node) @@ -653,7 +653,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte } getSourceNodeWithPath(nodeId: string): Observable<NodeEntry> { - let getSourceObservable = this.documentListService.getFolderNode(nodeId, this.includeFields); + const getSourceObservable = this.documentListService.getFolderNode(nodeId, this.includeFields); getSourceObservable.subscribe((nodeEntry: NodeEntry) => { this.folderNode = nodeEntry.entry; @@ -784,8 +784,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte onShowRowContextMenu(event: DataCellEvent) { if (this.contextMenuActions) { - let args = event.value; - let node = (<ShareDataRow> args.row).node; + const args = event.value; + const node = (<ShareDataRow> args.row).node; if (node) { args.actions = this.getContextActions(node) || []; } @@ -794,8 +794,8 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte onShowRowActionsMenu(event: DataCellEvent) { if (this.contentActions) { - let args = event.value; - let node = (<ShareDataRow> args.row).node; + const args = event.value; + const node = (<ShareDataRow> args.row).node; if (node) { args.actions = this.getNodeActions(node) || []; } @@ -804,9 +804,9 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte onExecuteRowAction(event: DataRowActionEvent) { if (this.contentActions) { - let args = event.value; - let node = (<ShareDataRow> args.row).node; - let action = (<ContentActionModel> args.action); + const args = event.value; + const node = (<ShareDataRow> args.row).node; + const action = (<ContentActionModel> args.action); this.executeContentAction(node, action); } } diff --git a/lib/content-services/document-list/data/share-datatable-adapter.spec.ts b/lib/content-services/document-list/data/share-datatable-adapter.spec.ts index 125b8c0fef..40cf06bfd2 100644 --- a/lib/content-services/document-list/data/share-datatable-adapter.spec.ts +++ b/lib/content-services/document-list/data/share-datatable-adapter.spec.ts @@ -27,7 +27,7 @@ describe('ShareDataTableAdapter', () => { let contentService: ContentService; beforeEach(() => { - let imageUrl: string = 'http://<addresss>'; + const imageUrl: string = 'http://<addresss>'; contentService = new ContentService(null, null, null, null); documentListService = new DocumentListService(null, contentService, null, null, null); spyOn(documentListService, 'getDocumentThumbnailUrl').and.returnValue(imageUrl); @@ -59,8 +59,8 @@ describe('ShareDataTableAdapter', () => { }); it('should setup rows and columns with constructor', () => { - let schema = [<DataColumn> {}]; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, schema); + const schema = [<DataColumn> {}]; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, schema); expect(adapter.getRows()).toEqual([]); expect(adapter.getColumns()).toEqual(schema); @@ -72,15 +72,15 @@ describe('ShareDataTableAdapter', () => { }); it('should set new columns', () => { - let columns = [<DataColumn> {}, <DataColumn> {}]; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const columns = [<DataColumn> {}, <DataColumn> {}]; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); adapter.setColumns(columns); expect(adapter.getColumns()).toEqual(columns); }); it('should reset columns', () => { - let columns = [<DataColumn> {}, <DataColumn> {}]; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, columns); + const columns = [<DataColumn> {}, <DataColumn> {}]; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, columns); expect(adapter.getColumns()).toEqual(columns); adapter.setColumns(null); @@ -88,8 +88,8 @@ describe('ShareDataTableAdapter', () => { }); it('should set new rows', () => { - let rows = [<DataRow> {}, <DataRow> {}]; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const rows = [<DataRow> {}, <DataRow> {}]; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); expect(adapter.getRows()).toEqual([]); adapter.setRows(rows); @@ -97,8 +97,8 @@ describe('ShareDataTableAdapter', () => { }); it('should reset rows', () => { - let rows = [<DataRow> {}, <DataRow> {}]; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const rows = [<DataRow> {}, <DataRow> {}]; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); adapter.setRows(rows); expect(adapter.getRows()).toEqual(rows); @@ -108,61 +108,61 @@ describe('ShareDataTableAdapter', () => { }); it('should sort new rows', () => { - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); spyOn(adapter, 'sort').and.callThrough(); - let rows = [<DataRow> {}]; + const rows = [<DataRow> {}]; adapter.setRows(rows); expect(adapter.sort).toHaveBeenCalled(); }); it('should fail when getting value for missing row', () => { - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let check = () => { + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const check = () => { return adapter.getValue(null, <DataColumn> {}); }; expect(check).toThrowError(adapter.ERR_ROW_NOT_FOUND); }); it('should fail when getting value for missing column', () => { - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let check = () => { + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const check = () => { return adapter.getValue(<DataRow> {}, null); }; expect(check).toThrowError(adapter.ERR_COL_NOT_FOUND); }); it('should return date value as string', () => { - let rawValue = new Date(2015, 6, 15, 21, 43, 11); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST); + const rawValue = new Date(2015, 6, 15, 21, 43, 11); // Wed Jul 15 2015 21:43:11 GMT+0100 (BST); - let file = new FileNode(); + const file = new FileNode(); file.entry.createdAt = rawValue; - let col = <DataColumn> { + const col = <DataColumn> { key: 'createdAt', type: 'string' }; - let row = new ShareDataRow(file, contentService, null); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const row = new ShareDataRow(file, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toBe(rawValue); }); it('should generate fallback icon for a file thumbnail with missing mime type', () => { spyOn(documentListService, 'getDefaultMimeTypeIcon').and.returnValue(`assets/images/ft_ic_miscellaneous.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let file = new FileNode(); + const file = new FileNode(); file.entry.content.mimeType = null; - let row = new ShareDataRow(file, contentService, null); - let col = <DataColumn> { type: 'image', key: '$thumbnail' }; + const row = new ShareDataRow(file, contentService, null); + const col = <DataColumn> { type: 'image', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_miscellaneous`); expect(value).toContain(`svg`); }); @@ -170,42 +170,42 @@ describe('ShareDataTableAdapter', () => { it('should generate fallback icon for a file with no content entry', () => { spyOn(documentListService, 'getDefaultMimeTypeIcon').and.returnValue(`assets/images/ft_ic_miscellaneous.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let file = new FileNode(); + const file = new FileNode(); file.entry.content = null; - let row = new ShareDataRow(file, contentService, null); - let col = <DataColumn> { type: 'image', key: '$thumbnail' }; + const row = new ShareDataRow(file, contentService, null); + const col = <DataColumn> { type: 'image', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_miscellaneous`); expect(value).toContain(`svg`); }); it('should return image value unmodified', () => { - let imageUrl = 'http://<address>'; + const imageUrl = 'http://<address>'; - let file = new FileNode(); + const file = new FileNode(); file.entry['icon'] = imageUrl; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let row = new ShareDataRow(file, contentService, null); - let col = <DataColumn> { type: 'image', key: 'icon' }; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const row = new ShareDataRow(file, contentService, null); + const col = <DataColumn> { type: 'image', key: 'icon' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toBe(imageUrl); }); it('should resolve folder icon', () => { spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_folder.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let row = new ShareDataRow(new FolderNode(), contentService, null); - let col = <DataColumn> { type: 'image', key: '$thumbnail' }; + const row = new ShareDataRow(new FolderNode(), contentService, null); + const col = <DataColumn> { type: 'image', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_folder`); expect(value).toContain(`svg`); }); @@ -213,12 +213,12 @@ describe('ShareDataTableAdapter', () => { it('should resolve smart folder icon', () => { spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_smart_folder.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let row = new ShareDataRow(new SmartFolderNode(), contentService, null); - let col = <DataColumn> { type: 'folder', key: '$thumbnail' }; + const row = new ShareDataRow(new SmartFolderNode(), contentService, null); + const col = <DataColumn> { type: 'folder', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_smart_folder`); expect(value).toContain(`svg`); }); @@ -226,12 +226,12 @@ describe('ShareDataTableAdapter', () => { it('should resolve link folder icon', () => { spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_folder_shortcut_link.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let row = new ShareDataRow(new LinkFolderNode(), contentService, null); - let col = <DataColumn> { type: 'folder', key: '$thumbnail' }; + const row = new ShareDataRow(new LinkFolderNode(), contentService, null); + const col = <DataColumn> { type: 'folder', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_folder_shortcut_link`); expect(value).toContain(`svg`); }); @@ -239,26 +239,26 @@ describe('ShareDataTableAdapter', () => { it('should resolve rule folder icon', () => { spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_folder_rule.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let row = new ShareDataRow(new RuleFolderNode(), contentService, null); - let col = <DataColumn> { type: 'folder', key: '$thumbnail' }; + const row = new ShareDataRow(new RuleFolderNode(), contentService, null); + const col = <DataColumn> { type: 'folder', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_folder_rule`); expect(value).toContain(`svg`); }); it('should resolve file thumbnail', () => { - let imageUrl = 'http://<addresss>'; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const imageUrl = 'http://<addresss>'; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); adapter.thumbnails = true; - let file = new FileNode(); - let row = new ShareDataRow(file, contentService, null); - let col = <DataColumn> { type: 'image', key: '$thumbnail' }; + const file = new FileNode(); + const row = new ShareDataRow(file, contentService, null); + const col = <DataColumn> { type: 'image', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toBe(imageUrl); expect(documentListService.getDocumentThumbnailUrl).toHaveBeenCalledWith(file); }); @@ -266,45 +266,45 @@ describe('ShareDataTableAdapter', () => { it('should resolve fallback file icon for unknown node', () => { spyOn(documentListService, 'getDefaultMimeTypeIcon').and.returnValue(`assets/images/ft_ic_miscellaneous.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let file = new FileNode(); + const file = new FileNode(); file.entry.isFile = false; file.entry.isFolder = false; file.entry.content = null; - let row = new ShareDataRow(file, contentService, null); - let col = <DataColumn> { type: 'image', key: '$thumbnail' }; + const row = new ShareDataRow(file, contentService, null); + const col = <DataColumn> { type: 'image', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_miscellaneous`); expect(value).toContain(`svg`); }); it('should resolve file icon for content type', () => { spyOn(documentListService, 'getMimeTypeIcon').and.returnValue(`assets/images/ft_ic_raster_image.svg`); - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, null); - let file = new FileNode(); + const file = new FileNode(); file.entry.isFile = false; file.entry.isFolder = false; file.entry.content.mimeType = 'image/png'; - let row = new ShareDataRow(file, contentService, null); - let col = <DataColumn> { type: 'image', key: '$thumbnail' }; + const row = new ShareDataRow(file, contentService, null); + const col = <DataColumn> { type: 'image', key: '$thumbnail' }; - let value = adapter.getValue(row, col); + const value = adapter.getValue(row, col); expect(value).toContain(`assets/images/ft_ic_raster_image`); expect(value).toContain(`svg`); }); it('should put folders on top upon sort', () => { - let file1 = new FileNode('file1'); - let file2 = new FileNode('file2'); - let folder = new FolderNode(); + const file1 = new FileNode('file1'); + const file2 = new FileNode('file2'); + const folder = new FolderNode(); - let col = <DataColumn> { key: 'name' }; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); + const col = <DataColumn> { key: 'name' }; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); adapter.setSorting(new DataSorting('name', 'asc')); adapter.setRows([ @@ -313,21 +313,21 @@ describe('ShareDataTableAdapter', () => { new ShareDataRow(folder, contentService, null) ]); - let sorted = adapter.getRows(); + const sorted = adapter.getRows(); expect((<ShareDataRow> sorted[0]).node).toBe(folder); expect((<ShareDataRow> sorted[1]).node).toBe(file1); expect((<ShareDataRow> sorted[2]).node).toBe(file2); }); it('should sort by dates up to ms', () => { - let file1 = new FileNode('file1'); + const file1 = new FileNode('file1'); file1.entry['dateProp'] = new Date(2016, 6, 30, 13, 14, 1); - let file2 = new FileNode('file2'); + const file2 = new FileNode('file2'); file2.entry['dateProp'] = new Date(2016, 6, 30, 13, 14, 2); - let col = <DataColumn> { key: 'dateProp' }; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); + const col = <DataColumn> { key: 'dateProp' }; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); adapter.setRows([ new ShareDataRow(file2, contentService, null), @@ -336,7 +336,7 @@ describe('ShareDataTableAdapter', () => { adapter.sort('dateProp', 'asc'); - let rows = adapter.getRows(); + const rows = adapter.getRows(); expect((<ShareDataRow> rows[0]).node).toBe(file1); expect((<ShareDataRow> rows[1]).node).toBe(file2); @@ -346,18 +346,18 @@ describe('ShareDataTableAdapter', () => { }); it('should sort by file size', () => { - let file1 = new FileNode('file1'); - let file2 = new FileNode('file2'); - let file3 = new FileNode('file3'); - let file4 = new FileNode('file4'); + const file1 = new FileNode('file1'); + const file2 = new FileNode('file2'); + const file3 = new FileNode('file3'); + const file4 = new FileNode('file4'); file1.entry.content.sizeInBytes = 146; // 146 bytes file2.entry.content.sizeInBytes = 10075; // 9.84 KB file3.entry.content.sizeInBytes = 4224120; // 4.03 MB file4.entry.content.sizeInBytes = 2852791665; // 2.66 GB - let col = <DataColumn> { key: 'content.sizeInBytes' }; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); + const col = <DataColumn> { key: 'content.sizeInBytes' }; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); adapter.setRows([ new ShareDataRow(file3, contentService, null), @@ -367,7 +367,7 @@ describe('ShareDataTableAdapter', () => { ]); adapter.sort('content.sizeInBytes', 'asc'); - let rows = adapter.getRows(); + const rows = adapter.getRows(); expect((<ShareDataRow> rows[0]).node).toBe(file1); expect((<ShareDataRow> rows[1]).node).toBe(file2); @@ -382,15 +382,15 @@ describe('ShareDataTableAdapter', () => { }); it('should sort by name', () => { - let file1 = new FileNode('file1'); - let file2 = new FileNode('file11'); - let file3 = new FileNode('file20'); - let file4 = new FileNode('file11-1'); // auto rename - let file5 = new FileNode('a'); - let file6 = new FileNode('b'); + const file1 = new FileNode('file1'); + const file2 = new FileNode('file11'); + const file3 = new FileNode('file20'); + const file4 = new FileNode('file11-1'); // auto rename + const file5 = new FileNode('a'); + const file6 = new FileNode('b'); - let col = <DataColumn> { key: 'name' }; - let adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); + const col = <DataColumn> { key: 'name' }; + const adapter = new ShareDataTableAdapter(documentListService, null, contentService, [col]); adapter.setRows([ new ShareDataRow(file4, contentService, null), @@ -402,7 +402,7 @@ describe('ShareDataTableAdapter', () => { ]); adapter.sort('name', 'asc'); - let rows = adapter.getRows(); + const rows = adapter.getRows(); expect((<ShareDataRow> rows[0]).node).toBe(file5); expect((<ShareDataRow> rows[1]).node).toBe(file6); @@ -423,8 +423,8 @@ describe('ShareDataTableAdapter', () => { describe('ShareDataRow', () => { it('should wrap node', () => { - let file = new FileNode(); - let row = new ShareDataRow(file, contentService, null); + const file = new FileNode(); + const row = new ShareDataRow(file, contentService, null); expect(row.node).toBe(file); }); @@ -435,37 +435,37 @@ describe('ShareDataTableAdapter', () => { }); it('should resolve value from node entry', () => { - let file = new FileNode('test'); - let row = new ShareDataRow(file, contentService, null); + const file = new FileNode('test'); + const row = new ShareDataRow(file, contentService, null); expect(row.getValue('name')).toBe('test'); }); it('should check value', () => { - let file = new FileNode('test'); - let row = new ShareDataRow(file, contentService, null); + const file = new FileNode('test'); + const row = new ShareDataRow(file, contentService, null); expect(row.hasValue('name')).toBeTruthy(); expect(row.hasValue('missing')).toBeFalsy(); }); it('should be set as drop target when user has permission for that node', () => { - let file = new FolderNode('test'); + const file = new FolderNode('test'); file.entry['allowableOperations'] = ['create']; - let row = new ShareDataRow(file, contentService, null); + const row = new ShareDataRow(file, contentService, null); expect(row.isDropTarget).toBeTruthy(); }); it('should not be set as drop target when user has permission for that node', () => { - let file = new FolderNode('test'); - let row = new ShareDataRow(file, contentService, null); + const file = new FolderNode('test'); + const row = new ShareDataRow(file, contentService, null); expect(row.isDropTarget).toBeFalsy(); }); it('should not be set as drop target when element is not a Folder', () => { - let file = new FileNode('test'); - let row = new ShareDataRow(file, contentService, null); + const file = new FileNode('test'); + const row = new ShareDataRow(file, contentService, null); expect(row.isDropTarget).toBeFalsy(); }); diff --git a/lib/content-services/document-list/data/share-datatable-adapter.ts b/lib/content-services/document-list/data/share-datatable-adapter.ts index d76db1ea58..4e2b2eeb13 100644 --- a/lib/content-services/document-list/data/share-datatable-adapter.ts +++ b/lib/content-services/document-list/data/share-datatable-adapter.ts @@ -96,8 +96,8 @@ export class ShareDataTableAdapter implements DataTableAdapter { if (!col) { throw new Error(this.ERR_COL_NOT_FOUND); } - let dataRow: ShareDataRow = <ShareDataRow> row; - let value: any = row.getValue(col.key); + const dataRow: ShareDataRow = <ShareDataRow> row; + const value: any = row.getValue(col.key); if (dataRow.cache[col.key] !== undefined) { return dataRow.cache[col.key]; } @@ -105,7 +105,7 @@ export class ShareDataTableAdapter implements DataTableAdapter { if (col.key === '$thumbnail') { if (this.imageResolver) { - let resolved = this.imageResolver(row, col); + const resolved = this.imageResolver(row, col); if (resolved) { return resolved; } @@ -136,7 +136,7 @@ export class ShareDataTableAdapter implements DataTableAdapter { if (col.type === 'image') { if (this.imageResolver) { - let resolved = this.imageResolver(row, col); + const resolved = this.imageResolver(row, col); if (resolved) { return resolved; } @@ -157,7 +157,7 @@ export class ShareDataTableAdapter implements DataTableAdapter { } sort(key?: string, direction?: string): void { - let sorting = this.sorting || new DataSorting(); + const sorting = this.sorting || new DataSorting(); if (key) { sorting.key = key; sorting.direction = direction || 'asc'; @@ -186,13 +186,13 @@ export class ShareDataTableAdapter implements DataTableAdapter { } isSmartFolder(node: any) { - let nodeAspects = this.getNodeAspectNames(node); + const nodeAspects = this.getNodeAspectNames(node); return nodeAspects.indexOf('smf:customConfigSmartFolder') > -1 || (nodeAspects.indexOf('smf:systemConfigSmartFolder') > -1); } isRuleFolder(node: any) { - let nodeAspects = this.getNodeAspectNames(node); + const nodeAspects = this.getNodeAspectNames(node); return nodeAspects.indexOf('rule:rules') > -1 || (nodeAspects.indexOf('rule:rules') > -1); } @@ -249,7 +249,7 @@ export class ShareDataTableAdapter implements DataTableAdapter { let shareDataRows: ShareDataRow[] = []; if (nodePaging && nodePaging.list) { - let nodeEntries: NodeEntry[] = nodePaging.list.entries; + const nodeEntries: NodeEntry[] = nodePaging.list.entries; if (nodeEntries && nodeEntries.length > 0) { shareDataRows = nodeEntries.map((item) => new ShareDataRow(item, this.contentService, this.permissionsStyle, this.thumbnailService)); @@ -260,11 +260,11 @@ export class ShareDataTableAdapter implements DataTableAdapter { if (this.sortingMode !== 'server') { // Sort by first sortable or just first column if (this.columns && this.columns.length > 0) { - let sorting = this.getSorting(); + const sorting = this.getSorting(); if (sorting) { this.sortRows(shareDataRows, sorting); } else { - let sortable = this.columns.filter((c) => c.sortable); + const sortable = this.columns.filter((c) => c.sortable); if (sortable.length > 0) { this.sort(sortable[0].key, 'asc'); } else { @@ -277,8 +277,8 @@ export class ShareDataTableAdapter implements DataTableAdapter { } if (merge) { - let listPrunedDuplicate = shareDataRows.filter((elementToFilter: any) => { - let isPresent = this.rows.find((currentRow: any) => { + const listPrunedDuplicate = shareDataRows.filter((elementToFilter: any) => { + const isPresent = this.rows.find((currentRow: any) => { return currentRow.obj.entry.id === elementToFilter.obj.entry.id; }); diff --git a/lib/content-services/document-list/services/custom-resources.service.ts b/lib/content-services/document-list/services/custom-resources.service.ts index a983f117ef..237ae11936 100644 --- a/lib/content-services/document-list/services/custom-resources.service.ts +++ b/lib/content-services/document-list/services/custom-resources.service.ts @@ -103,7 +103,7 @@ export class CustomResourcesService { * @returns List of favorite files */ loadFavorites(pagination: PaginationModel, includeFields: string[] = []): Observable<NodePaging> { - let includeFieldsRequest = this.getIncludesFields(includeFields); + const includeFieldsRequest = this.getIncludesFields(includeFields); const options = { maxItems: pagination.maxItems, @@ -115,7 +115,7 @@ export class CustomResourcesService { return new Observable((observer) => { this.apiService.favoritesApi.getFavorites('-me-', options) .then((result: FavoritePaging) => { - let page: FavoritePaging = { + const page: FavoritePaging = { list: { entries: result.list.entries .map(({ entry: { target } }: any) => ({ @@ -157,7 +157,7 @@ export class CustomResourcesService { return new Observable((observer) => { this.apiService.peopleApi.listSiteMembershipsForPerson('-me-', options) .then((result: SiteRolePaging) => { - let page: SiteMemberPaging = new SiteMemberPaging( { + const page: SiteMemberPaging = new SiteMemberPaging( { list: { entries: result.list.entries .map(({ entry: { site } }: any) => { @@ -219,7 +219,7 @@ export class CustomResourcesService { * @returns List of deleted items */ loadTrashcan(pagination: PaginationModel, includeFields: string[] = []): Observable<DeletedNodesPaging> { - let includeFieldsRequest = this.getIncludesFields(includeFields); + const includeFieldsRequest = this.getIncludesFields(includeFields); const options = { include: includeFieldsRequest, @@ -239,7 +239,7 @@ export class CustomResourcesService { * @returns List of shared links */ loadSharedLinks(pagination: PaginationModel, includeFields: string[] = []): Observable<SharedLinkPaging> { - let includeFieldsRequest = this.getIncludesFields(includeFields); + const includeFieldsRequest = this.getIncludesFields(includeFields); const options = { include: includeFieldsRequest, diff --git a/lib/content-services/document-list/services/document-actions.service.spec.ts b/lib/content-services/document-list/services/document-actions.service.spec.ts index 080b4d3e10..e28a6562c6 100644 --- a/lib/content-services/document-list/services/document-actions.service.spec.ts +++ b/lib/content-services/document-list/services/document-actions.service.spec.ts @@ -22,14 +22,12 @@ import { FileNode, FolderNode } from '../../mock'; import { ContentActionHandler } from '../models/content-action.model'; import { DocumentActionsService } from './document-actions.service'; import { DocumentListService } from './document-list.service'; -import { NodeActionsService } from './node-actions.service'; import { of } from 'rxjs'; describe('DocumentActionsService', () => { let service: DocumentActionsService; let documentListService: DocumentListService; - let nodeActionsService: NodeActionsService; setupTestBed({ imports: [ @@ -38,8 +36,8 @@ describe('DocumentActionsService', () => { }); beforeEach(() => { - let contentService = new ContentService(null, null, null, null); - let alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService()); + const contentService = new ContentService(null, null, null, null); + const alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService()); documentListService = new DocumentListService(null, contentService, alfrescoApiService, null, null); service = new DocumentActionsService(null, null, new TranslationMock(), documentListService, contentService); @@ -54,7 +52,7 @@ describe('DocumentActionsService', () => { }); it('should register custom action handler', () => { - let handler: ContentActionHandler = function (obj: any) { + const handler: ContentActionHandler = function (obj: any) { }; service.setHandler('<key>', handler); expect(service.getHandler('<key>')).toBe(handler); @@ -65,7 +63,7 @@ describe('DocumentActionsService', () => { }); it('should be case insensitive for keys', () => { - let handler: ContentActionHandler = function (obj: any) { + const handler: ContentActionHandler = function (obj: any) { }; service.setHandler('<key>', handler); expect(service.getHandler('<KEY>')).toBe(handler); @@ -77,10 +75,10 @@ describe('DocumentActionsService', () => { }); it('should allow action execution only when service available', () => { - let file = new FileNode(); + const file = new FileNode(); expect(service.canExecuteAction(file)).toBeTruthy(); - service = new DocumentActionsService(nodeActionsService, null, null); + service = new DocumentActionsService(null, null, null); expect(service.canExecuteAction(file)).toBeFalsy(); }); @@ -91,7 +89,7 @@ describe('DocumentActionsService', () => { }); it('should set new handler only by key', () => { - let handler: ContentActionHandler = function (obj: any) { + const handler: ContentActionHandler = function (obj: any) { }; expect(service.setHandler(null, handler)).toBeFalsy(); expect(service.setHandler('', handler)).toBeFalsy(); @@ -112,7 +110,7 @@ describe('DocumentActionsService', () => { done(); }); - let file = new FileNode(); + const file = new FileNode(); service.getHandler('delete')(file); }); @@ -120,7 +118,7 @@ describe('DocumentActionsService', () => { it('should call the error on the returned Observable if there are no permissions', (done) => { spyOn(documentListService, 'deleteNode').and.returnValue(of(true)); - let file = new FileNode(); + const file = new FileNode(); const deleteObservable = service.getHandler('delete')(file); deleteObservable.subscribe({ @@ -134,9 +132,9 @@ describe('DocumentActionsService', () => { it('should delete the file node if there is the delete permission', () => { spyOn(documentListService, 'deleteNode').and.returnValue(of(true)); - let permission = 'delete'; - let file = new FileNode(); - let fileWithPermission: any = file; + const permission = 'delete'; + const file = new FileNode(); + const fileWithPermission: any = file; fileWithPermission.entry.allowableOperations = [permission]; service.getHandler('delete')(fileWithPermission, null, permission); @@ -153,9 +151,9 @@ describe('DocumentActionsService', () => { done(); }); - let permission = 'delete'; - let file = new FileNode(); - let fileWithPermission: any = file; + const permission = 'delete'; + const file = new FileNode(); + const fileWithPermission: any = file; fileWithPermission.entry.allowableOperations = ['create', 'update']; service.getHandler('delete')(fileWithPermission, null, permission); }); @@ -163,9 +161,9 @@ describe('DocumentActionsService', () => { it('should delete the file node if there is the delete and others permission ', () => { spyOn(documentListService, 'deleteNode').and.returnValue(of(true)); - let permission = 'delete'; - let file = new FileNode(); - let fileWithPermission: any = file; + const permission = 'delete'; + const file = new FileNode(); + const fileWithPermission: any = file; fileWithPermission.entry.allowableOperations = ['create', 'update', permission]; service.getHandler('delete')(fileWithPermission, null, permission); @@ -179,9 +177,9 @@ describe('DocumentActionsService', () => { it('should delete file node', () => { spyOn(documentListService, 'deleteNode').and.returnValue(of(true)); - let permission = 'delete'; - let file = new FileNode(); - let fileWithPermission: any = file; + const permission = 'delete'; + const file = new FileNode(); + const fileWithPermission: any = file; fileWithPermission.entry.allowableOperations = [permission]; const deleteObservable = service.getHandler('delete')(fileWithPermission, null, permission); @@ -192,13 +190,13 @@ describe('DocumentActionsService', () => { it('should support deletion only file node', () => { spyOn(documentListService, 'deleteNode').and.returnValue(of(true)); - let folder = new FolderNode(); + const folder = new FolderNode(); service.getHandler('delete')(folder); expect(documentListService.deleteNode).not.toHaveBeenCalled(); - let permission = 'delete'; - let file = new FileNode(); - let fileWithPermission: any = file; + const permission = 'delete'; + const file = new FileNode(); + const fileWithPermission: any = file; fileWithPermission.entry.allowableOperations = [permission]; service.getHandler('delete')(fileWithPermission, null, permission); expect(documentListService.deleteNode).toHaveBeenCalled(); @@ -207,7 +205,7 @@ describe('DocumentActionsService', () => { it('should require node id to delete', () => { spyOn(documentListService, 'deleteNode').and.returnValue(of(true)); - let file = new FileNode(); + const file = new FileNode(); file.entry.id = null; service.getHandler('delete')(file); @@ -221,10 +219,10 @@ describe('DocumentActionsService', () => { }); spyOn(documentListService, 'deleteNode').and.returnValue(of(true)); - let target = jasmine.createSpyObj('obj', ['reload']); - let permission = 'delete'; - let file = new FileNode(); - let fileWithPermission: any = file; + const target = jasmine.createSpyObj('obj', ['reload']); + const permission = 'delete'; + const file = new FileNode(); + const fileWithPermission: any = file; fileWithPermission.entry.allowableOperations = [permission]; service.getHandler('delete')(fileWithPermission, target, permission); diff --git a/lib/content-services/document-list/services/document-actions.service.ts b/lib/content-services/document-list/services/document-actions.service.ts index 11c971e338..b3c0ea72f4 100644 --- a/lib/content-services/document-list/services/document-actions.service.ts +++ b/lib/content-services/document-list/services/document-actions.service.ts @@ -51,7 +51,7 @@ export class DocumentActionsService { */ getHandler(key: string): ContentActionHandler { if (key) { - let lKey = key.toLowerCase(); + const lKey = key.toLowerCase(); return this.handlers[lKey] || null; } return null; @@ -65,7 +65,7 @@ export class DocumentActionsService { */ setHandler(key: string, handler: ContentActionHandler): boolean { if (key) { - let lKey = key.toLowerCase(); + const lKey = key.toLowerCase(); this.handlers[lKey] = handler; return true; } @@ -125,10 +125,10 @@ export class DocumentActionsService { if (this.contentService.hasAllowableOperations(node.entry, permission)) { handlerObservable = this.documentListService.deleteNode(node.entry.id); handlerObservable.subscribe(() => { - let message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name }); + const message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name }); this.success.next(message); }, () => { - let message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name }); + const message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name }); this.error.next(message); }); return handlerObservable; diff --git a/lib/content-services/document-list/services/document-list.service.spec.ts b/lib/content-services/document-list/services/document-list.service.spec.ts index 615a05f51b..b97d7dfc3d 100644 --- a/lib/content-services/document-list/services/document-list.service.spec.ts +++ b/lib/content-services/document-list/services/document-list.service.spec.ts @@ -26,7 +26,7 @@ describe('DocumentListService', () => { let service: DocumentListService; let alfrescoApiService: AlfrescoApiService; - let fakeFolder = { + const fakeFolder = { 'list': { 'pagination': { 'count': 1, 'hasMoreItems': false, 'totalItems': 1, 'skipCount': 0, 'maxItems': 20 }, 'entries': [{ @@ -67,8 +67,8 @@ describe('DocumentListService', () => { }); beforeEach(() => { - let logService = new LogService(new AppConfigServiceMock(null)); - let contentService = new ContentService(null, null, null, null); + const logService = new LogService(new AppConfigServiceMock(null)); + const contentService = new ContentService(null, null, null, null); alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService()); service = new DocumentListService(null, contentService, alfrescoApiService, logService, null); jasmine.Ajax.install(); @@ -98,7 +98,7 @@ describe('DocumentListService', () => { }); it('should add the includeTypes in the request Node Children if required', () => { - let spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNodeChildren').and.callThrough(); + const spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNodeChildren').and.callThrough(); service.getFolder('/fake-root/fake-name', {}, ['isLocked']); @@ -110,7 +110,7 @@ describe('DocumentListService', () => { }); it('should not add the includeTypes in the request Node Children if is duplicated', () => { - let spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNodeChildren').and.callThrough(); + const spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNodeChildren').and.callThrough(); service.getFolder('/fake-root/fake-name', {}, ['allowableOperations']); @@ -122,7 +122,7 @@ describe('DocumentListService', () => { }); it('should add the includeTypes in the request getFolderNode if required', () => { - let spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNode').and.callThrough(); + const spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNode').and.callThrough(); service.getFolderNode('test-id', ['isLocked']); @@ -133,7 +133,7 @@ describe('DocumentListService', () => { }); it('should not add the includeTypes in the request getFolderNode if is duplicated', () => { - let spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNode').and.callThrough(); + const spyGetNodeInfo = spyOn(alfrescoApiService.getInstance().nodes, 'getNode').and.callThrough(); service.getFolderNode('test-id', ['allowableOperations']); diff --git a/lib/content-services/document-list/services/document-list.service.ts b/lib/content-services/document-list/services/document-list.service.ts index 578341a66c..7507d49fbe 100644 --- a/lib/content-services/document-list/services/document-list.service.ts +++ b/lib/content-services/document-list/services/document-list.service.ts @@ -86,10 +86,10 @@ export class DocumentListService { rootNodeId = opts.rootFolderId; } - let includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', 'aspectNames', ...includeFields] + const includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', 'aspectNames', ...includeFields] .filter((element, index, array) => index === array.indexOf(element)); - let params: any = { + const params: any = { includeSource: true, include: includeFieldsRequest }; @@ -123,10 +123,10 @@ export class DocumentListService { */ getNode(nodeId: string, includeFields: string[] = []): Observable<NodeEntry> { - let includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', ...includeFields] + const includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', ...includeFields] .filter((element, index, array) => index === array.indexOf(element)); - let opts: any = { + const opts: any = { includeSource: true, include: includeFieldsRequest }; @@ -142,10 +142,10 @@ export class DocumentListService { */ getFolderNode(nodeId: string, includeFields: string[] = []): Observable<NodeEntry> { - let includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', 'aspectNames', ...includeFields] + const includeFieldsRequest = ['path', 'properties', 'allowableOperations', 'permissions', 'aspectNames', ...includeFields] .filter((element, index, array) => index === array.indexOf(element)); - let opts: any = { + const opts: any = { includeSource: true, include: includeFieldsRequest }; diff --git a/lib/content-services/document-list/services/folder-actions.service.spec.ts b/lib/content-services/document-list/services/folder-actions.service.spec.ts index d249b66a3c..b73253c080 100644 --- a/lib/content-services/document-list/services/folder-actions.service.spec.ts +++ b/lib/content-services/document-list/services/folder-actions.service.spec.ts @@ -35,17 +35,17 @@ describe('FolderActionsService', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; - let contentService = new ContentService(null, null, null, null); - let alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService()); + const contentService = new ContentService(null, null, null, null); + const alfrescoApiService = new AlfrescoApiServiceMock(new AppConfigService(null), new StorageService()); documentListService = new DocumentListService(null, contentService, alfrescoApiService, null, null); service = new FolderActionsService(null, documentListService, contentService, new TranslationMock()); }); it('should register custom action handler', () => { - let handler: ContentActionHandler = function () { + const handler: ContentActionHandler = function () { }; service.setHandler('<key>', handler); expect(service.getHandler('<key>')).toBe(handler); @@ -56,7 +56,7 @@ describe('FolderActionsService', () => { }); it('should be case insensitive for keys', () => { - let handler: ContentActionHandler = function () { + const handler: ContentActionHandler = function () { }; service.setHandler('<key>', handler); expect(service.getHandler('<KEY>')).toBe(handler); @@ -68,7 +68,7 @@ describe('FolderActionsService', () => { }); it('should allow action execution only when service available', () => { - let folder = new FolderNode(); + const folder = new FolderNode(); expect(service.canExecuteAction(folder)).toBeTruthy(); }); @@ -79,7 +79,7 @@ describe('FolderActionsService', () => { }); it('should set new handler only by key', () => { - let handler: ContentActionHandler = function () { + const handler: ContentActionHandler = function () { }; expect(service.setHandler(null, handler)).toBeFalsy(); expect(service.setHandler('', handler)).toBeFalsy(); @@ -100,7 +100,7 @@ describe('FolderActionsService', () => { done(); }); - let folder = new FolderNode(); + const folder = new FolderNode(); service.getHandler('delete')(folder); }); @@ -113,9 +113,9 @@ describe('FolderActionsService', () => { }); }); - let permission = 'delete'; - let folder = new FolderNode(); - let folderWithPermission: any = folder; + const permission = 'delete'; + const folder = new FolderNode(); + const folderWithPermission: any = folder; folderWithPermission.entry.allowableOperations = [permission]; const deleteObservable = service.getHandler('delete')(folderWithPermission, null, permission); @@ -138,8 +138,8 @@ describe('FolderActionsService', () => { done(); }); - let folder = new FolderNode(); - let folderWithPermission: any = folder; + const folder = new FolderNode(); + const folderWithPermission: any = folder; folderWithPermission.entry.allowableOperations = ['create', 'update']; service.getHandler('delete')(folderWithPermission); }); @@ -152,8 +152,8 @@ describe('FolderActionsService', () => { }); }); - let folder = new FolderNode(); - let folderWithPermission: any = folder; + const folder = new FolderNode(); + const folderWithPermission: any = folder; folderWithPermission.entry.allowableOperations = ['create', 'update']; const deleteObservable = service.getHandler('delete')(folderWithPermission); @@ -174,9 +174,9 @@ describe('FolderActionsService', () => { }); }); - let permission = 'delete'; - let folder = new FolderNode(); - let folderWithPermission: any = folder; + const permission = 'delete'; + const folder = new FolderNode(); + const folderWithPermission: any = folder; folderWithPermission.entry.allowableOperations = ['create', 'update', permission]; service.getHandler('delete')(folderWithPermission, null, permission); @@ -191,13 +191,13 @@ describe('FolderActionsService', () => { }); }); - let permission = 'delete'; - let file = new FileNode(); + const permission = 'delete'; + const file = new FileNode(); service.getHandler('delete')(file); expect(documentListService.deleteNode).not.toHaveBeenCalled(); - let folder = new FolderNode(); - let folderWithPermission: any = folder; + const folder = new FolderNode(); + const folderWithPermission: any = folder; folderWithPermission.entry.allowableOperations = [permission]; service.getHandler('delete')(folderWithPermission, null, permission); expect(documentListService.deleteNode).toHaveBeenCalled(); @@ -211,7 +211,7 @@ describe('FolderActionsService', () => { }); }); - let folder = new FolderNode(); + const folder = new FolderNode(); folder.entry.id = null; service.getHandler('delete')(folder); @@ -226,13 +226,13 @@ describe('FolderActionsService', () => { }); }); - let permission = 'delete'; - let target = jasmine.createSpyObj('obj', ['reload']); - let folder = new FolderNode(); - let folderWithPermission: any = folder; + const permission = 'delete'; + const target = jasmine.createSpyObj('obj', ['reload']); + const folder = new FolderNode(); + const folderWithPermission: any = folder; folderWithPermission.entry.allowableOperations = [permission]; - let deleteHandler = service.getHandler('delete')(folderWithPermission, target, permission); + const deleteHandler = service.getHandler('delete')(folderWithPermission, target, permission); deleteHandler.subscribe(() => { expect(target.reload).toHaveBeenCalled(); @@ -255,10 +255,10 @@ describe('FolderActionsService', () => { done(); }); - let permission = 'delete'; - let target = jasmine.createSpyObj('obj', ['reload']); - let folder = new FolderNode(); - let folderWithPermission: any = folder; + const permission = 'delete'; + const target = jasmine.createSpyObj('obj', ['reload']); + const folder = new FolderNode(); + const folderWithPermission: any = folder; folderWithPermission.entry.allowableOperations = [permission]; service.getHandler('delete')(folderWithPermission, target, permission); diff --git a/lib/content-services/document-list/services/folder-actions.service.ts b/lib/content-services/document-list/services/folder-actions.service.ts index 8778846dbf..b2ad36f5b0 100644 --- a/lib/content-services/document-list/services/folder-actions.service.ts +++ b/lib/content-services/document-list/services/folder-actions.service.ts @@ -49,7 +49,7 @@ export class FolderActionsService { */ getHandler(key: string): ContentActionHandler { if (key) { - let lKey = key.toLowerCase(); + const lKey = key.toLowerCase(); return this.handlers[lKey] || null; } return null; @@ -63,7 +63,7 @@ export class FolderActionsService { */ setHandler(key: string, handler: ContentActionHandler): boolean { if (key) { - let lKey = key.toLowerCase(); + const lKey = key.toLowerCase(); this.handlers[lKey] = handler; return true; } @@ -125,10 +125,10 @@ export class FolderActionsService { target.reload(); } - let message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name }); + const message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name }); this.success.next(message); }, () => { - let message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name }); + const message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name }); this.error.next(message); }); diff --git a/lib/content-services/document-list/services/node-actions.service.spec.ts b/lib/content-services/document-list/services/node-actions.service.spec.ts index 0191729bae..9f8be1d42e 100644 --- a/lib/content-services/document-list/services/node-actions.service.spec.ts +++ b/lib/content-services/document-list/services/node-actions.service.spec.ts @@ -52,7 +52,7 @@ describe('NodeActionsService', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; service = TestBed.get(NodeActionsService); diff --git a/lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.spec.ts b/lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.spec.ts index 4b931b6b81..05505dc80f 100644 --- a/lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.spec.ts +++ b/lib/content-services/permission-manager/components/add-permission/add-permission-dialog.component.spec.ts @@ -32,7 +32,7 @@ describe('AddPermissionDialog', () => { let fixture: ComponentFixture<AddPermissionDialogComponent>; let element: HTMLElement; - let data: AddPermissionDialogData = { + const data: AddPermissionDialogData = { title: 'dead or alive you are coming with me', nodeId: 'fake-node-id', confirm: new Subject<NodeEntry[]> () diff --git a/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.spec.ts b/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.spec.ts index 20ce655fc2..3a12a5dd5f 100644 --- a/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.spec.ts +++ b/lib/content-services/permission-manager/components/add-permission/add-permission-panel.component.spec.ts @@ -50,7 +50,7 @@ describe('AddPermissionPanelComponent', () => { }); function typeWordIntoSearchInput(word: string): void { - let inputDebugElement = debugElement.query(By.css('#searchInput')); + const inputDebugElement = debugElement.query(By.css('#searchInput')); inputDebugElement.nativeElement.value = word; inputDebugElement.nativeElement.focus(); inputDebugElement.nativeElement.dispatchEvent(new Event('input')); diff --git a/lib/content-services/permission-manager/components/add-permission/add-permission.component.spec.ts b/lib/content-services/permission-manager/components/add-permission/add-permission.component.spec.ts index 06e0625417..14da20323b 100644 --- a/lib/content-services/permission-manager/components/add-permission/add-permission.component.spec.ts +++ b/lib/content-services/permission-manager/components/add-permission/add-permission.component.spec.ts @@ -104,7 +104,7 @@ describe('AddPermissionComponent', () => { fixture.componentInstance.currentNode = new Node({ id: 'fake-node-id' }); spyOn(nodePermissionService, 'updateNodePermissions').and.returnValue(of({ id: 'fake-node-id' })); - let spySuccess = spyOn(fixture.componentInstance, 'success'); + const spySuccess = spyOn(fixture.componentInstance, 'success'); fixture.componentInstance.applySelection(); expect(spySuccess).not.toHaveBeenCalled(); }); diff --git a/lib/content-services/permission-manager/components/inherited-button.directive.spec.ts b/lib/content-services/permission-manager/components/inherited-button.directive.spec.ts index 4fa9fab89d..3e7fb50416 100644 --- a/lib/content-services/permission-manager/components/inherited-button.directive.spec.ts +++ b/lib/content-services/permission-manager/components/inherited-button.directive.spec.ts @@ -98,7 +98,7 @@ describe('InheritPermissionDirective', () => { it('should not update the node when node has no permission', async(() => { spyOn(nodeService, 'getNode').and.returnValue(of(fakeNodeWithInheritNoPermission)); - let spyUpdateNode = spyOn(nodeService, 'updateNode'); + const spyUpdateNode = spyOn(nodeService, 'updateNode'); component.updatedNode = true; fixture.detectChanges(); const buttonPermission: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#sample-button-permission'); diff --git a/lib/content-services/permission-manager/components/permission-list/permission-list.component.spec.ts b/lib/content-services/permission-manager/components/permission-list/permission-list.component.spec.ts index 3db55f6da5..322e6cc664 100644 --- a/lib/content-services/permission-manager/components/permission-list/permission-list.component.spec.ts +++ b/lib/content-services/permission-manager/components/permission-list/permission-list.component.spec.ts @@ -120,7 +120,7 @@ describe('PermissionDisplayComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let options: any = fixture.debugElement.queryAll(By.css('mat-option')); + const options: any = fixture.debugElement.queryAll(By.css('mat-option')); expect(options).not.toBeNull(); expect(options.length).toBe(4); expect(options[0].nativeElement.innerText).toContain('SiteCollaborator'); @@ -145,7 +145,7 @@ describe('PermissionDisplayComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let options: any = fixture.debugElement.queryAll(By.css('mat-option')); + const options: any = fixture.debugElement.queryAll(By.css('mat-option')); expect(options).not.toBeNull(); expect(options.length).toBe(5); expect(options[0].nativeElement.innerText).toContain('Contributor'); @@ -178,7 +178,7 @@ describe('PermissionDisplayComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let options: any = fixture.debugElement.queryAll(By.css('mat-option')); + const options: any = fixture.debugElement.queryAll(By.css('mat-option')); expect(options).not.toBeNull(); expect(options.length).toBe(5); options[3].triggerEventHandler('click', {}); diff --git a/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts b/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts index 0332670b4f..fc3f0380cc 100644 --- a/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts +++ b/lib/content-services/permission-manager/components/permission-list/permission-list.component.ts @@ -69,16 +69,16 @@ export class PermissionListComponent implements OnInit { } private getPermissionList(node: Node): PermissionDisplayModel[] { - let allPermissions: PermissionDisplayModel[] = []; + const allPermissions: PermissionDisplayModel[] = []; if (node.permissions.locallySet) { node.permissions.locallySet.map((permissionElement: PermissionElement) => { - let permission = new PermissionDisplayModel(permissionElement); + const permission = new PermissionDisplayModel(permissionElement); allPermissions.push(permission); }); } if (node.permissions.inherited) { node.permissions.inherited.map((permissionElement: PermissionElement) => { - let permissionInherited = new PermissionDisplayModel(permissionElement); + const permissionInherited = new PermissionDisplayModel(permissionElement); permissionInherited.isInherited = true; allPermissions.push(permissionInherited); }); @@ -87,7 +87,7 @@ export class PermissionListComponent implements OnInit { } saveNewRole(event: any, permissionRow: PermissionDisplayModel) { - let updatedPermissionRole: PermissionElement = this.buildUpdatedPermission(event.value, permissionRow); + const updatedPermissionRole: PermissionElement = this.buildUpdatedPermission(event.value, permissionRow); this.nodePermissionService.updatePermissionRole(this.actualNode, updatedPermissionRole) .subscribe((node: Node) => { this.update.emit(updatedPermissionRole); @@ -95,7 +95,7 @@ export class PermissionListComponent implements OnInit { } private buildUpdatedPermission(newRole: string, permissionRow: PermissionDisplayModel): PermissionElement { - let permissionRole: PermissionElement = {}; + const permissionRole: PermissionElement = {}; permissionRole.accessStatus = permissionRow.accessStatus; permissionRole.name = newRole; permissionRole.authorityId = permissionRow.authorityId; diff --git a/lib/content-services/permission-manager/services/node-permission-dialog.service.spec.ts b/lib/content-services/permission-manager/services/node-permission-dialog.service.spec.ts index 7e3e3df3bf..a2555bd108 100644 --- a/lib/content-services/permission-manager/services/node-permission-dialog.service.spec.ts +++ b/lib/content-services/permission-manager/services/node-permission-dialog.service.spec.ts @@ -39,7 +39,7 @@ describe('NodePermissionDialogService', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; service = TestBed.get(NodePermissionDialogService); materialDialog = TestBed.get(MatDialog); diff --git a/lib/content-services/permission-manager/services/node-permission-dialog.service.ts b/lib/content-services/permission-manager/services/node-permission-dialog.service.ts index 8195534aca..2d8b61366c 100644 --- a/lib/content-services/permission-manager/services/node-permission-dialog.service.ts +++ b/lib/content-services/permission-manager/services/node-permission-dialog.service.ts @@ -58,7 +58,7 @@ export class NodePermissionDialogService { this.openDialog(data, 'adf-add-permission-dialog', '630px'); return confirm; } else { - let errors = new Error(JSON.stringify({ error: { statusCode: 403 } })); + const errors = new Error(JSON.stringify({ error: { statusCode: 403 } })); errors.message = 'PERMISSION_MANAGER.ERROR.NOT-ALLOWED'; return throwError(errors); } diff --git a/lib/content-services/permission-manager/services/node-permission.service.spec.ts b/lib/content-services/permission-manager/services/node-permission.service.spec.ts index 09bb3d8359..c14a9b2696 100644 --- a/lib/content-services/permission-manager/services/node-permission.service.spec.ts +++ b/lib/content-services/permission-manager/services/node-permission.service.spec.ts @@ -52,7 +52,7 @@ describe('NodePermissionService', () => { }); function returnUpdatedNode(nodeId, nodeBody) { - let fakeNode: Node = new Node({}); + const fakeNode: Node = new Node({}); fakeNode.id = 'fake-updated-node'; fakeNode.permissions = nodeBody.permissions; return of(fakeNode); @@ -149,7 +149,7 @@ describe('NodePermissionService', () => { })); it('should be able to update locally permissions on the node without locally set permissions', async(() => { - let fakeNodeCopy = JSON.parse(JSON.stringify(fakeNodeWithoutPermissions)); + const fakeNodeCopy = JSON.parse(JSON.stringify(fakeNodeWithoutPermissions)); fakeNodeCopy.permissions.locallySet = undefined; spyOn(nodeService, 'updateNode').and.callFake((nodeId, permissionBody) => returnUpdatedNode(nodeId, permissionBody)); diff --git a/lib/content-services/permission-manager/services/node-permission.service.ts b/lib/content-services/permission-manager/services/node-permission.service.ts index 3d726b8470..683377bd2c 100644 --- a/lib/content-services/permission-manager/services/node-permission.service.ts +++ b/lib/content-services/permission-manager/services/node-permission.service.ts @@ -43,7 +43,7 @@ export class NodePermissionService { .pipe( switchMap((siteNodeList: any) => { if ( siteNodeList.list.entries.length > 0 ) { - let siteName = siteNodeList.list.entries[0].entry.name; + const siteName = siteNodeList.list.entries[0].entry.name; return this.getGroupMembersBySiteName(siteName); } else { return of(node.permissions.settable); @@ -59,7 +59,7 @@ export class NodePermissionService { * @returns Node with updated permission */ updatePermissionRole(node: Node, updatedPermissionRole: PermissionElement): Observable<Node> { - let permissionBody = { permissions: { locallySet: []} }; + const permissionBody = { permissions: { locallySet: []} }; const index = node.permissions.locallySet.map((permission) => permission.authorityId).indexOf(updatedPermissionRole.authorityId); permissionBody.permissions.locallySet = permissionBody.permissions.locallySet.concat(node.permissions.locallySet); if (index !== -1) { @@ -95,7 +95,7 @@ export class NodePermissionService { * @returns Node with updated permissions */ updateLocallySetPermissions(node: Node, nodes: NodeEntry[], nodeRole: string[]): Observable<Node> { - let permissionBody = { permissions: { locallySet: []} }; + const permissionBody = { permissions: { locallySet: []} }; const permissionList = this.transformNodeToPermissionElement(nodes, nodeRole[0]); const duplicatedPermissions = this.getDuplicatedPermissions(node.permissions.locallySet, permissionList); if (duplicatedPermissions.length > 0) { @@ -108,7 +108,7 @@ export class NodePermissionService { } private getDuplicatedPermissions(nodeLocallySet: PermissionElement[], permissionListAdded: PermissionElement[]): PermissionElement[] { - let duplicatePermissions: PermissionElement[] = []; + const duplicatePermissions: PermissionElement[] = []; if (nodeLocallySet) { permissionListAdded.forEach((permission: PermissionElement) => { const duplicate = nodeLocallySet.find((localPermission) => this.isEqualPermission(localPermission, permission)); @@ -128,7 +128,7 @@ export class NodePermissionService { private transformNodeToPermissionElement(nodes: NodeEntry[], nodeRole: any): PermissionElement[] { return nodes.map((node) => { - let newPermissionElement: PermissionElement = <PermissionElement> { + const newPermissionElement: PermissionElement = <PermissionElement> { 'authorityId': node.entry.properties['cm:authorityName'] ? node.entry.properties['cm:authorityName'] : node.entry.properties['cm:userName'], @@ -146,7 +146,7 @@ export class NodePermissionService { * @returns Node with modified permissions */ removePermission(node: Node, permissionToRemove: PermissionElement): Observable<Node> { - let permissionBody = { permissions: { locallySet: [] } }; + const permissionBody = { permissions: { locallySet: [] } }; const index = node.permissions.locallySet.map((permission) => permission.authorityId).indexOf(permissionToRemove.authorityId); if (index !== -1) { node.permissions.locallySet.splice(index, 1); @@ -160,7 +160,7 @@ export class NodePermissionService { return this.getGroupMemberByGroupName(groupName) .pipe( map((groupMemberPaging: GroupMemberPaging) => { - let displayResult: string[] = []; + const displayResult: string[] = []; groupMemberPaging.list.entries.forEach((member: GroupMemberEntry) => { displayResult.push(this.formattedRoleName(member.entry.displayName, 'site_' + siteName)); }); diff --git a/lib/content-services/search/components/search-control.component.spec.ts b/lib/content-services/search/components/search-control.component.spec.ts index aedecf6f86..4e727becde 100644 --- a/lib/content-services/search/components/search-control.component.spec.ts +++ b/lib/content-services/search/components/search-control.component.spec.ts @@ -103,7 +103,7 @@ describe('SearchControlComponent', () => { }); function typeWordIntoSearchInput(word: string): void { - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); inputDebugElement.nativeElement.value = word; inputDebugElement.nativeElement.focus(); inputDebugElement.nativeElement.dispatchEvent(new Event('input')); @@ -120,7 +120,7 @@ describe('SearchControlComponent', () => { of({ entry: { list: [] } }) ); - let searchDisposable = component.searchChange.subscribe((value) => { + const searchDisposable = component.searchChange.subscribe((value) => { expect(value).toBe('customSearchTerm'); searchDisposable.unsubscribe(); done(); @@ -161,7 +161,7 @@ describe('SearchControlComponent', () => { it('should still fire an event when user inputs a search term less than 3 characters', (done) => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); - let searchDisposable = component.searchChange.subscribe((value) => { + const searchDisposable = component.searchChange.subscribe((value) => { expect(value).toBe('cu'); searchDisposable.unsubscribe(); }); @@ -182,7 +182,7 @@ describe('SearchControlComponent', () => { }); it('search button should be hide', () => { - let searchButton: any = element.querySelector('#adf-search-button'); + const searchButton: any = element.querySelector('#adf-search-button'); expect(searchButton).toBe(null); }); @@ -202,7 +202,7 @@ describe('SearchControlComponent', () => { it('should set browser autocomplete to off by default', async(() => { fixture.detectChanges(); - let attr = element.querySelector('#adf-control-input').getAttribute('autocomplete'); + const attr = element.querySelector('#adf-control-input').getAttribute('autocomplete'); expect(attr).toBe('off'); })); @@ -219,7 +219,7 @@ describe('SearchControlComponent', () => { })); xit('should fire a search when a enter key is pressed', (done) => { - let searchDisposable = component.submit.subscribe((value) => { + const searchDisposable = component.submit.subscribe((value) => { expect(value).toBe('TEST'); searchDisposable.unsubscribe(); done(); @@ -229,9 +229,9 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); typeWordIntoSearchInput('TEST'); - let enterKeyEvent: any = new Event('keyup'); + const enterKeyEvent: any = new Event('keyup'); enterKeyEvent.keyCode = '13'; inputDebugElement.nativeElement.dispatchEvent(enterKeyEvent); }); @@ -253,7 +253,7 @@ describe('SearchControlComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let resultElement: Element = element.querySelector('#autocomplete-search-result-list'); + const resultElement: Element = element.querySelector('#autocomplete-search-result-list'); expect(resultElement).not.toBe(null); done(); }); @@ -268,7 +268,7 @@ describe('SearchControlComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let noResultElement: Element = element.querySelector('#search_no_result'); + const noResultElement: Element = element.querySelector('#search_no_result'); expect(noResultElement).not.toBe(null); done(); }); @@ -279,7 +279,7 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); typeWordIntoSearchInput('NO RES'); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -300,12 +300,12 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); typeWordIntoSearchInput('TEST'); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let resultElement: HTMLElement = <HTMLElement> element.querySelector('#result_option_0'); + const resultElement: HTMLElement = <HTMLElement> element.querySelector('#result_option_0'); resultElement.focus(); expect(resultElement).not.toBe(null); inputDebugElement.nativeElement.dispatchEvent(new KeyboardEvent('keypress', { key: 'TAB' })); @@ -321,14 +321,14 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); typeWordIntoSearchInput('TEST'); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); let resultElement: HTMLElement = <HTMLElement> element.querySelector('#result_option_0'); expect(resultElement).not.toBeNull(); - let escapeEvent: any = new Event('ESCAPE'); + const escapeEvent: any = new Event('ESCAPE'); escapeEvent.keyCode = 27; inputDebugElement.triggerEventHandler('keydown', escapeEvent); fixture.whenStable().then(() => { @@ -345,14 +345,14 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); typeWordIntoSearchInput('TEST'); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); let resultElement: HTMLElement = <HTMLElement> element.querySelector('#result_option_0'); expect(resultElement).not.toBeNull(); - let escapeEvent: any = new Event('ENTER'); + const escapeEvent: any = new Event('ENTER'); escapeEvent.keyCode = 13; inputDebugElement.triggerEventHandler('keydown', escapeEvent); fixture.whenStable().then(() => { @@ -369,8 +369,8 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); - let escapeEvent: any = new Event('ESCAPE'); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const escapeEvent: any = new Event('ESCAPE'); escapeEvent.keyCode = 27; inputDebugElement.nativeElement.focus(); inputDebugElement.nativeElement.dispatchEvent(escapeEvent); @@ -399,7 +399,7 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); typeWordIntoSearchInput('TEST'); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); fixture.whenStable().then(() => { fixture.detectChanges(); @@ -415,7 +415,7 @@ describe('SearchControlComponent', () => { xit('should select the second item on autocomplete list when ARROW DOWN is pressed on list', (done) => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); typeWordIntoSearchInput('TEST'); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -426,7 +426,7 @@ describe('SearchControlComponent', () => { fixture.detectChanges(); expect(document.activeElement.id).toBe('result_option_0'); - let firstElement = debugElement.query(By.css('#result_option_0')); + const firstElement = debugElement.query(By.css('#result_option_0')); firstElement.triggerEventHandler('keyup.arrowdown', { target: firstElement.nativeElement }); fixture.detectChanges(); expect(document.activeElement.id).toBe('result_option_1'); @@ -437,7 +437,7 @@ describe('SearchControlComponent', () => { xit('should focus the input search when ARROW UP is pressed on the first list item', (done) => { searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); fixture.detectChanges(); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); typeWordIntoSearchInput('TEST'); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -448,7 +448,7 @@ describe('SearchControlComponent', () => { fixture.detectChanges(); expect(document.activeElement.id).toBe('result_option_0'); - let firstElement = debugElement.query(By.css('#result_option_0')); + const firstElement = debugElement.query(By.css('#result_option_0')); firstElement.triggerEventHandler('keyup.arrowup', { target: firstElement.nativeElement }); fixture.detectChanges(); expect(document.activeElement.id).toBe('adf-control-input'); @@ -465,7 +465,7 @@ describe('SearchControlComponent', () => { tick(100); - let searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); + const searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); component.subscriptAnimationState = 'active'; fixture.detectChanges(); @@ -490,7 +490,7 @@ describe('SearchControlComponent', () => { tick(100); - let searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); + const searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); searchButton.triggerEventHandler('click', null); tick(100); @@ -506,10 +506,10 @@ describe('SearchControlComponent', () => { fixture.detectChanges(); tick(100); - let searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); + const searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); searchButton.triggerEventHandler('click', null); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); tick(100); fixture.detectChanges(); @@ -525,7 +525,7 @@ describe('SearchControlComponent', () => { tick(100); - let searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); + const searchButton: DebugElement = debugElement.query(By.css('#adf-search-button')); component.subscriptAnimationState = 'active'; fixture.detectChanges(); @@ -554,7 +554,7 @@ describe('SearchControlComponent', () => { tick(100); - let inputDebugElement = debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = debugElement.query(By.css('#adf-control-input')); component.subscriptAnimationState = 'active'; fixture.detectChanges(); @@ -579,7 +579,7 @@ describe('SearchControlComponent', () => { it('should emit a option clicked event when item is clicked', (done) => { spyOn(component, 'isSearchBarActive').and.returnValue(true); searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); - let clickDisposable = component.optionClicked.subscribe((item) => { + const clickDisposable = component.optionClicked.subscribe((item) => { expect(item.entry.id).toBe('123'); clickDisposable.unsubscribe(); done(); @@ -589,7 +589,7 @@ describe('SearchControlComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let firstOption: DebugElement = debugElement.query(By.css('#result_name_0')); + const firstOption: DebugElement = debugElement.query(By.css('#result_name_0')); firstOption.nativeElement.click(); }); }); @@ -597,7 +597,7 @@ describe('SearchControlComponent', () => { it('should set deactivate the search after element is clicked', (done) => { spyOn(component, 'isSearchBarActive').and.returnValue(true); searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); - let clickDisposable = component.optionClicked.subscribe((item) => { + const clickDisposable = component.optionClicked.subscribe((item) => { expect(component.subscriptAnimationState).toBe('inactive'); clickDisposable.unsubscribe(); done(); @@ -608,7 +608,7 @@ describe('SearchControlComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let firstOption: DebugElement = debugElement.query(By.css('#result_name_0')); + const firstOption: DebugElement = debugElement.query(By.css('#result_name_0')); firstOption.nativeElement.click(); }); }); @@ -616,7 +616,7 @@ describe('SearchControlComponent', () => { it('should NOT reset the search term after element is clicked', (done) => { spyOn(component, 'isSearchBarActive').and.returnValue(true); searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results)))); - let clickDisposable = component.optionClicked.subscribe((item) => { + const clickDisposable = component.optionClicked.subscribe((item) => { expect(component.searchTerm).not.toBeFalsy(); expect(component.searchTerm).toBe('TEST'); clickDisposable.unsubscribe(); @@ -628,7 +628,7 @@ describe('SearchControlComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let firstOption: DebugElement = debugElement.query(By.css('#result_name_0')); + const firstOption: DebugElement = debugElement.query(By.css('#result_name_0')); firstOption.nativeElement.click(); }); }); @@ -649,7 +649,7 @@ describe('SearchControlComponent', () => { searchServiceSpy.and.returnValue(of(noResult)); fixtureCustom.detectChanges(); - let inputDebugElement = fixtureCustom.debugElement.query(By.css('#adf-control-input')); + const inputDebugElement = fixtureCustom.debugElement.query(By.css('#adf-control-input')); inputDebugElement.nativeElement.value = 'SOMETHING'; inputDebugElement.nativeElement.focus(); inputDebugElement.nativeElement.dispatchEvent(new Event('input')); diff --git a/lib/content-services/search/components/search-control.component.ts b/lib/content-services/search/components/search-control.component.ts index d06bd05897..e0602c00bb 100644 --- a/lib/content-services/search/components/search-control.component.ts +++ b/lib/content-services/search/components/search-control.component.ts @@ -217,20 +217,20 @@ export class SearchControlComponent implements OnInit, OnDestroy { selectFirstResult() { if ( this.listResultElement && this.listResultElement.length > 0) { - let firstElement: MatListItem = <MatListItem> this.listResultElement.first; + const firstElement: MatListItem = <MatListItem> this.listResultElement.first; firstElement._getHostElement().focus(); } } onRowArrowDown($event: KeyboardEvent): void { - let nextElement: any = this.getNextElementSibling(<Element> $event.target); + const nextElement: any = this.getNextElementSibling(<Element> $event.target); if (nextElement) { nextElement.focus(); } } onRowArrowUp($event: KeyboardEvent): void { - let previousElement: any = this.getPreviousElementSibling(<Element> $event.target); + const previousElement: any = this.getPreviousElementSibling(<Element> $event.target); if (previousElement) { previousElement.focus(); } else { diff --git a/lib/content-services/search/components/search-date-range/search-date-range.component.spec.ts b/lib/content-services/search/components/search-date-range/search-date-range.component.spec.ts index 6c6c0dd168..21c4d49c43 100644 --- a/lib/content-services/search/components/search-date-range/search-date-range.component.spec.ts +++ b/lib/content-services/search/components/search-date-range/search-date-range.component.spec.ts @@ -29,8 +29,8 @@ describe('SearchDateRangeComponent', () => { describe('component class', () => { let component: SearchDateRangeComponent; - let fromDate = '2016-10-16'; - let toDate = '2017-10-16'; + const fromDate = '2016-10-16'; + const toDate = '2017-10-16'; const localeFixture = 'it'; const dateFormatFixture = 'DD-MMM-YY'; diff --git a/lib/content-services/search/components/search-filter/models/search-filter-list.model.ts b/lib/content-services/search/components/search-filter/models/search-filter-list.model.ts index 75a1591ec1..dfb0db729b 100644 --- a/lib/content-services/search/components/search-filter/models/search-filter-list.model.ts +++ b/lib/content-services/search/components/search-filter/models/search-filter-list.model.ts @@ -127,7 +127,7 @@ export class SearchFilterList<T> implements Iterable<T> { [Symbol.iterator](): Iterator<T> { let pointer = 0; - let items = this.visibleItems; + const items = this.visibleItems; return { next(): IteratorResult<T> { diff --git a/lib/content-services/search/components/search-filter/search-filter.component.spec.ts b/lib/content-services/search/components/search-filter/search-filter.component.spec.ts index 265b7adf3c..20a5a89da9 100644 --- a/lib/content-services/search/components/search-filter/search-filter.component.spec.ts +++ b/lib/content-services/search/components/search-filter/search-filter.component.spec.ts @@ -589,7 +589,7 @@ describe('SearchFilterComponent', () => { expect(queryBuilder.removeUserFacetBucket).toHaveBeenCalledTimes(3); expect(queryBuilder.update).toHaveBeenCalled(); - for (let entry of component.responseFacets[0].buckets.items) { + for (const entry of component.responseFacets[0].buckets.items) { expect(entry.checked).toBeFalsy(); } }); diff --git a/lib/content-services/search/components/search-filter/search-filter.component.ts b/lib/content-services/search/components/search-filter/search-filter.component.ts index 178323e9aa..b41762b6ff 100644 --- a/lib/content-services/search/components/search-filter/search-filter.component.ts +++ b/lib/content-services/search/components/search-filter/search-filter.component.ts @@ -93,7 +93,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy { private updateSelectedBuckets() { if (this.responseFacets) { this.selectedBuckets = []; - for (let field of this.responseFacets) { + for (const field of this.responseFacets) { if (field.buckets) { this.selectedBuckets.push( ...this.queryBuilder.getUserFacetBuckets(field.field) @@ -146,7 +146,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy { resetSelectedBuckets(field: FacetField) { if (field && field.buckets) { - for (let bucket of field.buckets.items) { + for (const bucket of field.buckets.items) { bucket.checked = false; this.queryBuilder.removeUserFacetBucket(field, bucket); } @@ -158,7 +158,7 @@ export class SearchFilterComponent implements OnInit, OnDestroy { resetAllSelectedBuckets() { this.responseFacets.forEach((field) => { if (field && field.buckets) { - for (let bucket of field.buckets.items) { + for (const bucket of field.buckets.items) { bucket.checked = false; this.queryBuilder.removeUserFacetBucket(field, bucket); } diff --git a/lib/content-services/search/components/search-trigger.directive.ts b/lib/content-services/search/components/search-trigger.directive.ts index c8532cd1f3..519bbd6cc1 100644 --- a/lib/content-services/search/components/search-trigger.directive.ts +++ b/lib/content-services/search/components/search-trigger.directive.ts @@ -162,7 +162,7 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy { handleInput(event: KeyboardEvent): void { if (document.activeElement === event.target) { - let inputValue: string = (event.target as HTMLInputElement).value; + const inputValue: string = (event.target as HTMLInputElement).value; this.onChange(inputValue); if (inputValue) { this.searchPanel.keyPressedStream.next(inputValue); @@ -177,7 +177,7 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy { private isPanelOptionClicked(event: MouseEvent) { let isPanelOption: boolean = false; if ( event ) { - let clickTarget = event.target as HTMLElement; + const clickTarget = event.target as HTMLElement; isPanelOption = !this.isNoResultOption(event) && !!this.searchPanel.panel && !!this.searchPanel.panel.nativeElement.contains(clickTarget); diff --git a/lib/content-services/search/components/search.component.spec.ts b/lib/content-services/search/components/search.component.spec.ts index d300285f9b..b570033260 100644 --- a/lib/content-services/search/components/search.component.spec.ts +++ b/lib/content-services/search/components/search.component.spec.ts @@ -87,7 +87,7 @@ describe('SearchComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let message: HTMLElement = <HTMLElement> element.querySelector('#component-result-message'); + const message: HTMLElement = <HTMLElement> element.querySelector('#component-result-message'); expect(message.textContent).toBe('ERROR'); done(); }); @@ -103,13 +103,13 @@ describe('SearchComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let optionShowed = element.querySelectorAll('#autocomplete-search-result-list'); + const optionShowed = element.querySelectorAll('#autocomplete-search-result-list'); expect(optionShowed).not.toBeNull(); component.forceHidePanel(); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let elementList = element.querySelector('#adf-search-results-content'); + const elementList = element.querySelector('#adf-search-results-content'); expect(elementList.classList).toContain('adf-search-hide'); done(); }); @@ -125,9 +125,9 @@ describe('SearchComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let optionShowed = element.querySelectorAll('#autocomplete-search-result-list > li').length; + const optionShowed = element.querySelectorAll('#autocomplete-search-result-list > li').length; expect(optionShowed).toBe(1); - let folderOption: HTMLElement = <HTMLElement> element.querySelector('#result_option_0'); + const folderOption: HTMLElement = <HTMLElement> element.querySelector('#result_option_0'); expect(folderOption.textContent.trim()).toBe('MyDoc'); done(); }); diff --git a/lib/content-services/search/search-query-builder.service.ts b/lib/content-services/search/search-query-builder.service.ts index eb92866766..b0ae03c1b0 100644 --- a/lib/content-services/search/search-query-builder.service.ts +++ b/lib/content-services/search/search-query-builder.service.ts @@ -208,7 +208,7 @@ export class SearchQueryBuilderService { * @returns The finished query */ buildQuery(): QueryBody { - let query = this.getFinalQuery(); + const query = this.getFinalQuery(); const include = this.config.include || []; if (include.length === 0) { diff --git a/lib/content-services/site-dropdown/sites-dropdown.component.spec.ts b/lib/content-services/site-dropdown/sites-dropdown.component.spec.ts index 5103eb976f..d57769e849 100644 --- a/lib/content-services/site-dropdown/sites-dropdown.component.spec.ts +++ b/lib/content-services/site-dropdown/sites-dropdown.component.spec.ts @@ -216,7 +216,7 @@ describe('DropdownSitesComponent', () => { fixture.detectChanges(); debug.query(By.css('.mat-select-trigger')).triggerEventHandler('click', null); fixture.detectChanges(); - let options: any = debug.queryAll(By.css('mat-option')); + const options: any = debug.queryAll(By.css('mat-option')); expect(options[0].nativeElement.innerText).toContain('DROPDOWN.MY_FILES_OPTION'); }); })); @@ -229,7 +229,7 @@ describe('DropdownSitesComponent', () => { fixture.detectChanges(); debug.query(By.css('.mat-select-trigger')).triggerEventHandler('click', null); fixture.detectChanges(); - let options: any = debug.queryAll(By.css('mat-option')); + const options: any = debug.queryAll(By.css('mat-option')); expect(options[0].nativeElement.innerText).not.toContain('DROPDOWN.MY_FILES_OPTION'); }); })); @@ -304,7 +304,7 @@ describe('DropdownSitesComponent', () => { fixture.detectChanges(); debug.query(By.css('.mat-select-trigger')).triggerEventHandler('click', null); fixture.detectChanges(); - let options: any = debug.queryAll(By.css('mat-option')); + const options: any = debug.queryAll(By.css('mat-option')); expect(options[1].nativeElement.innerText).toContain('fake-test-site'); expect(options[2].nativeElement.innerText).toContain('fake-test-2'); }); @@ -317,7 +317,7 @@ describe('DropdownSitesComponent', () => { fixture.detectChanges(); debug.query(By.css('.mat-select-trigger')).triggerEventHandler('click', null); fixture.detectChanges(); - let options: any = debug.queryAll(By.css('mat-option')); + const options: any = debug.queryAll(By.css('mat-option')); options[1].nativeElement.click(); fixture.detectChanges(); }); @@ -489,7 +489,7 @@ describe('DropdownSitesComponent', () => { debug.query(By.css('.mat-select-trigger')).triggerEventHandler('click', null); fixture.detectChanges(); fixture.whenStable().then(() => { - let options: any = debug.queryAll(By.css('mat-option')); + const options: any = debug.queryAll(By.css('mat-option')); expect(options[1].nativeElement.innerText).toContain('FAKE-SITE-PUBLIC'); expect(options[2].nativeElement.innerText).toContain('FAKE-PRIVATE-SITE-MEMBER'); expect(options[3]).toBeUndefined(); @@ -513,7 +513,7 @@ describe('DropdownSitesComponent', () => { debug.query(By.css('.mat-select-trigger')).triggerEventHandler('click', null); fixture.detectChanges(); fixture.whenStable().then(() => { - let options: any = debug.queryAll(By.css('mat-option')); + const options: any = debug.queryAll(By.css('mat-option')); expect(options[1].nativeElement.innerText).toContain('FAKE-MODERATED-SITE'); expect(options[2].nativeElement.innerText).toContain('FAKE-SITE-PUBLIC'); expect(options[3].nativeElement.innerText).toContain('FAKE-PRIVATE-SITE-MEMBER'); diff --git a/lib/content-services/site-dropdown/sites-dropdown.component.ts b/lib/content-services/site-dropdown/sites-dropdown.component.ts index d77d29dea4..fbc0954949 100644 --- a/lib/content-services/site-dropdown/sites-dropdown.component.ts +++ b/lib/content-services/site-dropdown/sites-dropdown.component.ts @@ -114,7 +114,7 @@ export class DropdownSitesComponent implements OnInit { } private loadSiteList() { - let extendedOptions: any = { + const extendedOptions: any = { skipCount: this.skipCount, maxItems: this.MAX_ITEMS }; @@ -131,7 +131,7 @@ export class DropdownSitesComponent implements OnInit { this.siteList = this.relations === Relations.Members ? this.filteredResultsByMember(sitePaging) : sitePaging; if (!this.hideMyFiles) { - let siteEntry = new SiteEntry({ + const siteEntry = new SiteEntry({ entry: { id: '-my-', guid: '-my-', @@ -147,7 +147,7 @@ export class DropdownSitesComponent implements OnInit { } } else { - let siteList: SitePaging = this.relations === Relations.Members ? this.filteredResultsByMember(sitePaging) : sitePaging; + const siteList: SitePaging = this.relations === Relations.Members ? this.filteredResultsByMember(sitePaging) : sitePaging; this.siteList.list.entries = this.siteList.list.entries.concat(siteList.list.entries); this.siteList.list.pagination = sitePaging.list.pagination; diff --git a/lib/content-services/social/like.component.spec.ts b/lib/content-services/social/like.component.spec.ts index c3f4ef642c..a32c4d958e 100644 --- a/lib/content-services/social/like.component.spec.ts +++ b/lib/content-services/social/like.component.spec.ts @@ -67,7 +67,7 @@ describe('Like component', () => { } })); - let likeButton: any = element.querySelector('#adf-like-test-id'); + const likeButton: any = element.querySelector('#adf-like-test-id'); likeButton.click(); fixture.whenStable().then(() => { @@ -81,7 +81,7 @@ describe('Like component', () => { component.isLike = true; - let likeButton: any = element.querySelector('#adf-like-test-id'); + const likeButton: any = element.querySelector('#adf-like-test-id'); likeButton.click(); fixture.whenStable().then(() => { diff --git a/lib/content-services/social/rating.component.spec.ts b/lib/content-services/social/rating.component.spec.ts index 62294780b2..c110319405 100644 --- a/lib/content-services/social/rating.component.spec.ts +++ b/lib/content-services/social/rating.component.spec.ts @@ -125,7 +125,7 @@ describe('Rating component', () => { done(); }); - let starThree: any = element.querySelector('#adf-colored-star-3'); + const starThree: any = element.querySelector('#adf-colored-star-3'); starThree.click(); }); diff --git a/lib/content-services/social/rating.component.ts b/lib/content-services/social/rating.component.ts index b4bbdc2d1f..32e2614668 100644 --- a/lib/content-services/social/rating.component.ts +++ b/lib/content-services/social/rating.component.ts @@ -45,7 +45,7 @@ export class RatingComponent implements OnChanges { } ngOnChanges() { - let ratingObserver = this.ratingService.getRating(this.nodeId, this.ratingType); + const ratingObserver = this.ratingService.getRating(this.nodeId, this.ratingType); ratingObserver.subscribe( (ratingEntry: RatingEntry) => { diff --git a/lib/content-services/social/services/rating.service.spec.ts b/lib/content-services/social/services/rating.service.spec.ts index 48fcbc16e0..5e236019fa 100644 --- a/lib/content-services/social/services/rating.service.spec.ts +++ b/lib/content-services/social/services/rating.service.spec.ts @@ -43,8 +43,8 @@ describe('Rating service', () => { }); it('Should get rating return an Observable', (done) => { - let ratingType: string = 'fiveStar'; - let nodeId: string = 'fake-node-id'; + const ratingType: string = 'fiveStar'; + const nodeId: string = 'fake-node-id'; service.getRating(nodeId, ratingType).subscribe((data) => { expect(data.entry.myRating).toBe('1'); @@ -66,8 +66,8 @@ describe('Rating service', () => { }); it('Should post rating return an Observable', (done) => { - let ratingType: string = 'fiveStar'; - let nodeId: string = 'fake-node-id'; + const ratingType: string = 'fiveStar'; + const nodeId: string = 'fake-node-id'; service.postRating(nodeId, ratingType, 3).subscribe((data) => { expect(data.entry.myRating).toBe('3'); diff --git a/lib/content-services/social/services/rating.service.ts b/lib/content-services/social/services/rating.service.ts index 2e53bfbb09..9d8734de75 100644 --- a/lib/content-services/social/services/rating.service.ts +++ b/lib/content-services/social/services/rating.service.ts @@ -51,7 +51,7 @@ export class RatingService { * @returns Details about the rating, including the new value */ postRating(nodeId: string, ratingType: string, vote: any): Observable<RatingEntry | {}> { - let ratingBody: RatingBody = new RatingBody({ + const ratingBody: RatingBody = new RatingBody({ 'id': ratingType, 'myRating': vote }); diff --git a/lib/content-services/tag/services/tag.service.ts b/lib/content-services/tag/services/tag.service.ts index 667c0f04ee..ad1b845818 100644 --- a/lib/content-services/tag/services/tag.service.ts +++ b/lib/content-services/tag/services/tag.service.ts @@ -65,7 +65,7 @@ export class TagService { const tagBody = new TagBody(); tagBody.tag = tagName; - let observableAdd = from(this.apiService.getInstance().core.tagsApi.addTag(nodeId, tagBody)); + const observableAdd = from(this.apiService.getInstance().core.tagsApi.addTag(nodeId, tagBody)); observableAdd.subscribe((tagEntry: TagEntry) => { this.refresh.emit(tagEntry); diff --git a/lib/content-services/tag/tag-actions.component.spec.ts b/lib/content-services/tag/tag-actions.component.spec.ts index 02797e29c0..303401d741 100644 --- a/lib/content-services/tag/tag-actions.component.spec.ts +++ b/lib/content-services/tag/tag-actions.component.spec.ts @@ -44,7 +44,7 @@ describe('TagActionsComponent', () => { fixture.destroy(); }); - let dataTag = { + const dataTag = { 'list': { 'pagination': { 'count': 3, @@ -103,7 +103,7 @@ describe('TagActionsComponent', () => { component.result.subscribe(() => { fixture.detectChanges(); - let deleteButton: any = element.querySelector('#tag_delete_test1'); + const deleteButton: any = element.querySelector('#tag_delete_test1'); deleteButton.click(); expect(jasmine.Ajax.requests.at(1).url) @@ -140,7 +140,7 @@ describe('TagActionsComponent', () => { component.result.subscribe(() => { fixture.detectChanges(); - let addButton: any = element.querySelector('#add-tag'); + const addButton: any = element.querySelector('#add-tag'); addButton.click(); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -172,7 +172,7 @@ describe('TagActionsComponent', () => { component.result.subscribe(() => { fixture.detectChanges(); - let addButton: any = element.querySelector('#add-tag'); + const addButton: any = element.querySelector('#add-tag'); addButton.click(); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -195,7 +195,7 @@ describe('TagActionsComponent', () => { fixture.detectChanges(); - let addButton: any = element.querySelector('#add-tag'); + const addButton: any = element.querySelector('#add-tag'); expect(addButton.disabled).toEqual(true); }); @@ -212,7 +212,7 @@ describe('TagActionsComponent', () => { component.result.subscribe(() => { fixture.detectChanges(); - let addButton: any = element.querySelector('#add-tag'); + const addButton: any = element.querySelector('#add-tag'); addButton.click(); }); @@ -230,7 +230,7 @@ describe('TagActionsComponent', () => { component.newTagName = 'fake-tag-name'; component.result.subscribe(() => { - let addButton: any = element.querySelector('#add-tag'); + const addButton: any = element.querySelector('#add-tag'); expect(addButton.disabled).toEqual(true); done(); }); @@ -249,7 +249,7 @@ describe('TagActionsComponent', () => { component.result.subscribe(() => { fixture.detectChanges(); - let addButton: any = element.querySelector('#add-tag'); + const addButton: any = element.querySelector('#add-tag'); expect(addButton.disabled).toEqual(false); done(); }); diff --git a/lib/content-services/tag/tag-list.component.spec.ts b/lib/content-services/tag/tag-list.component.spec.ts index 86b89b41c1..0155dbaf77 100644 --- a/lib/content-services/tag/tag-list.component.spec.ts +++ b/lib/content-services/tag/tag-list.component.spec.ts @@ -24,7 +24,7 @@ import { ContentTestingModule } from '../testing/content.testing.module'; describe('TagList', () => { - let dataTag = { + const dataTag = { 'list': { 'pagination': { 'count': 3, @@ -51,7 +51,7 @@ describe('TagList', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; tagService = TestBed.get(TagService); diff --git a/lib/content-services/tag/tag-node-list.component.spec.ts b/lib/content-services/tag/tag-node-list.component.spec.ts index 5c25a41163..62124986ae 100644 --- a/lib/content-services/tag/tag-node-list.component.spec.ts +++ b/lib/content-services/tag/tag-node-list.component.spec.ts @@ -24,7 +24,7 @@ import { ContentTestingModule } from '../testing/content.testing.module'; describe('TagNodeList', () => { - let dataTag = { + const dataTag = { 'list': { 'pagination': { 'count': 3, @@ -51,7 +51,7 @@ describe('TagNodeList', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; fixture = TestBed.createComponent(TagNodeListComponent); @@ -94,7 +94,7 @@ describe('TagNodeList', () => { component.results.subscribe(() => { fixture.detectChanges(); - let deleteButton: any = element.querySelector('#tag_chips_delete_test1'); + const deleteButton: any = element.querySelector('#tag_chips_delete_test1'); deleteButton.click(); expect(tagService.removeTag).toHaveBeenCalledWith('fake-node-id', '0ee933fa-57fc-4587-8a77-b787e814f1d2'); @@ -111,7 +111,7 @@ describe('TagNodeList', () => { component.results.subscribe(() => { fixture.detectChanges(); - let deleteButton: any = element.querySelector('#tag_chips_delete_test1'); + const deleteButton: any = element.querySelector('#tag_chips_delete_test1'); expect(deleteButton).toBeNull(); done(); }); @@ -126,7 +126,7 @@ describe('TagNodeList', () => { component.results.subscribe(() => { fixture.detectChanges(); - let deleteButton: any = element.querySelector('#tag_chips_delete_test1'); + const deleteButton: any = element.querySelector('#tag_chips_delete_test1'); expect(deleteButton).not.toBeNull(); done(); }); diff --git a/lib/content-services/tree-view/components/tree-view.component.spec.ts b/lib/content-services/tree-view/components/tree-view.component.spec.ts index 2a8cea3bf9..7786e84c48 100644 --- a/lib/content-services/tree-view/components/tree-view.component.spec.ts +++ b/lib/content-services/tree-view/components/tree-view.component.spec.ts @@ -32,19 +32,19 @@ describe('TreeViewComponent', () => { let treeService: TreeViewService; let component: any; - let fakeNodeList: TreeBaseNode[] = [ + const fakeNodeList: TreeBaseNode[] = [ <TreeBaseNode> { nodeId: 'fake-node-id', name: 'fake-node-name', level: 0, expandable: true, node: { entry: { name: 'fake-node-name', id: 'fake-node-id' } } } ]; - let fakeChildrenList: TreeBaseNode[] = [ + const fakeChildrenList: TreeBaseNode[] = [ <TreeBaseNode> { nodeId: 'fake-child-id', name: 'fake-child-name', level: 0, expandable: true, node: {} }, <TreeBaseNode> { nodeId: 'fake-second-id', name: 'fake-second-name', level: 0, expandable: true, node: {} } ]; - let fakeNextChildrenList: TreeBaseNode[] = [ + const fakeNextChildrenList: TreeBaseNode[] = [ <TreeBaseNode> { nodeId: 'fake-next-child-id', name: 'fake-next-child-name', @@ -61,7 +61,7 @@ describe('TreeViewComponent', () => { } ]; - let returnRootOrChildrenNode = function (nodeId: string) { + const returnRootOrChildrenNode = function (nodeId: string) { if (nodeId === '9999999') { return of(fakeNodeList); } else if (nodeId === 'fake-second-id') { @@ -101,7 +101,7 @@ describe('TreeViewComponent', () => { })); it('should show the subfolders when the folder is clicked', async(() => { - let rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); + const rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); expect(rootFolderButton).not.toBeNull(); rootFolderButton.click(); fixture.detectChanges(); @@ -117,7 +117,7 @@ describe('TreeViewComponent', () => { component.ngOnChanges({ 'nodeId': changeNodeId }); fixture.detectChanges(); fixture.whenStable().then(() => { - let rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-next-child-name'); + const rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-next-child-name'); expect(rootFolderButton).not.toBeNull(); rootFolderButton.click(); fixture.detectChanges(); @@ -137,13 +137,13 @@ describe('TreeViewComponent', () => { expect(nodeClicked.entry.id).toBe('fake-node-id'); done(); }); - let rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); + const rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); expect(rootFolderButton).not.toBeNull(); rootFolderButton.click(); }); it('should change the icon of the opened folders', async(() => { - let rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); + const rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); expect(rootFolderButton).not.toBeNull(); expect(element.querySelector('#button-fake-node-name .mat-icon').textContent.trim()).toBe('folder'); rootFolderButton.click(); @@ -154,13 +154,13 @@ describe('TreeViewComponent', () => { })); it('should show the subfolders of a subfolder if there are any', async(() => { - let rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); + const rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); expect(rootFolderButton).not.toBeNull(); rootFolderButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { expect(element.querySelector('#fake-second-name-tree-child-node')).not.toBeNull(); - let childButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-second-name'); + const childButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-second-name'); expect(childButton).not.toBeNull(); childButton.click(); fixture.detectChanges(); @@ -172,7 +172,7 @@ describe('TreeViewComponent', () => { })); it('should hide the subfolders when clicked again', async(() => { - let rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); + const rootFolderButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#button-fake-node-name'); expect(rootFolderButton).not.toBeNull(); rootFolderButton.click(); fixture.detectChanges(); diff --git a/lib/content-services/tree-view/services/tree-view.service.spec.ts b/lib/content-services/tree-view/services/tree-view.service.spec.ts index 85e2dd7cd8..863f93f636 100644 --- a/lib/content-services/tree-view/services/tree-view.service.spec.ts +++ b/lib/content-services/tree-view/services/tree-view.service.spec.ts @@ -27,11 +27,11 @@ describe('TreeViewService', () => { let service: TreeViewService; let nodeService: NodesApiService; - let fakeNodeList = { list: { entries: [ + const fakeNodeList = { list: { entries: [ { entry: { id: 'fake-node-id', name: 'fake-node-name', isFolder: true } } ] } }; - let fakeMixedNodeList = { list: { entries: [ + const fakeMixedNodeList = { list: { entries: [ { entry: { id: 'fake-node-id', name: 'fake-node-name', isFolder: true } }, { entry: { id: 'fake-file-id', name: 'fake-file-name', isFolder: false } } ] } }; diff --git a/lib/content-services/upload/components/base-upload/upload-base.ts b/lib/content-services/upload/components/base-upload/upload-base.ts index 71e67ce144..737bc077c4 100644 --- a/lib/content-services/upload/components/base-upload/upload-base.ts +++ b/lib/content-services/upload/components/base-upload/upload-base.ts @@ -116,7 +116,7 @@ export abstract class UploadBase implements OnInit, OnDestroy { } private uploadQueue(files: FileModel[]) { - let filteredFiles = files + const filteredFiles = files .filter(this.isFileAcceptable.bind(this)) .filter(this.isFileSizeAcceptable.bind(this)); diff --git a/lib/content-services/upload/components/file-uploading-dialog.component.ts b/lib/content-services/upload/components/file-uploading-dialog.component.ts index 69d3b35a12..3542806280 100644 --- a/lib/content-services/upload/components/file-uploading-dialog.component.ts +++ b/lib/content-services/upload/components/file-uploading-dialog.component.ts @@ -88,7 +88,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy { this.uploadService.fileDeleted.subscribe((objId) => { if (this.filesUploadingList) { - let file = this.filesUploadingList.find((item) => { + const file = this.filesUploadingList.find((item) => { return item.data.entry.id === objId; }); if (file) { diff --git a/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts b/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts index 20462505e1..97460b2e79 100644 --- a/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts +++ b/lib/content-services/upload/components/file-uploading-list-row.component.spec.ts @@ -23,7 +23,7 @@ import { FileUploadingListRowComponent } from './file-uploading-list-row.compone describe('FileUploadingListRowComponent', () => { let fixture: ComponentFixture<FileUploadingListRowComponent>; let component: FileUploadingListRowComponent; - let file = new FileModel(<File> { name: 'fake-name' }); + const file = new FileModel(<File> { name: 'fake-name' }); beforeEach(() => { TestBed.configureTestingModule({ diff --git a/lib/content-services/upload/components/upload-button.component.spec.ts b/lib/content-services/upload/components/upload-button.component.spec.ts index 8d15a2e816..fbb35d6433 100644 --- a/lib/content-services/upload/components/upload-button.component.spec.ts +++ b/lib/content-services/upload/components/upload-button.component.spec.ts @@ -26,15 +26,15 @@ import { NodeEntry } from '@alfresco/js-api'; describe('UploadButtonComponent', () => { - let file = { name: 'fake-name-1', size: 10, webkitRelativePath: 'fake-folder1/fake-name-1.json' }; - let fakeEvent = { + const file = { name: 'fake-name-1', size: 10, webkitRelativePath: 'fake-folder1/fake-name-1.json' }; + const fakeEvent = { currentTarget: { files: [file] }, target: { value: 'fake-name-1' } }; - let fakeFolderNodeWithPermission = new NodeEntry({ + const fakeFolderNodeWithPermission = new NodeEntry({ entry: { allowableOperations: [ 'create', @@ -82,21 +82,21 @@ describe('UploadButtonComponent', () => { it('should render upload-single-file button as default', () => { component.multipleFiles = false; - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; fixture.detectChanges(); expect(compiled.querySelector('#upload-single-file')).toBeDefined(); }); it('should render upload-multiple-file button if multipleFiles is true', () => { component.multipleFiles = true; - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; fixture.detectChanges(); expect(compiled.querySelector('#upload-multiple-files')).toBeDefined(); }); it('should render an uploadFolder button if uploadFolder is true', () => { component.uploadFolders = true; - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; fixture.detectChanges(); expect(compiled.querySelector('#uploadFolder')).toBeDefined(); }); @@ -104,7 +104,7 @@ describe('UploadButtonComponent', () => { it('should disable uploadFolder button if disabled is true', () => { component.disabled = true; component.uploadFolders = true; - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; fixture.detectChanges(); expect(compiled.querySelector('#uploadFolder').getAttribute('disabled')).toBe('true'); }); @@ -112,7 +112,7 @@ describe('UploadButtonComponent', () => { it('should disable upload-single-file button if disabled is true', () => { component.disabled = true; component.multipleFiles = false; - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; fixture.detectChanges(); expect(compiled.querySelector('#upload-single-file').getAttribute('disabled')).toBe('true'); }); @@ -182,7 +182,7 @@ describe('UploadButtonComponent', () => { }); it('should by default the title of the button get from the JSON file', () => { - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; fixture.detectChanges(); component.uploadFolders = false; component.multipleFiles = false; @@ -199,7 +199,7 @@ describe('UploadButtonComponent', () => { }); it('should staticTitle properties change the title of the upload buttons', () => { - let compiled = fixture.debugElement.nativeElement; + const compiled = fixture.debugElement.nativeElement; component.staticTitle = 'test-text'; component.uploadFolders = false; component.multipleFiles = false; diff --git a/lib/content-services/upload/components/upload-button.component.ts b/lib/content-services/upload/components/upload-button.component.ts index 1b1244b162..8159eb6658 100644 --- a/lib/content-services/upload/components/upload-button.component.ts +++ b/lib/content-services/upload/components/upload-button.component.ts @@ -78,7 +78,7 @@ export class UploadButtonComponent extends UploadBase implements OnInit, OnChang } ngOnChanges(changes: SimpleChanges) { - let rootFolderId = changes['rootFolderId']; + const rootFolderId = changes['rootFolderId']; if (rootFolderId && rootFolderId.currentValue) { this.checkPermission(); } @@ -89,7 +89,7 @@ export class UploadButtonComponent extends UploadBase implements OnInit, OnChang } onFilesAdded($event: any): void { - let files: File[] = FileUtils.toFileArray($event.currentTarget.files); + const files: File[] = FileUtils.toFileArray($event.currentTarget.files); if (this.hasAllowableOperations) { this.uploadFiles(files); @@ -102,7 +102,7 @@ export class UploadButtonComponent extends UploadBase implements OnInit, OnChang onDirectoryAdded($event: any): void { if (this.hasAllowableOperations) { - let files: File[] = FileUtils.toFileArray($event.currentTarget.files); + const files: File[] = FileUtils.toFileArray($event.currentTarget.files); this.uploadFiles(files); } else { this.permissionEvent.emit(new PermissionModel({ type: 'content', action: 'upload', permission: 'create' })); @@ -113,7 +113,7 @@ export class UploadButtonComponent extends UploadBase implements OnInit, OnChang checkPermission() { if (this.rootFolderId) { - let opts: any = { + const opts: any = { includeSource: true, include: ['allowableOperations'] }; diff --git a/lib/content-services/upload/components/upload-drag-area.component.spec.ts b/lib/content-services/upload/components/upload-drag-area.component.spec.ts index 7e6a958221..2a67c93c6e 100644 --- a/lib/content-services/upload/components/upload-drag-area.component.spec.ts +++ b/lib/content-services/upload/components/upload-drag-area.component.spec.ts @@ -163,7 +163,7 @@ describe('UploadDragAreaComponent', () => { spyOn(uploadService, 'uploadFilesInTheQueue'); fixture.detectChanges(); - let itemEntity = { + const itemEntity = { isDirectory: true, createReader: () => { return { @@ -187,20 +187,20 @@ describe('UploadDragAreaComponent', () => { spyOn(uploadService, 'addToQueue'); spyOn(uploadService, 'uploadFilesInTheQueue'); - let fakeItem = { + const fakeItem = { fullPath: '/folder-fake/file-fake.png', isDirectory: false, isFile: true, relativeFolder: '/', name: 'file-fake.png', file: (callbackFile) => { - let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); + const fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); callbackFile(fileFake); } }; fixture.detectChanges(); - let fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { + const fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { detail: { data: getFakeShareDataRow([]), files: [fakeItem] } }); component.onUploadFiles(fakeCustomEvent); @@ -288,19 +288,19 @@ describe('UploadDragAreaComponent', () => { })); it('should upload a file when user has create permission on target folder', async(() => { - let fakeItem = { + const fakeItem = { fullPath: '/folder-fake/file-fake.png', isDirectory: false, isFile: true, name: 'file-fake.png', relativeFolder: '/', file: (callbackFile) => { - let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); + const fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); callbackFile(fileFake); } }; - let fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { + const fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { detail: { data: getFakeShareDataRow(), files: [fakeItem] @@ -313,14 +313,14 @@ describe('UploadDragAreaComponent', () => { it('should upload a file to a specific target folder when dropped onto one', async(() => { - let fakeItem = { + const fakeItem = { fullPath: '/folder-fake/file-fake.png', isDirectory: false, isFile: true, name: 'file-fake.png', relativeFolder: '/', file: (callbackFile) => { - let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); + const fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); callbackFile(fileFake); } }; @@ -330,7 +330,7 @@ describe('UploadDragAreaComponent', () => { expect(fileList.options.path).toBe('pippo/'); }); - let fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { + const fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { detail: { data: getFakeShareDataRow(), files: [fakeItem] @@ -342,14 +342,14 @@ describe('UploadDragAreaComponent', () => { it('should upload a folder to a specific target folder when dropped onto one', async(() => { - let fakeItem = { + const fakeItem = { fullPath: '/folder-fake/file-fake.png', isDirectory: false, isFile: true, name: 'file-fake.png', relativeFolder: '/super', file: (callbackFile) => { - let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); + const fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); callbackFile(fileFake); } }; @@ -359,7 +359,7 @@ describe('UploadDragAreaComponent', () => { expect(fileList.options.path).toBe('pippo/super'); }); - let fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { + const fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { detail: { data: getFakeShareDataRow(), files: [fakeItem] @@ -371,14 +371,14 @@ describe('UploadDragAreaComponent', () => { it('should upload the file in the current folder when the target is file', async(() => { - let fakeItem = { + const fakeItem = { fullPath: '/folder-fake/file-fake.png', isDirectory: false, isFile: true, name: 'file-fake.png', relativeFolder: '/', file: (callbackFile) => { - let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); + const fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); callbackFile(fileFake); } }; @@ -388,7 +388,7 @@ describe('UploadDragAreaComponent', () => { expect(fileList.options.path).toBe('/'); }); - let fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { + const fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { detail: { data: getFakeFileShareRow(), files: [fakeItem] @@ -404,14 +404,14 @@ describe('UploadDragAreaComponent', () => { it('should raise an error if upload a file goes wrong', (done) => { spyOn(uploadService, 'getUploadPromise').and.callThrough(); - let fakeItem = { + const fakeItem = { fullPath: '/folder-fake/file-fake.png', isDirectory: false, isFile: true, relativeFolder: '/', name: 'file-fake.png', file: (callbackFile) => { - let fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); + const fileFake = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); callbackFile(fileFake); } }; @@ -424,7 +424,7 @@ describe('UploadDragAreaComponent', () => { done(); }); - let fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { + const fakeCustomEvent: CustomEvent = new CustomEvent('CustomEvent', { detail: { data: getFakeShareDataRow(), files: [fakeItem] diff --git a/lib/content-services/upload/components/upload-drag-area.component.ts b/lib/content-services/upload/components/upload-drag-area.component.ts index 1010505009..ab95aa0a17 100644 --- a/lib/content-services/upload/components/upload-drag-area.component.ts +++ b/lib/content-services/upload/components/upload-drag-area.component.ts @@ -94,9 +94,9 @@ export class UploadDragAreaComponent extends UploadBase implements NodeAllowable onUploadFiles(event: CustomEvent) { event.stopPropagation(); event.preventDefault(); - let isAllowed: boolean = this.contentService.hasAllowableOperations(event.detail.data.obj.entry, AllowableOperationsEnum.CREATE); + const isAllowed: boolean = this.contentService.hasAllowableOperations(event.detail.data.obj.entry, AllowableOperationsEnum.CREATE); if (isAllowed) { - let fileInfo: FileInfo[] = event.detail.files; + const fileInfo: FileInfo[] = event.detail.files; if (this.isTargetNodeFolder(event)) { const destinationFolderName = event.detail.data.obj.entry.name; fileInfo.map((file) => file.relativeFolder = destinationFolderName ? destinationFolderName.concat(file.relativeFolder) : file.relativeFolder); diff --git a/lib/content-services/upload/directives/file-draggable.directive.spec.ts b/lib/content-services/upload/directives/file-draggable.directive.spec.ts index 18a2712e98..5420bc6ae6 100644 --- a/lib/content-services/upload/directives/file-draggable.directive.spec.ts +++ b/lib/content-services/upload/directives/file-draggable.directive.spec.ts @@ -23,7 +23,7 @@ describe('FileDraggableDirective', () => { let component: FileDraggableDirective; beforeEach( () => { - let el = new ElementRef(null); + const el = new ElementRef(null); component = new FileDraggableDirective(el, null); }); @@ -33,7 +33,7 @@ describe('FileDraggableDirective', () => { it('should not allow drag and drop when disabled', () => { component.enabled = false; - let event = new CustomEvent('custom-event'); + const event = new CustomEvent('custom-event'); spyOn(event, 'preventDefault').and.stub(); component.onDropFiles(event); component.onDragEnter(event); diff --git a/lib/content-services/version-manager/version-list.component.spec.ts b/lib/content-services/version-manager/version-list.component.spec.ts index 4984ef09eb..08350edfa4 100644 --- a/lib/content-services/version-manager/version-list.component.spec.ts +++ b/lib/content-services/version-manager/version-list.component.spec.ts @@ -176,9 +176,9 @@ describe('VersionListComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let versionFileName = fixture.debugElement.query(By.css('.adf-version-list-item-name')).nativeElement.innerText; - let versionIdText = fixture.debugElement.query(By.css('.adf-version-list-item-version')).nativeElement.innerText; - let versionComment = fixture.debugElement.query(By.css('.adf-version-list-item-comment')).nativeElement.innerText; + const versionFileName = fixture.debugElement.query(By.css('.adf-version-list-item-name')).nativeElement.innerText; + const versionIdText = fixture.debugElement.query(By.css('.adf-version-list-item-version')).nativeElement.innerText; + const versionComment = fixture.debugElement.query(By.css('.adf-version-list-item-comment')).nativeElement.innerText; expect(versionFileName).toBe('test-file-name'); expect(versionIdText).toBe('1.0'); @@ -208,7 +208,7 @@ describe('VersionListComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let versionCommentEl = fixture.debugElement.query(By.css('.adf-version-list-item-comment')); + const versionCommentEl = fixture.debugElement.query(By.css('.adf-version-list-item-comment')); expect(versionCommentEl).toBeNull(); done(); @@ -332,7 +332,7 @@ describe('VersionListComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.0"]'); + const menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.0"]'); expect(menuButton).not.toBeNull(); done(); @@ -345,7 +345,7 @@ describe('VersionListComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.0"]'); + const menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.0"]'); expect(menuButton).toBeNull(); done(); @@ -379,10 +379,10 @@ describe('VersionListComponent', () => { it('should disable delete action if is not allowed', (done) => { fixture.whenStable().then(() => { fixture.detectChanges(); - let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); + const menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); menuButton.click(); - let deleteButton: any = document.querySelector('[id="adf-version-list-action-delete-1.1"]'); + const deleteButton: any = document.querySelector('[id="adf-version-list-action-delete-1.1"]'); expect(deleteButton.disabled).toBe(true); done(); @@ -392,10 +392,10 @@ describe('VersionListComponent', () => { it('should disable restore action if is not allowed', (done) => { fixture.whenStable().then(() => { fixture.detectChanges(); - let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); + const menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); menuButton.click(); - let restoreButton: any = document.querySelector('[id="adf-version-list-action-restore-1.1"]'); + const restoreButton: any = document.querySelector('[id="adf-version-list-action-restore-1.1"]'); expect(restoreButton.disabled).toBe(true); done(); @@ -429,10 +429,10 @@ describe('VersionListComponent', () => { it('should enable delete action if is allowed', (done) => { fixture.whenStable().then(() => { fixture.detectChanges(); - let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); + const menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); menuButton.click(); - let deleteButton: any = document.querySelector('[id="adf-version-list-action-delete-1.1"]'); + const deleteButton: any = document.querySelector('[id="adf-version-list-action-delete-1.1"]'); expect(deleteButton.disabled).toBe(false); done(); @@ -442,10 +442,10 @@ describe('VersionListComponent', () => { it('should enable restore action if is allowed', (done) => { fixture.whenStable().then(() => { fixture.detectChanges(); - let menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); + const menuButton = fixture.nativeElement.querySelector('[id="adf-version-list-action-menu-button-1.1"]'); menuButton.click(); - let restoreButton: any = document.querySelector('[id="adf-version-list-action-restore-1.1"]'); + const restoreButton: any = document.querySelector('[id="adf-version-list-action-restore-1.1"]'); expect(restoreButton.disabled).toBe(false); done(); diff --git a/lib/content-services/version-manager/version-manager.component.spec.ts b/lib/content-services/version-manager/version-manager.component.spec.ts index 8aeacef8e9..1d25d7a64a 100644 --- a/lib/content-services/version-manager/version-manager.component.spec.ts +++ b/lib/content-services/version-manager/version-manager.component.spec.ts @@ -78,7 +78,7 @@ describe('VersionManagerComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let versionCommentEl = fixture.debugElement.query(By.css('.adf-version-list-item-comment')); + const versionCommentEl = fixture.debugElement.query(By.css('.adf-version-list-item-comment')); expect(versionCommentEl).not.toBeNull(); expect(versionCommentEl.nativeElement.innerText).toBe(expectedComment); @@ -91,7 +91,7 @@ describe('VersionManagerComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let versionCommentEl = fixture.debugElement.query(By.css('.adf-version-list-item-comment')); + const versionCommentEl = fixture.debugElement.query(By.css('.adf-version-list-item-comment')); expect(versionCommentEl).toBeNull(); }); @@ -128,7 +128,7 @@ describe('VersionManagerComponent', () => { it('should upload button be visible after click on add new version button', () => { fixture.detectChanges(); - let showUploadButton = fixture.debugElement.query(By.css('#adf-show-version-upload-button')); + const showUploadButton = fixture.debugElement.query(By.css('#adf-show-version-upload-button')); showUploadButton.nativeElement.click(); diff --git a/lib/content-services/webscript/webscript.component.spec.ts b/lib/content-services/webscript/webscript.component.spec.ts index 6385c6a67e..ad19f6b8a4 100644 --- a/lib/content-services/webscript/webscript.component.spec.ts +++ b/lib/content-services/webscript/webscript.component.spec.ts @@ -37,7 +37,7 @@ describe('WebscriptComponent', () => { }); beforeEach(async(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; fixture = TestBed.createComponent(WebscriptComponent); @@ -162,7 +162,7 @@ describe('WebscriptComponent', () => { done(); }); - let dataTable = { + const dataTable = { data: [ {id: 1, name: 'Name 1'}, {id: 2, name: 'Name 2'} @@ -200,7 +200,7 @@ describe('WebscriptComponent', () => { done(); }); - let dataTable = { + const dataTable = { data: [ {id: 1, name: 'Name 1'}, {id: 2, name: 'Name 2'} diff --git a/lib/content-services/webscript/webscript.component.ts b/lib/content-services/webscript/webscript.component.ts index 3dfe87d760..e8c396f5e7 100644 --- a/lib/content-services/webscript/webscript.component.ts +++ b/lib/content-services/webscript/webscript.component.ts @@ -119,7 +119,7 @@ export class WebscriptComponent implements OnChanges { * @returns the data as datatable */ showDataAsDataTable(data: any) { - let datatableData: any = null; + const datatableData: any = null; try { if (!data.schema) { diff --git a/lib/core/buttons-menu/buttons-menu.component.spec.ts b/lib/core/buttons-menu/buttons-menu.component.spec.ts index e83a05a8e2..aa5784018d 100644 --- a/lib/core/buttons-menu/buttons-menu.component.spec.ts +++ b/lib/core/buttons-menu/buttons-menu.component.spec.ts @@ -92,7 +92,7 @@ describe('ButtonsMenuComponent', () => { it('should trigger event when a specific button is clicked', async(() => { expect(component.value).toBeUndefined(); - let button = element.querySelector('button'); + const button = element.querySelector('button'); button.click(); fixture.detectChanges(); fixture.whenStable().then(() => { diff --git a/lib/core/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts b/lib/core/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts index 847d674fac..f97b6ac4c7 100644 --- a/lib/core/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts +++ b/lib/core/card-view/components/card-view-boolitem/card-view-boolitem.component.spec.ts @@ -56,11 +56,11 @@ describe('CardViewBoolItemComponent', () => { component.property.editable = true; fixture.detectChanges(); - let label = fixture.debugElement.query(By.css('.adf-property-label')); + const label = fixture.debugElement.query(By.css('.adf-property-label')); expect(label).not.toBeNull(); expect(label.nativeElement.innerText).toBe('Boolean label'); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); }); @@ -70,10 +70,10 @@ describe('CardViewBoolItemComponent', () => { component.property.editable = false; fixture.detectChanges(); - let label = fixture.debugElement.query(By.css('.adf-property-label')); + const label = fixture.debugElement.query(By.css('.adf-property-label')); expect(label).toBeNull(); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).toBeNull(); }); @@ -83,10 +83,10 @@ describe('CardViewBoolItemComponent', () => { component.property.editable = false; fixture.detectChanges(); - let label = fixture.debugElement.query(By.css('.adf-property-label')); + const label = fixture.debugElement.query(By.css('.adf-property-label')); expect(label).not.toBeNull(); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); }); @@ -94,7 +94,7 @@ describe('CardViewBoolItemComponent', () => { component.property.value = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); expect(value).not.toBeNull(); expect(value.nativeElement.checked).toBe(true); }); @@ -106,7 +106,7 @@ describe('CardViewBoolItemComponent', () => { component.property.default = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); expect(value).not.toBeNull(); expect(value.nativeElement.checked).toBe(true); }); @@ -115,7 +115,7 @@ describe('CardViewBoolItemComponent', () => { component.property.value = false; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); expect(value).not.toBeNull(); expect(value.nativeElement.checked).toBe(false); }); @@ -127,7 +127,7 @@ describe('CardViewBoolItemComponent', () => { component.property.default = false; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); expect(value).not.toBeNull(); expect(value.nativeElement.checked).toBe(false); }); @@ -138,7 +138,7 @@ describe('CardViewBoolItemComponent', () => { component.property.value = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); expect(value).not.toBeNull(); expect(value.nativeElement.hasAttribute('disabled')).toBe(false); }); @@ -149,7 +149,7 @@ describe('CardViewBoolItemComponent', () => { component.property.value = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); expect(value).not.toBeNull(); expect(value.nativeElement.hasAttribute('disabled')).toBe(true); }); @@ -160,7 +160,7 @@ describe('CardViewBoolItemComponent', () => { component.property.value = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value input[type="checkbox"]')); expect(value).not.toBeNull(); expect(value.nativeElement.hasAttribute('disabled')).toBe(true); }); @@ -199,7 +199,7 @@ describe('CardViewBoolItemComponent', () => { component.property.value = false; fixture.detectChanges(); - let disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe( + const disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe( (updateNotification) => { expect(updateNotification.target).toBe(component.property); expect(updateNotification.changed).toEqual({ boolkey: true }); diff --git a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts index 8ebe92cf5d..79610ec324 100644 --- a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts +++ b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.spec.ts @@ -53,11 +53,11 @@ describe('CardViewDateItemComponent', () => { it('should render the label and value', () => { fixture.detectChanges(); - let labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('Date label'); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('Jul 10 2017'); }); @@ -75,7 +75,7 @@ describe('CardViewDateItemComponent', () => { component.displayEmpty = false; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe(''); }); @@ -93,7 +93,7 @@ describe('CardViewDateItemComponent', () => { component.displayEmpty = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY'); }); @@ -110,7 +110,7 @@ describe('CardViewDateItemComponent', () => { component.editable = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY'); }); @@ -120,7 +120,7 @@ describe('CardViewDateItemComponent', () => { component.property.editable = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('Jul 10 2017'); }); @@ -130,8 +130,8 @@ describe('CardViewDateItemComponent', () => { component.property.editable = true; fixture.detectChanges(); - let datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-${component.property.key}"]`)); - let datePickerToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepickertoggle-${component.property.key}"]`)); + const datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-${component.property.key}"]`)); + const datePickerToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepickertoggle-${component.property.key}"]`)); expect(datePicker).not.toBeNull('Datepicker should be in DOM'); expect(datePickerToggle).not.toBeNull('Datepicker toggle should be shown'); }); @@ -140,8 +140,8 @@ describe('CardViewDateItemComponent', () => { component.property.editable = false; fixture.detectChanges(); - let datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-${component.property.key}"]`)); - let datePickerToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepickertoggle-${component.property.key}"]`)); + const datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-${component.property.key}"]`)); + const datePickerToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepickertoggle-${component.property.key}"]`)); expect(datePicker).toBeNull('Datepicker should NOT be in DOM'); expect(datePickerToggle).toBeNull('Datepicker toggle should NOT be shown'); }); @@ -151,8 +151,8 @@ describe('CardViewDateItemComponent', () => { component.property.editable = true; fixture.detectChanges(); - let datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-${component.property.key}"]`)); - let datePickerToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepickertoggle-${component.property.key}"]`)); + const datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-${component.property.key}"]`)); + const datePickerToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepickertoggle-${component.property.key}"]`)); expect(datePicker).toBeNull('Datepicker should NOT be in DOM'); expect(datePickerToggle).toBeNull('Datepicker toggle should NOT be shown'); }); @@ -163,7 +163,7 @@ describe('CardViewDateItemComponent', () => { fixture.detectChanges(); spyOn(component.datepicker, 'open'); - let datePickerLabelToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-label-toggle-${component.property.key}"]`)); + const datePickerLabelToggle = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-label-toggle-${component.property.key}"]`)); datePickerLabelToggle.triggerEventHandler('click', {}); expect(component.datepicker.open).toHaveBeenCalled(); @@ -176,7 +176,7 @@ describe('CardViewDateItemComponent', () => { const expectedDate = moment('Jul 10 2017', 'MMM DD YY'); fixture.detectChanges(); - let disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe( + const disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe( (updateNotification) => { expect(updateNotification.target).toBe(component.property); expect(updateNotification.changed).toEqual({ dateKey: expectedDate.toDate() }); diff --git a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts index c8560a0b6b..33174b3737 100644 --- a/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts +++ b/lib/core/card-view/components/card-view-dateitem/card-view-dateitem.component.ts @@ -87,7 +87,7 @@ export class CardViewDateItemComponent implements OnInit { onDateChanged(newDateValue) { if (newDateValue) { - let momentDate = moment(newDateValue.value, this.SHOW_FORMAT, true); + const momentDate = moment(newDateValue.value, this.SHOW_FORMAT, true); if (momentDate.isValid()) { this.valueDate = momentDate; this.cardViewUpdateService.update(this.property, momentDate.toDate()); diff --git a/lib/core/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.spec.ts b/lib/core/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.spec.ts index 7bcdc3e7da..c68a73dac7 100644 --- a/lib/core/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.spec.ts +++ b/lib/core/card-view/components/card-view-keyvaluepairsitem/card-view-keyvaluepairsitem.component.spec.ts @@ -92,8 +92,8 @@ describe('CardViewKeyValuePairsItemComponent', () => { const content = fixture.debugElement.query(By.css('.adf-card-view__key-value-pairs')); expect(content).not.toBeNull(); - let nameInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-name-input-0"]`)); - let valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`)); + const nameInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-name-input-0"]`)); + const valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`)); expect(nameInput).not.toBeNull(); expect(valueInput).not.toBeNull(); @@ -129,8 +129,8 @@ describe('CardViewKeyValuePairsItemComponent', () => { addButton.triggerEventHandler('click', null); fixture.detectChanges(); - let nameInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-name-input-0"]`)); - let valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`)); + const nameInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-name-input-0"]`)); + const valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`)); nameInput.nativeElement.value = mockData[0].name; nameInput.nativeElement.dispatchEvent(new Event('input')); @@ -157,7 +157,7 @@ describe('CardViewKeyValuePairsItemComponent', () => { addButton.triggerEventHandler('click', null); fixture.detectChanges(); - let valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`)); + const valueInput = fixture.debugElement.query(By.css(`[data-automation-id="card-${component.property.key}-value-input-0"]`)); valueInput.nativeElement.value = mockData[0].value; valueInput.nativeElement.dispatchEvent(new Event('input')); diff --git a/lib/core/card-view/components/card-view-mapitem/card-view-mapitem.component.spec.ts b/lib/core/card-view/components/card-view-mapitem/card-view-mapitem.component.spec.ts index 0d2cea634c..d730457272 100644 --- a/lib/core/card-view/components/card-view-mapitem/card-view-mapitem.component.spec.ts +++ b/lib/core/card-view/components/card-view-mapitem/card-view-mapitem.component.spec.ts @@ -59,11 +59,11 @@ describe('CardViewMapItemComponent', () => { component.displayEmpty = true; fixture.detectChanges(); - let labelValue = debug.query(By.css('.adf-property-label')); + const labelValue = debug.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('Map label'); - let value = debug.query(By.css(`[data-automation-id="card-mapitem-value-${component.property.key}"]`)); + const value = debug.query(By.css(`[data-automation-id="card-mapitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('Fake default'); }); @@ -79,10 +79,10 @@ describe('CardViewMapItemComponent', () => { component.displayEmpty = false; fixture.detectChanges(); - let labelValue = debug.query(By.css('.adf-property-label')); + const labelValue = debug.query(By.css('.adf-property-label')); expect(labelValue).toBeNull(); - let value = debug.query(By.css(`[data-automation-id="card-mapitem-value-${component.property.key}"]`)); + const value = debug.query(By.css(`[data-automation-id="card-mapitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe(''); }); @@ -97,11 +97,11 @@ describe('CardViewMapItemComponent', () => { fixture.detectChanges(); - let labelValue = debug.query(By.css('.adf-property-label')); + const labelValue = debug.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('Map label'); - let value = debug.query(By.css(`[data-automation-id="card-mapitem-value-${component.property.key}"]`)); + const value = debug.query(By.css(`[data-automation-id="card-mapitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('fakeProcessName'); }); @@ -116,9 +116,9 @@ describe('CardViewMapItemComponent', () => { }); fixture.detectChanges(); - let value: any = element.querySelector('.adf-mapitem-clickable-value'); + const value: any = element.querySelector('.adf-mapitem-clickable-value'); - let disposableUpdate = service.itemClicked$.subscribe((response) => { + const disposableUpdate = service.itemClicked$.subscribe((response) => { expect(response.target).not.toBeNull(); expect(response.target.type).toEqual('map'); expect(response.target.clickable).toBeTruthy(); diff --git a/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts b/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts index 2d1a5153e4..598aff93ff 100644 --- a/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts +++ b/lib/core/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts @@ -53,11 +53,11 @@ describe('CardViewTextItemComponent', () => { it('should render the label and value', () => { fixture.detectChanges(); - let labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('Text label'); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('Lorem ipsum'); }); @@ -73,7 +73,7 @@ describe('CardViewTextItemComponent', () => { component.displayEmpty = false; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe(''); }); @@ -89,7 +89,7 @@ describe('CardViewTextItemComponent', () => { component.displayEmpty = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY'); }); @@ -105,7 +105,7 @@ describe('CardViewTextItemComponent', () => { component.editable = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY'); }); @@ -121,7 +121,7 @@ describe('CardViewTextItemComponent', () => { component.displayEmpty = false; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe(''); }); @@ -137,7 +137,7 @@ describe('CardViewTextItemComponent', () => { component.displayEmpty = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY'); }); @@ -152,7 +152,7 @@ describe('CardViewTextItemComponent', () => { }); fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('FAKE-DEFAULT-KEY'); }); @@ -168,7 +168,7 @@ describe('CardViewTextItemComponent', () => { }); fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('FAKE-ICON'); }); @@ -183,7 +183,7 @@ describe('CardViewTextItemComponent', () => { }); fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`)); expect(value).toBeNull('Edit icon should NOT be shown'); }); @@ -198,7 +198,7 @@ describe('CardViewTextItemComponent', () => { }); fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.icon}"]`)); expect(value).toBeNull('Edit icon should NOT be shown'); }); @@ -207,7 +207,7 @@ describe('CardViewTextItemComponent', () => { component.property.editable = true; fixture.detectChanges(); - let value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); + const value = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${component.property.key}"]`)); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('Lorem ipsum'); }); @@ -217,7 +217,7 @@ describe('CardViewTextItemComponent', () => { component.property.editable = true; fixture.detectChanges(); - let editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.key}"]`)); + const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.key}"]`)); expect(editIcon).not.toBeNull('Edit icon should be shown'); }); @@ -225,7 +225,7 @@ describe('CardViewTextItemComponent', () => { component.editable = false; fixture.detectChanges(); - let editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.key}"]`)); + const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.key}"]`)); expect(editIcon).toBeNull('Edit icon should NOT be shown'); }); @@ -234,7 +234,7 @@ describe('CardViewTextItemComponent', () => { component.property.editable = true; fixture.detectChanges(); - let editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.key}"]`)); + const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-${component.property.key}"]`)); expect(editIcon).toBeNull('Edit icon should NOT be shown'); }); }); @@ -314,7 +314,7 @@ describe('CardViewTextItemComponent', () => { const expectedText = 'changed text'; fixture.detectChanges(); - let disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe( + const disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe( (updateNotification) => { expect(updateNotification.target).toBe(component.property); expect(updateNotification.changed).toEqual({ textkey: expectedText }); @@ -323,16 +323,16 @@ describe('CardViewTextItemComponent', () => { } ); - let editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-toggle-${component.property.key}"]`)); + const editIcon = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-toggle-${component.property.key}"]`)); editIcon.triggerEventHandler('click', null); fixture.detectChanges(); - let editInput = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-editinput-${component.property.key}"]`)); + const editInput = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-editinput-${component.property.key}"]`)); editInput.nativeElement.value = expectedText; editInput.nativeElement.dispatchEvent(new Event('input')); fixture.detectChanges(); - let updateInput = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-update-${component.property.key}"]`)); + const updateInput = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-update-${component.property.key}"]`)); updateInput.triggerEventHandler('click', null); }); }); diff --git a/lib/core/card-view/components/card-view/card-view.component.spec.ts b/lib/core/card-view/components/card-view/card-view.component.spec.ts index 8c8760b2d7..dd7517b0cb 100644 --- a/lib/core/card-view/components/card-view/card-view.component.spec.ts +++ b/lib/core/card-view/components/card-view/card-view.component.spec.ts @@ -47,11 +47,11 @@ describe('CardViewComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('My label'); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText).toBe('My value'); }); @@ -68,7 +68,7 @@ describe('CardViewComponent', () => { fixture.detectChanges(); - let datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-some-key"]`)); + const datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-some-key"]`)); expect(datePicker).not.toBeNull('Datepicker should be in DOM'); }); @@ -81,11 +81,11 @@ describe('CardViewComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('My date label'); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText).toBe('Jun 14 2017'); }); @@ -106,10 +106,10 @@ describe('CardViewComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); expect(labelValue).toBeNull(); - let value = fixture.debugElement.query(By.css('.adf-property-value')); + const value = fixture.debugElement.query(By.css('.adf-property-value')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe(''); }); @@ -130,11 +130,11 @@ describe('CardViewComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('My default label'); - let value = fixture.debugElement.query(By.css('.adf-property-value [data-automation-id="card-textitem-value-some-key"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value [data-automation-id="card-textitem-value-some-key"]')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('default value'); }); @@ -155,11 +155,11 @@ describe('CardViewComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let labelValue = fixture.debugElement.query(By.css('.adf-property-label')); + const labelValue = fixture.debugElement.query(By.css('.adf-property-label')); expect(labelValue).not.toBeNull(); expect(labelValue.nativeElement.innerText).toBe('My default label'); - let value = fixture.debugElement.query(By.css('.adf-property-value [data-automation-id="card-textitem-value-some-key"]')); + const value = fixture.debugElement.query(By.css('.adf-property-value [data-automation-id="card-textitem-value-some-key"]')); expect(value).not.toBeNull(); expect(value.nativeElement.innerText.trim()).toBe('default value'); }); diff --git a/lib/core/comments/comment-list.component.spec.ts b/lib/core/comments/comment-list.component.spec.ts index ba300ec949..fd23166c78 100644 --- a/lib/core/comments/comment-list.component.spec.ts +++ b/lib/core/comments/comment-list.component.spec.ts @@ -144,28 +144,28 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let comment = fixture.debugElement.query(By.css('#adf-comment-1')); + const comment = fixture.debugElement.query(By.css('#adf-comment-1')); comment.triggerEventHandler('click', null); }); })); it('should deselect the previous selected comment when a new one is clicked', async(() => { processCommentOne.isSelected = true; - let commentOne = Object.assign({}, processCommentOne); - let commentTwo = Object.assign({}, processCommentTwo); + const commentOne = Object.assign({}, processCommentOne); + const commentTwo = Object.assign({}, processCommentTwo); commentList.selectedComment = commentOne; commentList.comments = [commentOne, commentTwo]; commentList.clickRow.subscribe((selectedComment) => { fixture.detectChanges(); - let commentSelectedList = fixture.nativeElement.querySelectorAll('.adf-is-selected'); + const commentSelectedList = fixture.nativeElement.querySelectorAll('.adf-is-selected'); expect(commentSelectedList.length).toBe(1); expect(commentSelectedList[0].textContent).toContain('2nd Test Comment'); }); fixture.detectChanges(); fixture.whenStable().then(() => { - let comment = fixture.debugElement.query(By.css('#adf-comment-2')); + const comment = fixture.debugElement.query(By.css('#adf-comment-2')); comment.triggerEventHandler('click', null); }); })); @@ -183,7 +183,7 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let elements = fixture.nativeElement.querySelectorAll('#comment-message'); + const elements = fixture.nativeElement.querySelectorAll('#comment-message'); expect(elements.length).toBe(1); expect(elements[0].innerText).toBe(processCommentOne.message); expect(fixture.nativeElement.querySelector('#comment-message:empty')).toBeNull(); @@ -195,7 +195,7 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let elements = fixture.nativeElement.querySelectorAll('#comment-user'); + const elements = fixture.nativeElement.querySelectorAll('#comment-user'); expect(elements.length).toBe(1); expect(elements[0].innerText).toBe(processCommentOne.createdBy.firstName + ' ' + processCommentOne.createdBy.lastName); expect(fixture.nativeElement.querySelector('#comment-user:empty')).toBeNull(); @@ -203,7 +203,7 @@ describe('CommentListComponent', () => { })); it('comment date time should start with few seconds ago when comment date is few seconds ago', async(() => { - let commentFewSecond = Object.assign({}, processCommentOne); + const commentFewSecond = Object.assign({}, processCommentOne); commentFewSecond.created = new Date(); commentList.comments = [commentFewSecond]; @@ -216,7 +216,7 @@ describe('CommentListComponent', () => { })); it('comment date time should start with Yesterday when comment date is yesterday', async(() => { - let commentOld = Object.assign({}, processCommentOne); + const commentOld = Object.assign({}, processCommentOne); commentOld.created = new Date((Date.now() - 24 * 3600 * 1000)); commentList.comments = [commentOld]; fixture.detectChanges(); @@ -228,7 +228,7 @@ describe('CommentListComponent', () => { })); it('comment date time should not start with Today/Yesterday when comment date is before yesterday', async(() => { - let commentOld = Object.assign({}, processCommentOne); + const commentOld = Object.assign({}, processCommentOne); commentOld.created = new Date((Date.now() - 24 * 3600 * 1000 * 2)); commentList.comments = [commentOld]; fixture.detectChanges(); @@ -245,7 +245,7 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let elements = fixture.nativeElement.querySelectorAll('#comment-user-icon'); + const elements = fixture.nativeElement.querySelectorAll('#comment-user-icon'); expect(elements.length).toBe(1); expect(elements[0].innerText).toContain(commentList.getUserShortName(processCommentOne.createdBy)); expect(fixture.nativeElement.querySelector('#comment-user-icon:empty')).toBeNull(); @@ -257,7 +257,7 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let elements = fixture.nativeElement.querySelectorAll('.adf-people-img'); + const elements = fixture.nativeElement.querySelectorAll('.adf-people-img'); expect(elements.length).toBe(1); expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('content-user-image'); }); @@ -268,7 +268,7 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let elements = fixture.nativeElement.querySelectorAll('.adf-people-img'); + const elements = fixture.nativeElement.querySelectorAll('.adf-people-img'); expect(elements.length).toBe(1); expect(fixture.nativeElement.getElementsByClassName('adf-people-img')[0].src).toContain('process-user-image'); }); @@ -279,7 +279,7 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let elements = fixture.nativeElement.querySelectorAll('.adf-comment-user-icon'); + const elements = fixture.nativeElement.querySelectorAll('.adf-comment-user-icon'); expect(elements.length).toBe(1); }); })); @@ -289,7 +289,7 @@ describe('CommentListComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let elements = fixture.nativeElement.querySelectorAll('.adf-comment-user-icon'); + const elements = fixture.nativeElement.querySelectorAll('.adf-comment-user-icon'); expect(elements.length).toBe(1); }); })); diff --git a/lib/core/comments/comments.component.spec.ts b/lib/core/comments/comments.component.spec.ts index 3bbd9baa8c..0267d63dac 100644 --- a/lib/core/comments/comments.component.spec.ts +++ b/lib/core/comments/comments.component.spec.ts @@ -77,24 +77,24 @@ describe('CommentsComponent', () => { }); it('should load comments when taskId specified', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); expect(getProcessCommentsSpy).toHaveBeenCalled(); }); it('should load comments when nodeId specified', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'nodeId': change}); expect(getContentCommentsSpy).toHaveBeenCalled(); }); it('should emit an error when an error occurs loading comments', () => { - let emitSpy = spyOn(component.error, 'emit'); + const emitSpy = spyOn(component.error, 'emit'); getProcessCommentsSpy.and.returnValue(throwError({})); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); expect(emitSpy).toHaveBeenCalled(); @@ -106,7 +106,7 @@ describe('CommentsComponent', () => { }); it('should display comments when the task has comments', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); fixture.whenStable().then(() => { @@ -117,11 +117,11 @@ describe('CommentsComponent', () => { })); it('should display comments count when the task has comments', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); fixture.whenStable().then(() => { fixture.detectChanges(); - let element = fixture.nativeElement.querySelector('#comment-header'); + const element = fixture.nativeElement.querySelector('#comment-header'); expect(element.innerText).toBe('COMMENTS.HEADER'); }); })); @@ -136,7 +136,7 @@ describe('CommentsComponent', () => { })); it('should display comments input by default', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); fixture.whenStable().then(() => { fixture.detectChanges(); @@ -155,8 +155,8 @@ describe('CommentsComponent', () => { describe('change detection taskId', () => { - let change = new SimpleChange('123', '456', true); - let nullChange = new SimpleChange('123', null, true); + const change = new SimpleChange('123', '456', true); + const nullChange = new SimpleChange('123', null, true); beforeEach(async(() => { component.taskId = '123'; @@ -184,8 +184,8 @@ describe('CommentsComponent', () => { describe('change detection node', () => { - let change = new SimpleChange('123', '456', true); - let nullChange = new SimpleChange('123', null, true); + const change = new SimpleChange('123', '456', true); + const nullChange = new SimpleChange('123', null, true); beforeEach(async(() => { component.nodeId = '123'; @@ -220,7 +220,7 @@ describe('CommentsComponent', () => { })); it('should sanitize comment when user input contains html elements', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = '<div class="text-class"><button onclick=""><h1>action</h1></button></div>'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -231,7 +231,7 @@ describe('CommentsComponent', () => { })); it('should normalize comment when user input contains spaces sequence', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = 'test comment'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -242,7 +242,7 @@ describe('CommentsComponent', () => { })); it('should add break lines to comment when user input contains new line characters', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = 'these\nare\nparagraphs\n'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -253,21 +253,21 @@ describe('CommentsComponent', () => { })); it('should call service to add a comment when add button is pressed', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = 'Test Comment'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); expect(addProcessCommentSpy).toHaveBeenCalled(); - let elements = fixture.nativeElement.querySelectorAll('#comment-message'); + const elements = fixture.nativeElement.querySelectorAll('#comment-message'); expect(elements.length).toBe(1); expect(elements[0].innerText).toBe('Test Comment'); }); })); it('should not call service to add a comment when comment is empty', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = ''; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -278,7 +278,7 @@ describe('CommentsComponent', () => { })); it('should clear comment when escape key is pressed', async(() => { - let event = new KeyboardEvent('keyup', {'key': 'Escape'}); + const event = new KeyboardEvent('keyup', {'key': 'Escape'}); let element = fixture.nativeElement.querySelector('#comment-input'); element.dispatchEvent(event); fixture.detectChanges(); @@ -290,7 +290,7 @@ describe('CommentsComponent', () => { })); it('should emit an error when an error occurs adding the comment', () => { - let emitSpy = spyOn(component.error, 'emit'); + const emitSpy = spyOn(component.error, 'emit'); addProcessCommentSpy.and.returnValue(throwError({})); component.message = 'Test comment'; component.add(); @@ -308,21 +308,21 @@ describe('CommentsComponent', () => { })); it('should call service to add a comment when add button is pressed', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = 'Test Comment'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); expect(addContentCommentSpy).toHaveBeenCalled(); - let elements = fixture.nativeElement.querySelectorAll('#comment-message'); + const elements = fixture.nativeElement.querySelectorAll('#comment-message'); expect(elements.length).toBe(1); expect(elements[0].innerText).toBe('Test Comment'); }); })); it('should sanitize comment when user input contains html elements', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = '<div class="text-class"><button onclick=""><h1>action</h1></button></div>'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -333,7 +333,7 @@ describe('CommentsComponent', () => { })); it('should normalize comment when user input contains spaces sequence', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = 'test comment'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -344,7 +344,7 @@ describe('CommentsComponent', () => { })); it('should add break lines to comment when user input contains new line characters', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = 'these\nare\nparagraphs\n'; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -355,7 +355,7 @@ describe('CommentsComponent', () => { })); it('should not call service to add a comment when comment is empty', async(() => { - let element = fixture.nativeElement.querySelector('.adf-comments-input-add'); + const element = fixture.nativeElement.querySelector('.adf-comments-input-add'); component.message = ''; element.dispatchEvent(new Event('click')); fixture.detectChanges(); @@ -366,7 +366,7 @@ describe('CommentsComponent', () => { })); it('should clear comment when escape key is pressed', async(() => { - let event = new KeyboardEvent('keyup', {'key': 'Escape'}); + const event = new KeyboardEvent('keyup', {'key': 'Escape'}); let element = fixture.nativeElement.querySelector('#comment-input'); element.dispatchEvent(event); fixture.detectChanges(); @@ -378,7 +378,7 @@ describe('CommentsComponent', () => { })); it('should emit an error when an error occurs adding the comment', () => { - let emitSpy = spyOn(component.error, 'emit'); + const emitSpy = spyOn(component.error, 'emit'); addContentCommentSpy.and.returnValue(throwError({})); component.message = 'Test comment'; component.add(); diff --git a/lib/core/comments/comments.component.ts b/lib/core/comments/comments.component.ts index dbe6da3492..9f1082a3ee 100644 --- a/lib/core/comments/comments.component.ts +++ b/lib/core/comments/comments.component.ts @@ -83,8 +83,8 @@ export class CommentsComponent implements OnChanges { (comments: CommentModel[]) => { if (comments && comments instanceof Array) { comments = comments.sort((comment1: CommentModel, comment2: CommentModel) => { - let date1 = new Date(comment1.created); - let date2 = new Date(comment2.created); + const date1 = new Date(comment1.created); + const date2 = new Date(comment2.created); return date1 > date2 ? -1 : date1 < date2 ? 1 : 0; }); comments.forEach((currentComment) => { diff --git a/lib/core/context-menu/context-menu-holder.component.spec.ts b/lib/core/context-menu/context-menu-holder.component.spec.ts index 4fec934ba6..e64cef1407 100644 --- a/lib/core/context-menu/context-menu-holder.component.spec.ts +++ b/lib/core/context-menu/context-menu-holder.component.spec.ts @@ -28,7 +28,7 @@ describe('ContextMenuHolderComponent', () => { let fixture: ComponentFixture<ContextMenuHolderComponent>; let component: ContextMenuHolderComponent; let contextMenuService: ContextMenuService; - let overlayContainer = { + const overlayContainer = { getContainerElement: () => ({ addEventListener: () => {}, querySelector: (val) => ({ @@ -46,7 +46,7 @@ describe('ContextMenuHolderComponent', () => { }) }; - let getViewportRect = { + const getViewportRect = { getViewportRect: () => ({ left: 0, top: 0, width: 1014, height: 686, bottom: 0, right: 0 }) diff --git a/lib/core/datatable/components/datatable/datatable.component.spec.ts b/lib/core/datatable/components/datatable/datatable.component.spec.ts index a9fc3ea7af..07ee637dc6 100644 --- a/lib/core/datatable/components/datatable/datatable.component.spec.ts +++ b/lib/core/datatable/components/datatable/datatable.component.spec.ts @@ -105,7 +105,7 @@ describe('DataTable', () => { })); it('should use the cardview style if cardview is true', () => { - let newData = new ObjectDataTableAdapter( + const newData = new ObjectDataTableAdapter( [ { name: '1' }, { name: '2' } @@ -125,7 +125,7 @@ describe('DataTable', () => { }); it('should use the cardview style if cardview is false', () => { - let newData = new ObjectDataTableAdapter( + const newData = new ObjectDataTableAdapter( [ { name: '1' }, { name: '2' } @@ -144,7 +144,7 @@ describe('DataTable', () => { }); it('should hide the header if showHeader is false', () => { - let newData = new ObjectDataTableAdapter( + const newData = new ObjectDataTableAdapter( [ { name: '1' }, { name: '2' } @@ -164,7 +164,7 @@ describe('DataTable', () => { }); it('should hide the header if there are no elements inside', () => { - let newData = new ObjectDataTableAdapter( + const newData = new ObjectDataTableAdapter( ); dataTable.ngOnChanges({ @@ -177,7 +177,7 @@ describe('DataTable', () => { }); it('should hide the header if noPermission is true', () => { - let newData = new ObjectDataTableAdapter( + const newData = new ObjectDataTableAdapter( ); dataTable.noPermission = true; @@ -193,7 +193,7 @@ describe('DataTable', () => { }); it('should show the header if showHeader is true', () => { - let newData = new ObjectDataTableAdapter( + const newData = new ObjectDataTableAdapter( [ { name: '1' }, { name: '2' } @@ -234,7 +234,7 @@ describe('DataTable', () => { }); it('should change the rows on changing of the data', () => { - let newData = new ObjectDataTableAdapter( + const newData = new ObjectDataTableAdapter( [ { name: 'TEST' }, { name: 'FAKE' } @@ -531,7 +531,7 @@ describe('DataTable', () => { dataTable.actions = true; fixture.detectChanges(); - let actions = element.querySelectorAll('[id^=action_menu_right]'); + const actions = element.querySelectorAll('[id^=action_menu_right]'); expect(actions.length).toBe(4); }); @@ -550,26 +550,26 @@ describe('DataTable', () => { dataTable.actionsPosition = 'left'; fixture.detectChanges(); - let actions = element.querySelectorAll('[id^=action_menu_left]'); + const actions = element.querySelectorAll('[id^=action_menu_left]'); expect(actions.length).toBe(4); }); it('should initialize default adapter', () => { - let table = new DataTableComponent(null, null); + const table = new DataTableComponent(null, null); expect(table.data).toBeUndefined(); table.ngOnChanges({ 'data': new SimpleChange('123', {}, true) }); expect(table.data).toEqual(jasmine.any(ObjectDataTableAdapter)); }); it('should initialize with custom data', () => { - let data = new ObjectDataTableAdapter([], []); + const data = new ObjectDataTableAdapter([], []); dataTable.data = data; dataTable.ngAfterContentInit(); expect(dataTable.data).toBe(data); }); it('should emit row click event', (done) => { - let row = <DataRow> {}; + const row = <DataRow> {}; dataTable.rowClick.subscribe((e) => { expect(e.value).toBe(row); @@ -582,7 +582,7 @@ describe('DataTable', () => { it('should emit double click if there are two single click in 250ms', (done) => { - let row = <DataRow> {}; + const row = <DataRow> {}; dataTable.ngOnChanges({}); dataTable.rowDblClick.subscribe(() => { @@ -599,7 +599,7 @@ describe('DataTable', () => { it('should emit double click if there are more than two single click in 250ms', (done) => { - let row = <DataRow> {}; + const row = <DataRow> {}; dataTable.ngOnChanges({}); dataTable.rowDblClick.subscribe(() => { @@ -618,7 +618,7 @@ describe('DataTable', () => { it('should emit single click if there are two single click in more than 250ms', (done) => { - let row = <DataRow> {}; + const row = <DataRow> {}; let clickCount = 0; dataTable.ngOnChanges({}); @@ -638,7 +638,7 @@ describe('DataTable', () => { }); it('should emit row-click dom event', (done) => { - let row = <DataRow> {}; + const row = <DataRow> {}; fixture.nativeElement.addEventListener('row-click', (e) => { expect(e.detail.value).toBe(row); @@ -650,7 +650,7 @@ describe('DataTable', () => { }); it('should emit row-dblclick dom event', (done) => { - let row = <DataRow> {}; + const row = <DataRow> {}; fixture.nativeElement.addEventListener('row-dblclick', (e) => { expect(e.detail.value).toBe(row); @@ -662,14 +662,14 @@ describe('DataTable', () => { }); it('should prevent default behaviour on row click event', () => { - let e = jasmine.createSpyObj('event', ['preventDefault']); + const e = jasmine.createSpyObj('event', ['preventDefault']); dataTable.ngAfterContentInit(); dataTable.onRowClick(null, e); expect(e.preventDefault).toHaveBeenCalled(); }); it('should prevent default behaviour on row double-click event', () => { - let e = jasmine.createSpyObj('event', ['preventDefault']); + const e = jasmine.createSpyObj('event', ['preventDefault']); dataTable.ngOnChanges({}); dataTable.ngAfterContentInit(); dataTable.onRowDblClick(null, e); @@ -678,7 +678,7 @@ describe('DataTable', () => { it('should not sort if column is missing', () => { dataTable.ngOnChanges({ 'data': new SimpleChange('123', {}, true) }); - let adapter = dataTable.data; + const adapter = dataTable.data; spyOn(adapter, 'setSorting').and.callThrough(); dataTable.onColumnHeaderClick(null); expect(adapter.setSorting).not.toHaveBeenCalled(); @@ -686,10 +686,10 @@ describe('DataTable', () => { it('should not sort upon clicking non-sortable column header', () => { dataTable.ngOnChanges({ 'data': new SimpleChange('123', {}, true) }); - let adapter = dataTable.data; + const adapter = dataTable.data; spyOn(adapter, 'setSorting').and.callThrough(); - let column = new ObjectDataColumn({ + const column = new ObjectDataColumn({ key: 'column_1' }); @@ -699,10 +699,10 @@ describe('DataTable', () => { it('should set sorting upon column header clicked', () => { dataTable.ngOnChanges({ 'data': new SimpleChange('123', {}, true) }); - let adapter = dataTable.data; + const adapter = dataTable.data; spyOn(adapter, 'setSorting').and.callThrough(); - let column = new ObjectDataColumn({ + const column = new ObjectDataColumn({ key: 'column_1', sortable: true }); @@ -719,12 +719,12 @@ describe('DataTable', () => { it('should invert sorting upon column header clicked', () => { dataTable.ngOnChanges({ 'data': new SimpleChange('123', {}, true) }); - let adapter = dataTable.data; - let sorting = new DataSorting('column_1', 'asc'); + const adapter = dataTable.data; + const sorting = new DataSorting('column_1', 'asc'); spyOn(adapter, 'setSorting').and.callThrough(); spyOn(adapter, 'getSorting').and.returnValue(sorting); - let column = new ObjectDataColumn({ + const column = new ObjectDataColumn({ key: 'column_1', sortable: true }); @@ -759,7 +759,7 @@ describe('DataTable', () => { }); it('should reset selection upon data rows change', () => { - let data = new ObjectDataTableAdapter([{}, {}, {}], []); + const data = new ObjectDataTableAdapter([{}, {}, {}], []); dataTable.data = data; dataTable.multiselect = true; @@ -775,8 +775,8 @@ describe('DataTable', () => { }); it('should update rows on "select all" click', () => { - let data = new ObjectDataTableAdapter([{}, {}, {}], []); - let rows = data.getRows(); + const data = new ObjectDataTableAdapter([{}, {}, {}], []); + const rows = data.getRows(); dataTable.data = data; dataTable.multiselect = true; @@ -804,8 +804,8 @@ describe('DataTable', () => { }); it('should require multiselect option to toggle row state', () => { - let data = new ObjectDataTableAdapter([{}, {}, {}], []); - let rows = data.getRows(); + const data = new ObjectDataTableAdapter([{}, {}, {}], []); + const rows = data.getRows(); dataTable.data = data; dataTable.multiselect = false; @@ -825,9 +825,9 @@ describe('DataTable', () => { }); it('should use special material url scheme', () => { - let column = <DataColumn> {}; + const column = <DataColumn> {}; - let row = { + const row = { getValue: function (key: string) { return 'material-icons://android'; } @@ -837,9 +837,9 @@ describe('DataTable', () => { }); it('should not use special material url scheme', () => { - let column = <DataColumn> {}; + const column = <DataColumn> {}; - let row = { + const row = { getValue: function (key: string) { return 'http://www.google.com'; } @@ -849,9 +849,9 @@ describe('DataTable', () => { }); it('should parse icon value', () => { - let column = <DataColumn> {}; + const column = <DataColumn> {}; - let row = { + const row = { getValue: function (key: string) { return 'material-icons://android'; } @@ -861,9 +861,9 @@ describe('DataTable', () => { }); it('should not parse icon value', () => { - let column = <DataColumn> {}; + const column = <DataColumn> {}; - let row = { + const row = { getValue: function (key: string) { return 'http://www.google.com'; } @@ -898,7 +898,7 @@ describe('DataTable', () => { }); it('should replace image source with fallback thumbnail on error', () => { - let event = <any> { + const event = <any> { target: { src: 'missing-image' } @@ -911,7 +911,7 @@ describe('DataTable', () => { it('should replace image source with miscellaneous icon when fallback is not available', () => { const originalSrc = 'missing-image'; - let event = <any> { + const event = <any> { target: { src: originalSrc } diff --git a/lib/core/datatable/components/datatable/datatable.component.ts b/lib/core/datatable/components/datatable/datatable.component.ts index 123360db92..5f4568eea6 100644 --- a/lib/core/datatable/components/datatable/datatable.component.ts +++ b/lib/core/datatable/components/datatable/datatable.component.ts @@ -239,7 +239,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, } ngDoCheck() { - let changes = this.differ.diff(this.rows); + const changes = this.differ.diff(this.rows); if (changes) { this.setTableRows(this.rows); } @@ -261,7 +261,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, private initAndSubscribeClickStream() { this.unsubscribeClickStream(); - let singleClickStream = this.click$ + const singleClickStream = this.click$ .pipe( buffer( this.click$.pipe( @@ -273,7 +273,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, ); this.singleClickStreamSub = singleClickStream.subscribe((dataRowEvents: DataRowEvent[]) => { - let event: DataRowEvent = dataRowEvents[0]; + const event: DataRowEvent = dataRowEvents[0]; this.handleRowSelection(event.value, <MouseEvent | KeyboardEvent> event.event); this.rowClick.emit(event); if (!event.defaultPrevented) { @@ -286,7 +286,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, } }); - let multiClickStream = this.click$ + const multiClickStream = this.click$ .pipe( buffer( this.click$.pipe( @@ -298,7 +298,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, ); this.multiClickStreamSub = multiClickStream.subscribe((dataRowEvents: DataRowEvent[]) => { - let event: DataRowEvent = dataRowEvents[0]; + const event: DataRowEvent = dataRowEvents[0]; this.rowDblClick.emit(event); if (!event.defaultPrevented) { this.elementRef.nativeElement.dispatchEvent( @@ -428,7 +428,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, if (event) { event.preventDefault(); } - let dataRowEvent = new DataRowEvent(row, event, this); + const dataRowEvent = new DataRowEvent(row, event, this); this.clickObserver.next(dataRowEvent); } @@ -471,7 +471,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, onColumnHeaderClick(column: DataColumn) { if (column && column.sortable) { - let current = this.data.getSorting(); + const current = this.data.getSorting(); let newDirection = 'asc'; if (current && column.key === current.key) { newDirection = current.direction === 'asc' ? 'desc' : 'asc'; @@ -485,7 +485,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, this.isSelectAllChecked = matCheckboxChange.checked; if (this.multiselect) { - let rows = this.data.getRows(); + const rows = this.data.getRows(); if (rows && rows.length > 0) { for (let i = 0; i < rows.length; i++) { this.selectRow(rows[i], matCheckboxChange.checked); @@ -510,7 +510,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, onImageLoadingError(event: Event, row: DataRow) { if (event) { - let element = <any> event.target; + const element = <any> event.target; if (this.fallbackThumbnail) { element.src = this.fallbackThumbnail; @@ -522,7 +522,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, isIconValue(row: DataRow, col: DataColumn): boolean { if (row && col) { - let value = row.getValue(col.key); + const value = row.getValue(col.key); return value && value.startsWith('material-icons://'); } return false; @@ -530,7 +530,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, asIconValue(row: DataRow, col: DataColumn): string { if (this.isIconValue(row, col)) { - let value = row.getValue(col.key) || ''; + const value = row.getValue(col.key) || ''; return value.replace('material-icons://', ''); } return null; @@ -542,14 +542,14 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, isColumnSorted(col: DataColumn, direction: string): boolean { if (col && direction) { - let sorting = this.data.getSorting(); + const sorting = this.data.getSorting(); return sorting && sorting.key === col.key && sorting.direction === direction; } return false; } getContextMenuActions(row: DataRow, col: DataColumn): any[] { - let event = new DataCellEvent(row, col, []); + const event = new DataCellEvent(row, col, []); this.showRowContextMenu.emit(event); return event.value.actions; } @@ -558,7 +558,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck, const id = row.getValue('id'); if (!this.rowMenuCache[id]) { - let event = new DataCellEvent(row, col, []); + const event = new DataCellEvent(row, col, []); this.showRowActionsMenu.emit(event); if (!this.rowMenuCacheEnabled) { return event.value.actions; diff --git a/lib/core/datatable/data/object-datatable-adapter.spec.ts b/lib/core/datatable/data/object-datatable-adapter.spec.ts index 0055e2112f..b9c9784a67 100644 --- a/lib/core/datatable/data/object-datatable-adapter.spec.ts +++ b/lib/core/datatable/data/object-datatable-adapter.spec.ts @@ -25,20 +25,20 @@ import { ObjectDataColumn } from './object-datacolumn.model'; describe('ObjectDataTableAdapter', () => { it('should init with empty row collection', () => { - let adapter = new ObjectDataTableAdapter(null, []); + const adapter = new ObjectDataTableAdapter(null, []); expect(adapter.getRows()).toBeDefined(); expect(adapter.getRows().length).toBe(0); }); it('should init with empty column collection', () => { - let adapter = new ObjectDataTableAdapter([], null); + const adapter = new ObjectDataTableAdapter([], null); expect(adapter.getColumns()).toBeDefined(); expect(adapter.getColumns().length).toBeDefined(); }); it('should map rows', () => { - let adapter = new ObjectDataTableAdapter([{}, {}], null); - let rows = adapter.getRows(); + const adapter = new ObjectDataTableAdapter([{}, {}], null); + const rows = adapter.getRows(); expect(rows.length).toBe(2); expect(rows[0] instanceof ObjectDataRow).toBe(true); @@ -46,11 +46,11 @@ describe('ObjectDataTableAdapter', () => { }); it('should map columns without rows', () => { - let adapter = new ObjectDataTableAdapter(null, [ + const adapter = new ObjectDataTableAdapter(null, [ <DataColumn> {}, <DataColumn> {} ]); - let columns = adapter.getColumns(); + const columns = adapter.getColumns(); expect(columns.length).toBe(2); expect(columns[0] instanceof ObjectDataColumn).toBe(true); @@ -58,13 +58,13 @@ describe('ObjectDataTableAdapter', () => { }); it('should sort by first column if column is available', () => { - let adapter = new ObjectDataTableAdapter(null, null); + const adapter = new ObjectDataTableAdapter(null, null); expect(adapter.getSorting()).toBeUndefined(); }); it('should apply new rows array', () => { - let adapter = new ObjectDataTableAdapter([], []); - let newRows = [ + const adapter = new ObjectDataTableAdapter([], []); + const newRows = [ <DataRow> {}, <DataRow> {} ]; @@ -74,7 +74,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should accept null for new rows array', () => { - let adapter = new ObjectDataTableAdapter([], []); + const adapter = new ObjectDataTableAdapter([], []); expect(adapter.getRows()).toBeDefined(); expect(adapter.getRows().length).toBe(0); @@ -84,7 +84,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should reset rows by null value', () => { - let adapter = new ObjectDataTableAdapter([{}, {}], []); + const adapter = new ObjectDataTableAdapter([{}, {}], []); expect(adapter.getRows()).toBeDefined(); expect(adapter.getRows().length).toBe(2); @@ -94,15 +94,15 @@ describe('ObjectDataTableAdapter', () => { }); it('should sort new row collection', () => { - let adapter = new ObjectDataTableAdapter([], []); + const adapter = new ObjectDataTableAdapter([], []); spyOn(adapter, 'sort').and.callThrough(); adapter.setRows([]); expect(adapter.sort).toHaveBeenCalled(); }); it('should apply new columns array', () => { - let adapter = new ObjectDataTableAdapter([], []); - let columns = [ + const adapter = new ObjectDataTableAdapter([], []); + const columns = [ <DataColumn> {}, <DataColumn> {} ]; @@ -112,7 +112,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should accept null for new columns array', () => { - let adapter = new ObjectDataTableAdapter([], []); + const adapter = new ObjectDataTableAdapter([], []); expect(adapter.getColumns()).toBeDefined(); expect(adapter.getColumns().length).toBe(0); @@ -122,7 +122,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should reset columns by null value', () => { - let adapter = new ObjectDataTableAdapter([], [ + const adapter = new ObjectDataTableAdapter([], [ <DataColumn> {}, <DataColumn> {} ]); @@ -135,31 +135,31 @@ describe('ObjectDataTableAdapter', () => { }); it('should fail getting value with row not defined', () => { - let adapter = new ObjectDataTableAdapter([], []); + const adapter = new ObjectDataTableAdapter([], []); expect(() => { adapter.getValue(null, null); }).toThrowError('Row not found'); }); it('should fail getting value with column not defined', () => { - let adapter = new ObjectDataTableAdapter([], []); + const adapter = new ObjectDataTableAdapter([], []); expect(() => { adapter.getValue(<DataRow> {}, null); }).toThrowError('Column not found'); }); it('should get value from row with column key', () => { - let value = 'hello world'; + const value = 'hello world'; - let row = jasmine.createSpyObj('row', ['getValue']); + const row = jasmine.createSpyObj('row', ['getValue']); row.getValue.and.returnValue(value); - let adapter = new ObjectDataTableAdapter([], []); - let result = adapter.getValue(row, <DataColumn> { key: 'col1' }); + const adapter = new ObjectDataTableAdapter([], []); + const result = adapter.getValue(row, <DataColumn> { key: 'col1' }); expect(row.getValue).toHaveBeenCalledWith('col1'); expect(result).toBe(value); }); it('should set new sorting', () => { - let sorting = new DataSorting('key', 'direction'); - let adapter = new ObjectDataTableAdapter([], []); + const sorting = new DataSorting('key', 'direction'); + const adapter = new ObjectDataTableAdapter([], []); adapter.setSorting(sorting); expect(adapter.getSorting()).toBe(sorting); @@ -169,7 +169,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should sort rows with new sorting value', () => { - let adapter = new ObjectDataTableAdapter([{}, {}], []); + const adapter = new ObjectDataTableAdapter([{}, {}], []); spyOn(adapter.getRows(), 'sort').and.stub(); adapter.setSorting(new DataSorting('key', 'direction')); @@ -177,7 +177,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should sort rows only when sorting key provided', () => { - let adapter = new ObjectDataTableAdapter([{}, {}], []); + const adapter = new ObjectDataTableAdapter([{}, {}], []); spyOn(adapter.getRows(), 'sort').and.stub(); adapter.setSorting(new DataSorting()); @@ -185,7 +185,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should sort by first column by default', () => { - let adapter = new ObjectDataTableAdapter( + const adapter = new ObjectDataTableAdapter( [ { id: 2, name: 'abs' }, { id: 1, name: 'xyz' } @@ -195,13 +195,13 @@ describe('ObjectDataTableAdapter', () => { ] ); - let rows = adapter.getRows(); + const rows = adapter.getRows(); expect(rows[0].getValue('id')).toBe(1); expect(rows[1].getValue('id')).toBe(2); }); it('should take first sortable column by default', () => { - let adapter = new ObjectDataTableAdapter([], [ + const adapter = new ObjectDataTableAdapter([], [ <DataColumn> { key: 'icon' }, new ObjectDataColumn({ key: 'id', sortable: true }) ]); @@ -215,7 +215,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should sort by dates', () => { - let adapter = new ObjectDataTableAdapter( + const adapter = new ObjectDataTableAdapter( [ { id: 1, created: new Date(2016, 7, 6, 15, 7, 2) }, { id: 2, created: new Date(2016, 7, 6, 15, 7, 1) } @@ -228,13 +228,13 @@ describe('ObjectDataTableAdapter', () => { adapter.setSorting(new DataSorting('created', 'asc')); - let rows = adapter.getRows(); + const rows = adapter.getRows(); expect(rows[0].getValue('id')).toBe(2); expect(rows[1].getValue('id')).toBe(1); }); it('should be sorting undefined if no sortable found', () => { - let adapter = new ObjectDataTableAdapter( + const adapter = new ObjectDataTableAdapter( [ { id: 2, name: 'abs' }, { id: 1, name: 'xyz' } @@ -249,7 +249,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should sort asc and desc', () => { - let adapter = new ObjectDataTableAdapter( + const adapter = new ObjectDataTableAdapter( [ { id: 2, name: 'abs' }, { id: 1, name: 'xyz' } @@ -269,7 +269,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should use asc for sort command by default', () => { - let adapter = new ObjectDataTableAdapter([], []); + const adapter = new ObjectDataTableAdapter([], []); adapter.setSorting(null); expect(adapter.getSorting()).toBe(null); @@ -283,7 +283,7 @@ describe('ObjectDataTableAdapter', () => { }); it('should use direction for sort command', () => { - let adapter = new ObjectDataTableAdapter([], []); + const adapter = new ObjectDataTableAdapter([], []); adapter.setSorting(null); expect(adapter.getSorting()).toBe(null); @@ -305,19 +305,19 @@ describe('ObjectDataRow', () => { }); it('should get top level property value', () => { - let row = new ObjectDataRow({ + const row = new ObjectDataRow({ id: 1 }); expect(row.getValue('id')).toBe(1); }); it('should not get top level property value', () => { - let row = new ObjectDataRow({}); + const row = new ObjectDataRow({}); expect(row.getValue('missing')).toBeUndefined(); }); it('should get nested property value', () => { - let row = new ObjectDataRow({ + const row = new ObjectDataRow({ name: { firstName: 'John', lastName: 'Doe' @@ -328,19 +328,19 @@ describe('ObjectDataRow', () => { }); it('should not get nested property value', () => { - let row = new ObjectDataRow({}); + const row = new ObjectDataRow({}); expect(row.getValue('some.missing.property')).toBeUndefined(); }); it('should check top level value exists', () => { - let row = new ObjectDataRow({ id: 1 }); + const row = new ObjectDataRow({ id: 1 }); expect(row.hasValue('id')).toBeTruthy(); expect(row.hasValue('other')).toBeFalsy(); }); it('should check nested value exists', () => { - let row = new ObjectDataRow({ + const row = new ObjectDataRow({ name: { firstName: 'John', lastName: 'Doe' @@ -353,12 +353,12 @@ describe('ObjectDataRow', () => { }); it('should generateSchema generate a schema from data', () => { - let data = [ + const data = [ { id: 2, name: 'abs' }, { id: 1, name: 'xyz' } ]; - let schema = ObjectDataTableAdapter.generateSchema(data); + const schema = ObjectDataTableAdapter.generateSchema(data); expect(schema.length).toBe(2); expect(schema[0].title).toBe('id'); diff --git a/lib/core/datatable/data/object-datatable-adapter.ts b/lib/core/datatable/data/object-datatable-adapter.ts index 3578cc3396..a34042a045 100644 --- a/lib/core/datatable/data/object-datatable-adapter.ts +++ b/lib/core/datatable/data/object-datatable-adapter.ts @@ -34,13 +34,13 @@ export class ObjectDataTableAdapter implements DataTableAdapter { rowsChanged: Subject<Array<DataRow>>; static generateSchema(data: any[]) { - let schema = []; + const schema = []; if (data && data.length) { - let rowToExaminate = data[0]; + const rowToExaminate = data[0]; if (typeof rowToExaminate === 'object') { - for (let key in rowToExaminate) { + for (const key in rowToExaminate) { if (rowToExaminate.hasOwnProperty(key)) { schema.push({ type: 'text', @@ -72,7 +72,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter { }); // Sort by first sortable or just first column - let sortable = this._columns.filter((column) => column.sortable); + const sortable = this._columns.filter((column) => column.sortable); if (sortable.length > 0) { this.sort(sortable[0].key, 'asc'); } @@ -107,7 +107,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter { throw new Error('Column not found'); } - let value = row.getValue(col.key); + const value = row.getValue(col.key); if (col.type === 'icon') { const icon = row.getValue(col.key); @@ -148,7 +148,7 @@ export class ObjectDataTableAdapter implements DataTableAdapter { } sort(key?: string, direction?: string): void { - let sorting = this._sorting || new DataSorting(); + const sorting = this._sorting || new DataSorting(); if (key) { sorting.key = key; sorting.direction = direction || 'asc'; diff --git a/lib/core/dialogs/download-zip.dialog.spec.ts b/lib/core/dialogs/download-zip.dialog.spec.ts index 48504e42ce..4c20f1b956 100755 --- a/lib/core/dialogs/download-zip.dialog.spec.ts +++ b/lib/core/dialogs/download-zip.dialog.spec.ts @@ -30,17 +30,17 @@ describe('DownloadZipDialogComponent', () => { let component: DownloadZipDialogComponent; let element: HTMLElement; let downloadZipService: DownloadZipService; - let dialogRef = { + const dialogRef = { close: jasmine.createSpy('close') }; - let dataMock = { + const dataMock = { nodeIds: [ '123' ] }; - let pendingDownloadEntry = { + const pendingDownloadEntry = { entry: { bytesAdded: 0, filesAdded: 0, diff --git a/lib/core/directives/check-allowable-operation.directive.spec.ts b/lib/core/directives/check-allowable-operation.directive.spec.ts index d65a0fdcf5..31af2a930a 100644 --- a/lib/core/directives/check-allowable-operation.directive.spec.ts +++ b/lib/core/directives/check-allowable-operation.directive.spec.ts @@ -134,7 +134,7 @@ describe('CheckAllowableOperationDirective', () => { spyOn(contentService, 'hasAllowableOperations').and.returnValue(false); spyOn(changeDetectorMock, 'detectChanges'); - let testComponent = new TestComponent(); + const testComponent = new TestComponent(); testComponent.disabled = false; const directive = new CheckAllowableOperationDirective(null, null, contentService, changeDetectorMock, testComponent); directive.nodes = <any> [{}, {}]; @@ -150,7 +150,7 @@ describe('CheckAllowableOperationDirective', () => { spyOn(contentService, 'hasAllowableOperations').and.returnValue(true); spyOn(changeDetectorMock, 'detectChanges'); - let testComponent = new TestComponent(); + const testComponent = new TestComponent(); testComponent.disabled = true; const directive = new CheckAllowableOperationDirective(null, null, contentService, changeDetectorMock, testComponent); directive.nodes = <any> [{}, {}]; diff --git a/lib/core/directives/check-allowable-operation.directive.ts b/lib/core/directives/check-allowable-operation.directive.ts index c2476d65c2..fd400061c5 100644 --- a/lib/core/directives/check-allowable-operation.directive.ts +++ b/lib/core/directives/check-allowable-operation.directive.ts @@ -63,7 +63,7 @@ export class CheckAllowableOperationDirective implements OnChanges { * @memberof CheckAllowableOperationDirective */ updateElement(): boolean { - let enable = this.hasAllowableOperations(this.nodes, this.permission); + const enable = this.hasAllowableOperations(this.nodes, this.permission); if (enable) { this.enable(); diff --git a/lib/core/directives/node-favorite.directive.spec.ts b/lib/core/directives/node-favorite.directive.spec.ts index fb2ebb4725..94c27e9f46 100644 --- a/lib/core/directives/node-favorite.directive.spec.ts +++ b/lib/core/directives/node-favorite.directive.spec.ts @@ -72,7 +72,7 @@ describe('NodeFavoriteDirective', () => { it('should reset favorites if selection is empty', fakeAsync(() => { spyOn(alfrescoApiService.getInstance().core.favoritesApi, 'getFavorite').and.returnValue(Promise.resolve()); - let selection = [ + const selection = [ { entry: { id: '1', name: 'name1' } } ]; @@ -104,7 +104,7 @@ describe('NodeFavoriteDirective', () => { { entry: { id: '2', name: 'name2' } } ]; - let change = new SimpleChange(null, selection, true); + const change = new SimpleChange(null, selection, true); directive.ngOnChanges({'selection': change}); tick(); @@ -185,7 +185,7 @@ describe('NodeFavoriteDirective', () => { }); it('should not perform action if favorites collection is empty', fakeAsync(() => { - let change = new SimpleChange(null, [], true); + const change = new SimpleChange(null, [], true); directive.ngOnChanges({'selection': change}); tick(); @@ -330,7 +330,7 @@ describe('NodeFavoriteDirective', () => { { entry: { id: '1', name: 'name1', isFavorite: true } } ]; - let change = new SimpleChange(null, selection, true); + const change = new SimpleChange(null, selection, true); directive.ngOnChanges({'selection': change}); tick(); @@ -345,7 +345,7 @@ describe('NodeFavoriteDirective', () => { { entry: { id: '1', name: 'name1' } } ]; - let change = new SimpleChange(null, selection, true); + const change = new SimpleChange(null, selection, true); directive.ngOnChanges({'selection': change}); tick(); @@ -359,7 +359,7 @@ describe('NodeFavoriteDirective', () => { { entry: { id: '1', name: 'name1' } } ]; - let change = new SimpleChange(null, selection, true); + const change = new SimpleChange(null, selection, true); directive.ngOnChanges({'selection': change}); tick(); diff --git a/lib/core/directives/node-restore.directive.ts b/lib/core/directives/node-restore.directive.ts index 6e2358034e..55cef30615 100644 --- a/lib/core/directives/node-restore.directive.ts +++ b/lib/core/directives/node-restore.directive.ts @@ -238,7 +238,7 @@ export class NodeRestoreDirective { private notification(): void { const status = Object.assign({}, this.restoreProcessStatus); - let message = this.getRestoreMessage(); + const message = this.getRestoreMessage(); this.reset(); const action = (status.oneSucceeded && !status.someFailed) ? this.translation.instant('CORE.RESTORE_NODE.VIEW') : ''; diff --git a/lib/core/directives/upload.directive.spec.ts b/lib/core/directives/upload.directive.spec.ts index 11f90f3b34..cdeed6fbf8 100644 --- a/lib/core/directives/upload.directive.spec.ts +++ b/lib/core/directives/upload.directive.spec.ts @@ -58,7 +58,7 @@ describe('UploadDirective', () => { }); it('should prevent default event on dragover', () => { - let event = new Event('dom-event'); + const event = new Event('dom-event'); spyOn(event, 'preventDefault').and.stub(); directive.enabled = true; directive.onDragOver(event); @@ -88,28 +88,28 @@ describe('UploadDirective', () => { it('should prevent default event on drop', () => { directive.enabled = true; - let event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); + const event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); directive.onDrop(<DragEvent> event); expect(event.preventDefault).toHaveBeenCalled(); }); it('should stop default event propagation on drop', () => { directive.enabled = true; - let event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); + const event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); directive.onDrop(<DragEvent> event); expect(event.stopPropagation).toHaveBeenCalled(); }); it('should not prevent default event on drop when disabled', () => { directive.enabled = false; - let event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); + const event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); directive.onDrop(<DragEvent> event); expect(event.preventDefault).not.toHaveBeenCalled(); }); it('should raise upload-files event on files drop', (done) => { directive.enabled = true; - let event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); + const event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); spyOn(directive, 'getDataTransfer').and.returnValue({}); spyOn(directive, 'getFilesDropped').and.returnValue(Promise.resolve([ <FileInfo> {}, @@ -123,10 +123,10 @@ describe('UploadDirective', () => { it('should provide dropped files in upload-files event', (done) => { directive.enabled = true; - let files = [ + const files = [ <FileInfo> {} ]; - let event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); + const event = jasmine.createSpyObj('event', ['preventDefault', 'stopPropagation']); spyOn(directive, 'getDataTransfer').and.returnValue({}); spyOn(directive, 'getFilesDropped').and.returnValue(Promise.resolve(files)); diff --git a/lib/core/directives/upload.directive.ts b/lib/core/directives/upload.directive.ts index 33151a2743..5021e7f734 100644 --- a/lib/core/directives/upload.directive.ts +++ b/lib/core/directives/upload.directive.ts @@ -63,7 +63,7 @@ export class UploadDirective implements OnInit, OnDestroy { ngOnInit() { if (this.isClickMode() && this.renderer) { - let inputUpload = this.renderer.createElement('input'); + const inputUpload = this.renderer.createElement('input'); this.upload = this.el.nativeElement.parentElement.appendChild(inputUpload); this.upload.type = 'file'; @@ -153,7 +153,7 @@ export class UploadDirective implements OnInit, OnDestroy { onUploadFiles(files: FileInfo[]) { if (this.enabled && files.length > 0) { - let customEvent = new CustomEvent('upload-files', { + const customEvent = new CustomEvent('upload-files', { detail: { sender: this, data: this.data, @@ -201,7 +201,7 @@ export class UploadDirective implements OnInit, OnDestroy { if (items) { for (let i = 0; i < items.length; i++) { if (typeof items[i].webkitGetAsEntry !== 'undefined') { - let item = items[i].webkitGetAsEntry(); + const item = items[i].webkitGetAsEntry(); if (item) { if (item.isFile) { iterations.push(Promise.resolve(<FileInfo> { @@ -225,7 +225,7 @@ export class UploadDirective implements OnInit, OnDestroy { } } else { // safari or FF - let files = FileUtils + const files = FileUtils .toFileArray(dataTransfer.files) .map((file) => <FileInfo> { entry: null, diff --git a/lib/core/form/components/form-field/form-field.component.spec.ts b/lib/core/form/components/form-field/form-field.component.spec.ts index fee77cac19..6f8b0c76aa 100644 --- a/lib/core/form/components/form-field/form-field.component.spec.ts +++ b/lib/core/form/components/form-field/form-field.component.spec.ts @@ -51,7 +51,7 @@ describe('FormFieldComponent', () => { }); it('should create default component instance', (done) => { - let field = new FormFieldModel(form, { + const field = new FormFieldModel(form, { type: FormFieldTypes.TEXT, id: 'FAKE-TXT-WIDGET' }); @@ -69,7 +69,7 @@ describe('FormFieldComponent', () => { it('should create custom component instance', (done) => { formRenderingService.setComponentTypeResolver(FormFieldTypes.AMOUNT, () => CheckboxWidgetComponent, true); - let field = new FormFieldModel(form, { + const field = new FormFieldModel(form, { type: FormFieldTypes.AMOUNT, id: 'FAKE-TXT-WIDGET' }); @@ -85,7 +85,7 @@ describe('FormFieldComponent', () => { }); it('should require component type to be resolved', (done) => { - let field = new FormFieldModel(form, { + const field = new FormFieldModel(form, { type: FormFieldTypes.TEXT, id: 'FAKE-TXT-WIDGET' }); @@ -102,7 +102,7 @@ describe('FormFieldComponent', () => { }); it('should hide the field when it is not visible', (done) => { - let field = new FormFieldModel(form, { + const field = new FormFieldModel(form, { type: FormFieldTypes.TEXT, id: 'FAKE-TXT-WIDGET' }); @@ -117,7 +117,7 @@ describe('FormFieldComponent', () => { }); it('should show the field when it is visible', (done) => { - let field = new FormFieldModel(form, { + const field = new FormFieldModel(form, { type: FormFieldTypes.TEXT, id: 'FAKE-TXT-WIDGET' }); @@ -132,7 +132,7 @@ describe('FormFieldComponent', () => { }); it('should hide a visible element', () => { - let field = new FormFieldModel(form, { + const field = new FormFieldModel(form, { type: FormFieldTypes.TEXT, id: 'FAKE-TXT-WIDGET' }); diff --git a/lib/core/form/components/form-field/form-field.component.ts b/lib/core/form/components/form-field/form-field.component.ts index 835638f6f6..1488733856 100644 --- a/lib/core/form/components/form-field/form-field.component.ts +++ b/lib/core/form/components/form-field/form-field.component.ts @@ -78,22 +78,22 @@ export class FormFieldComponent implements OnInit, OnDestroy { if (w.adf === undefined) { w.adf = {}; } - let originalField = this.getField(); + const originalField = this.getField(); if (originalField) { - let customTemplate = this.field.form.customFieldTemplates[originalField.type]; + const customTemplate = this.field.form.customFieldTemplates[originalField.type]; if (customTemplate && this.hasController(originalField.type)) { - let factory = this.getComponentFactorySync(originalField.type, customTemplate); + const factory = this.getComponentFactorySync(originalField.type, customTemplate); this.componentRef = this.container.createComponent(factory); - let instance: any = this.componentRef.instance; + const instance: any = this.componentRef.instance; if (instance) { instance.field = originalField; } } else { - let componentType = this.formRenderingService.resolveComponentType(originalField); + const componentType = this.formRenderingService.resolveComponentType(originalField); if (componentType) { - let factory = this.componentFactoryResolver.resolveComponentFactory(componentType); + const factory = this.componentFactoryResolver.resolveComponentFactory(componentType); this.componentRef = this.container.createComponent(factory); - let instance = <WidgetComponent> this.componentRef.instance; + const instance = <WidgetComponent> this.componentRef.instance; instance.field = this.field; instance.fieldChanged.subscribe((field) => { if (field && this.field.form) { @@ -128,18 +128,18 @@ export class FormFieldComponent implements OnInit, OnDestroy { } private getComponentFactorySync(type: string, template: string): ComponentFactory<any> { - let componentInfo = adf.components[type]; + const componentInfo = adf.components[type]; if (componentInfo.factory) { return componentInfo.factory; } - let metadata = { + const metadata = { selector: `runtime-component-${type}`, template: template }; - let factory = this.createComponentFactorySync(this.compiler, metadata, componentInfo.class); + const factory = this.createComponentFactorySync(this.compiler, metadata, componentInfo.class); componentInfo.factory = factory; return factory; } @@ -153,7 +153,7 @@ export class FormFieldComponent implements OnInit, OnDestroy { class RuntimeComponentModule { } - let module: ModuleWithComponentFactories<any> = compiler.compileModuleAndAllComponentsSync(RuntimeComponentModule); + const module: ModuleWithComponentFactories<any> = compiler.compileModuleAndAllComponentsSync(RuntimeComponentModule); return module.componentFactories.find((x) => x.componentType === decoratedCmp); } diff --git a/lib/core/form/components/form.component.spec.ts b/lib/core/form/components/form.component.spec.ts index 56d1e44d22..5e01552d86 100644 --- a/lib/core/form/components/form.component.spec.ts +++ b/lib/core/form/components/form.component.spec.ts @@ -50,7 +50,7 @@ describe('FormComponent', () => { }); it('should allow title if task name available', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formComponent.form = formModel; expect(formComponent.showTitle).toBeTruthy(); @@ -69,7 +69,7 @@ describe('FormComponent', () => { }); it('should not allow title', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formComponent.form = formModel; formComponent.showTitle = false; @@ -87,16 +87,16 @@ describe('FormComponent', () => { }); it('should enable custom outcome buttons', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formComponent.form = formModel; - let outcome = new FormOutcomeModel(formModel, { id: 'action1', name: 'Action 1' }); + const outcome = new FormOutcomeModel(formModel, { id: 'action1', name: 'Action 1' }); expect(formComponent.isOutcomeButtonVisible(outcome, formComponent.form.readOnly)).toBeTruthy(); }); it('should allow controlling [complete] button visibility', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formComponent.form = formModel; - let outcome = new FormOutcomeModel(formModel, { id: '$save', name: FormOutcomeModel.SAVE_ACTION }); + const outcome = new FormOutcomeModel(formModel, { id: '$save', name: FormOutcomeModel.SAVE_ACTION }); formComponent.showSaveButton = true; expect(formComponent.isOutcomeButtonVisible(outcome, formComponent.form.readOnly)).toBeTruthy(); @@ -106,27 +106,27 @@ describe('FormComponent', () => { }); it('should show only [complete] button with readOnly form ', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formModel.readOnly = true; formComponent.form = formModel; - let outcome = new FormOutcomeModel(formModel, { id: '$complete', name: FormOutcomeModel.COMPLETE_ACTION }); + const outcome = new FormOutcomeModel(formModel, { id: '$complete', name: FormOutcomeModel.COMPLETE_ACTION }); formComponent.showCompleteButton = true; expect(formComponent.isOutcomeButtonVisible(outcome, formComponent.form.readOnly)).toBeTruthy(); }); it('should not show [save] button with readOnly form ', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formModel.readOnly = true; formComponent.form = formModel; - let outcome = new FormOutcomeModel(formModel, { id: '$save', name: FormOutcomeModel.SAVE_ACTION }); + const outcome = new FormOutcomeModel(formModel, { id: '$save', name: FormOutcomeModel.SAVE_ACTION }); formComponent.showSaveButton = true; expect(formComponent.isOutcomeButtonVisible(outcome, formComponent.form.readOnly)).toBeFalsy(); }); it('should show [custom-outcome] button with readOnly form and selected custom-outcome', () => { - let formModel = new FormModel({ selectedOutcome: 'custom-outcome' }); + const formModel = new FormModel({ selectedOutcome: 'custom-outcome' }); formModel.readOnly = true; formComponent.form = formModel; let outcome = new FormOutcomeModel(formModel, { id: '$customoutome', name: 'custom-outcome' }); @@ -140,10 +140,10 @@ describe('FormComponent', () => { }); it('should allow controlling [save] button visibility', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formModel.readOnly = false; formComponent.form = formModel; - let outcome = new FormOutcomeModel(formModel, { id: '$save', name: FormOutcomeModel.COMPLETE_ACTION }); + const outcome = new FormOutcomeModel(formModel, { id: '$save', name: FormOutcomeModel.COMPLETE_ACTION }); formComponent.showCompleteButton = true; expect(formComponent.isOutcomeButtonVisible(outcome, formComponent.form.readOnly)).toBeTruthy(); @@ -251,7 +251,7 @@ describe('FormComponent', () => { spyOn(formComponent, 'getFormByTaskId').and.stub(); const taskId = '<task id>'; - let change = new SimpleChange(null, taskId, true); + const change = new SimpleChange(null, taskId, true); formComponent.ngOnChanges({ 'taskId': change }); expect(formComponent.getFormByTaskId).toHaveBeenCalledWith(taskId); @@ -261,7 +261,7 @@ describe('FormComponent', () => { spyOn(formComponent, 'getFormDefinitionByFormId').and.stub(); const formId = '123'; - let change = new SimpleChange(null, formId, true); + const change = new SimpleChange(null, formId, true); formComponent.ngOnChanges({ 'formId': change }); expect(formComponent.getFormDefinitionByFormId).toHaveBeenCalledWith(formId); @@ -271,7 +271,7 @@ describe('FormComponent', () => { spyOn(formComponent, 'getFormDefinitionByFormName').and.stub(); const formName = '<form>'; - let change = new SimpleChange(null, formName, true); + const change = new SimpleChange(null, formName, true); formComponent.ngOnChanges({ 'formName': change }); expect(formComponent.getFormDefinitionByFormName).toHaveBeenCalledWith(formName); @@ -305,24 +305,24 @@ describe('FormComponent', () => { }); it('should complete form on custom outcome click', () => { - let formModel = new FormModel(); - let outcomeName = 'Custom Action'; - let outcome = new FormOutcomeModel(formModel, { id: 'custom1', name: outcomeName }); + const formModel = new FormModel(); + const outcomeName = 'Custom Action'; + const outcome = new FormOutcomeModel(formModel, { id: 'custom1', name: outcomeName }); let saved = false; formComponent.form = formModel; formComponent.formSaved.subscribe((v) => saved = true); spyOn(formComponent, 'completeTaskForm').and.stub(); - let result = formComponent.onOutcomeClicked(outcome); + const result = formComponent.onOutcomeClicked(outcome); expect(result).toBeTruthy(); expect(saved).toBeTruthy(); expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcomeName); }); it('should save form on [save] outcome click', () => { - let formModel = new FormModel(); - let outcome = new FormOutcomeModel(formModel, { + const formModel = new FormModel(); + const outcome = new FormOutcomeModel(formModel, { id: FormComponent.SAVE_OUTCOME_ID, name: 'Save', isSystem: true @@ -331,14 +331,14 @@ describe('FormComponent', () => { formComponent.form = formModel; spyOn(formComponent, 'saveTaskForm').and.stub(); - let result = formComponent.onOutcomeClicked(outcome); + const result = formComponent.onOutcomeClicked(outcome); expect(result).toBeTruthy(); expect(formComponent.saveTaskForm).toHaveBeenCalled(); }); it('should complete form on [complete] outcome click', () => { - let formModel = new FormModel(); - let outcome = new FormOutcomeModel(formModel, { + const formModel = new FormModel(); + const outcome = new FormOutcomeModel(formModel, { id: FormComponent.COMPLETE_OUTCOME_ID, name: 'Complete', isSystem: true @@ -347,14 +347,14 @@ describe('FormComponent', () => { formComponent.form = formModel; spyOn(formComponent, 'completeTaskForm').and.stub(); - let result = formComponent.onOutcomeClicked(outcome); + const result = formComponent.onOutcomeClicked(outcome); expect(result).toBeTruthy(); expect(formComponent.completeTaskForm).toHaveBeenCalled(); }); it('should emit form saved event on custom outcome click', () => { - let formModel = new FormModel(); - let outcome = new FormOutcomeModel(formModel, { + const formModel = new FormModel(); + const outcome = new FormOutcomeModel(formModel, { id: FormComponent.CUSTOM_OUTCOME_ID, name: 'Custom', isSystem: true @@ -364,15 +364,15 @@ describe('FormComponent', () => { formComponent.form = formModel; formComponent.formSaved.subscribe((v) => saved = true); - let result = formComponent.onOutcomeClicked(outcome); + const result = formComponent.onOutcomeClicked(outcome); expect(result).toBeTruthy(); expect(saved).toBeTruthy(); }); it('should do nothing when clicking outcome for readonly form', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); const outcomeName = 'Custom Action'; - let outcome = new FormOutcomeModel(formModel, { id: 'custom1', name: outcomeName }); + const outcome = new FormOutcomeModel(formModel, { id: 'custom1', name: outcomeName }); formComponent.form = formModel; spyOn(formComponent, 'completeTaskForm').and.stub(); @@ -389,9 +389,9 @@ describe('FormComponent', () => { }); it('should require loaded form when clicking outcome', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); const outcomeName = 'Custom Action'; - let outcome = new FormOutcomeModel(formModel, { id: 'custom1', name: outcomeName }); + const outcome = new FormOutcomeModel(formModel, { id: 'custom1', name: outcomeName }); formComponent.readOnly = false; formComponent.form = null; @@ -399,15 +399,15 @@ describe('FormComponent', () => { }); it('should not execute unknown system outcome', () => { - let formModel = new FormModel(); - let outcome = new FormOutcomeModel(formModel, { id: 'unknown', name: 'Unknown', isSystem: true }); + const formModel = new FormModel(); + const outcome = new FormOutcomeModel(formModel, { id: 'unknown', name: 'Unknown', isSystem: true }); formComponent.form = formModel; expect(formComponent.onOutcomeClicked(outcome)).toBeFalsy(); }); it('should require custom action name to complete form', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); let outcome = new FormOutcomeModel(formModel, { id: 'custom' }); formComponent.form = formModel; @@ -544,7 +544,7 @@ describe('FormComponent', () => { savedForm = form; }); - let formModel = new FormModel({ + const formModel = new FormModel({ taskId: '123', fields: [ { id: 'field1' }, @@ -606,7 +606,7 @@ describe('FormComponent', () => { let completed = false; formComponent.formCompleted.subscribe(() => completed = true); - let formModel = new FormModel({ + const formModel = new FormModel({ taskId: '123', fields: [ { id: 'field1' }, @@ -626,7 +626,7 @@ describe('FormComponent', () => { }); it('should parse form from json', () => { - let form = formComponent.parseForm({ + const form = formComponent.parseForm({ id: 1, fields: [ { id: 'field1', type: FormFieldTypes.CONTAINER } @@ -642,13 +642,13 @@ describe('FormComponent', () => { it('should provide outcomes for form definition', () => { spyOn(formComponent, 'getFormDefinitionOutcomes').and.callThrough(); - let form = formComponent.parseForm({ id: 1 }); + const form = formComponent.parseForm({ id: 1 }); expect(formComponent.getFormDefinitionOutcomes).toHaveBeenCalledWith(form); }); it('should prevent default outcome execution', () => { - let outcome = new FormOutcomeModel(new FormModel(), { + const outcome = new FormOutcomeModel(new FormModel(), { id: FormComponent.CUSTOM_OUTCOME_ID, name: 'Custom' }); @@ -660,12 +660,12 @@ describe('FormComponent', () => { expect(event.defaultPrevented).toBeTruthy(); }); - let result = formComponent.onOutcomeClicked(outcome); + const result = formComponent.onOutcomeClicked(outcome); expect(result).toBeFalsy(); }); it('should not prevent default outcome execution', () => { - let outcome = new FormOutcomeModel(new FormModel(), { + const outcome = new FormOutcomeModel(new FormModel(), { id: FormComponent.CUSTOM_OUTCOME_ID, name: 'Custom' }); @@ -678,7 +678,7 @@ describe('FormComponent', () => { spyOn(formComponent, 'completeTaskForm').and.callThrough(); - let result = formComponent.onOutcomeClicked(outcome); + const result = formComponent.onOutcomeClicked(outcome); expect(result).toBeTruthy(); expect(formComponent.completeTaskForm).toHaveBeenCalledWith(outcome.name); @@ -699,7 +699,7 @@ describe('FormComponent', () => { }); it('should load form for ecm node', () => { - let metadata = {}; + const metadata = {}; spyOn(nodeService, 'getNodeMetadata').and.returnValue( new Observable((observer) => { observer.next({ metadata: metadata }); @@ -709,7 +709,7 @@ describe('FormComponent', () => { spyOn(formComponent, 'loadFormFromActiviti').and.stub(); const nodeId = '<id>'; - let change = new SimpleChange(null, nodeId, false); + const change = new SimpleChange(null, nodeId, false); formComponent.ngOnChanges({ 'nodeId': change }); expect(nodeService.getNodeMetadata).toHaveBeenCalledWith(nodeId); @@ -718,11 +718,11 @@ describe('FormComponent', () => { }); it('should disable outcome buttons for readonly form', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formModel.readOnly = true; formComponent.form = formModel; - let outcome = new FormOutcomeModel(new FormModel(), { + const outcome = new FormOutcomeModel(new FormModel(), { id: FormComponent.CUSTOM_OUTCOME_ID, name: 'Custom' }); @@ -736,22 +736,22 @@ describe('FormComponent', () => { }); it('should always enable save outcome for writeable form', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); - let field = new FormFieldModel(formModel, { + const field = new FormFieldModel(formModel, { type: 'text', value: null, required: true }); - let containerModel = new ContainerModel(field); + const containerModel = new ContainerModel(field); formModel.fields.push(containerModel); formComponent.form = formModel; formModel.onFormFieldChanged(field); expect(formModel.isValid).toBeFalsy(); - let outcome = new FormOutcomeModel(new FormModel(), { + const outcome = new FormOutcomeModel(new FormModel(), { id: FormComponent.SAVE_OUTCOME_ID, name: FormOutcomeModel.SAVE_ACTION }); @@ -761,21 +761,21 @@ describe('FormComponent', () => { }); it('should disable outcome buttons for invalid form', () => { - let formModel = new FormModel(); - let field = new FormFieldModel(formModel, { + const formModel = new FormModel(); + const field = new FormFieldModel(formModel, { type: 'text', value: null, required: true }); - let containerModel = new ContainerModel(field); + const containerModel = new ContainerModel(field); formModel.fields.push(containerModel); formComponent.form = formModel; formModel.onFormFieldChanged(field); expect(formModel.isValid).toBeFalsy(); - let outcome = new FormOutcomeModel(new FormModel(), { + const outcome = new FormOutcomeModel(new FormModel(), { id: FormComponent.CUSTOM_OUTCOME_ID, name: 'Custom' }); @@ -784,23 +784,23 @@ describe('FormComponent', () => { }); it('should disable complete outcome button when disableCompleteButton is true', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formComponent.form = formModel; formComponent.disableCompleteButton = true; expect(formModel.isValid).toBeTruthy(); - let completeOutcome = formComponent.form.outcomes.find((outcome) => outcome.name === FormOutcomeModel.COMPLETE_ACTION); + const completeOutcome = formComponent.form.outcomes.find((outcome) => outcome.name === FormOutcomeModel.COMPLETE_ACTION); expect(formComponent.isOutcomeButtonEnabled(completeOutcome)).toBeFalsy(); }); it('should disable start process outcome button when disableStartProcessButton is true', () => { - let formModel = new FormModel(); + const formModel = new FormModel(); formComponent.form = formModel; formComponent.disableStartProcessButton = true; expect(formModel.isValid).toBeTruthy(); - let startProcessOutcome = formComponent.form.outcomes.find((outcome) => outcome.name === FormOutcomeModel.START_PROCESS_ACTION); + const startProcessOutcome = formComponent.form.outcomes.find((outcome) => outcome.name === FormOutcomeModel.START_PROCESS_ACTION); expect(formComponent.isOutcomeButtonEnabled(startProcessOutcome)).toBeFalsy(); }); @@ -810,7 +810,7 @@ describe('FormComponent', () => { done(); }); - let outcome = new FormOutcomeModel(new FormModel(), { + const outcome = new FormOutcomeModel(new FormModel(), { id: FormComponent.CUSTOM_OUTCOME_ID, name: 'Custom' }); @@ -828,13 +828,13 @@ describe('FormComponent', () => { expect(labelField.value).toBe('empty'); expect(radioField.value).toBeNull(); - let formValues: any = {}; + const formValues: any = {}; formValues.label = { id: 'option_2', name: 'test2' }; formValues.radio = { id: 'option_2', name: 'Option 2' }; - let change = new SimpleChange(null, formValues, false); + const change = new SimpleChange(null, formValues, false); formComponent.data = formValues; formComponent.ngOnChanges({ 'data': change }); @@ -850,9 +850,9 @@ describe('FormComponent', () => { let formFields = formComponent.form.getFormFields(); let radioFieldById = formFields.find((field) => field.id === 'radio'); - let formValues: any = {}; + const formValues: any = {}; formValues.radio = 'option_3'; - let change = new SimpleChange(null, formValues, false); + const change = new SimpleChange(null, formValues, false); formComponent.data = formValues; formComponent.ngOnChanges({ 'data': change }); diff --git a/lib/core/form/components/form.component.visibility.spec.ts b/lib/core/form/components/form.component.visibility.spec.ts index 1097999108..8d5b18f4d2 100644 --- a/lib/core/form/components/form.component.visibility.spec.ts +++ b/lib/core/form/components/form.component.visibility.spec.ts @@ -78,7 +78,7 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeDefined(); @@ -90,7 +90,7 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefinitionRequiredField)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); expect(fixture.debugElement.query(By.css('#adf-valid-form-icon'))).toBeNull(); @@ -102,7 +102,7 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); component.showValidationIcon = false; fixture.detectChanges(); @@ -117,15 +117,15 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefinitionTwoTextFields)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); - let firstNameEl = fixture.debugElement.query(By.css('#firstname')); + const firstNameEl = fixture.debugElement.query(By.css('#firstname')); expect(firstNameEl).not.toBeNull(); expect(firstNameEl).toBeDefined(); - let lastNameEl = fixture.debugElement.query(By.css('#lastname')); + const lastNameEl = fixture.debugElement.query(By.css('#lastname')); expect(lastNameEl).not.toBeNull(); expect(lastNameEl).toBeDefined(); }); @@ -134,7 +134,7 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefinitionDropdownField)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); @@ -165,14 +165,14 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnNextOne)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); - let firstEl = fixture.debugElement.query(By.css('#field-country-container')); + const firstEl = fixture.debugElement.query(By.css('#field-country-container')); expect(firstEl.nativeElement.hidden).toBeTruthy(); - let secondEl = fixture.debugElement.query(By.css('#name')); + const secondEl = fixture.debugElement.query(By.css('#name')); expect(secondEl).not.toBeNull(); expect(secondEl).toBeDefined(); expect(fixture.nativeElement.querySelector('#field-name-container').hidden).toBeFalsy(); @@ -182,16 +182,16 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnPreviousOne)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); - let firstEl = fixture.debugElement.query(By.css('#name')); + const firstEl = fixture.debugElement.query(By.css('#name')); expect(firstEl).not.toBeNull(); expect(firstEl).toBeDefined(); expect(fixture.nativeElement.querySelector('#field-name-container').hidden).toBeFalsy(); - let secondEl = fixture.debugElement.query(By.css('#field-country-container')); + const secondEl = fixture.debugElement.query(By.css('#field-country-container')); expect(secondEl.nativeElement.hidden).toBeTruthy(); }); @@ -199,7 +199,7 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formDefVisibilitiFieldDependsOnNextOne)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); @@ -209,7 +209,7 @@ describe('FormComponent UI and visibility', () => { const secondEl = fixture.debugElement.query(By.css('#field-name-container')); expect(secondEl.nativeElement.hidden).toBeFalsy(); - let inputElement = fixture.nativeElement.querySelector('#name'); + const inputElement = fixture.nativeElement.querySelector('#name'); inputElement.value = 'italy'; inputElement.dispatchEvent(new Event('input')); fixture.detectChanges(); @@ -224,16 +224,16 @@ describe('FormComponent UI and visibility', () => { spyOn(service, 'getTask').and.returnValue(of({})); spyOn(service, 'getTaskForm').and.returnValue(of(formReadonlyTwoTextFields)); - let change = new SimpleChange(null, 1, true); + const change = new SimpleChange(null, 1, true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); - let firstNameEl = fixture.debugElement.query(By.css('#firstname')); + const firstNameEl = fixture.debugElement.query(By.css('#firstname')); expect(firstNameEl).not.toBeNull(); expect(firstNameEl).toBeDefined(); expect(firstNameEl.nativeElement.value).toEqual('fakeFirstName'); - let lastNameEl = fixture.debugElement.query(By.css('#lastname')); + const lastNameEl = fixture.debugElement.query(By.css('#lastname')); expect(lastNameEl).not.toBeNull(); expect(lastNameEl).toBeDefined(); expect(lastNameEl.nativeElement.value).toEqual('fakeLastName'); diff --git a/lib/core/form/components/start-form.component.ts b/lib/core/form/components/start-form.component.ts index 27127ce780..ed97a64fe4 100644 --- a/lib/core/form/components/start-form.component.ts +++ b/lib/core/form/components/start-form.component.ts @@ -99,14 +99,14 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn } ngOnChanges(changes: SimpleChanges) { - let processDefinitionId = changes['processDefinitionId']; + const processDefinitionId = changes['processDefinitionId']; if (processDefinitionId && processDefinitionId.currentValue) { this.visibilityService.cleanProcessVariable(); this.getStartFormDefinition(processDefinitionId.currentValue); return; } - let processId = changes['processId']; + const processId = changes['processId']; if (processId && processId.currentValue) { this.visibilityService.cleanProcessVariable(); this.loadStartForm(processId.currentValue); diff --git a/lib/core/form/components/widgets/container/container-column.model.spec.ts b/lib/core/form/components/widgets/container/container-column.model.spec.ts index 0ec5bec2d1..0dff52ef7d 100644 --- a/lib/core/form/components/widgets/container/container-column.model.spec.ts +++ b/lib/core/form/components/widgets/container/container-column.model.spec.ts @@ -22,12 +22,12 @@ import { FormModel } from './../core/form.model'; describe('ContainerColumnModel', () => { it('should have max size by default', () => { - let column = new ContainerColumnModel(); + const column = new ContainerColumnModel(); expect(column.size).toBe(12); }); it('should check fields', () => { - let column = new ContainerColumnModel(); + const column = new ContainerColumnModel(); column.fields = null; expect(column.hasFields()).toBeFalsy(); diff --git a/lib/core/form/components/widgets/container/container.widget.model.spec.ts b/lib/core/form/components/widgets/container/container.widget.model.spec.ts index 65c844c638..0ed357cd21 100644 --- a/lib/core/form/components/widgets/container/container.widget.model.spec.ts +++ b/lib/core/form/components/widgets/container/container.widget.model.spec.ts @@ -23,9 +23,9 @@ import { ContainerWidgetComponentModel } from './container.widget.model'; describe('ContainerWidgetComponentModel', () => { it('should store the form reference', () => { - let form = new FormModel(); - let field = new FormFieldModel(form); - let model = new ContainerWidgetComponentModel(field); + const form = new FormModel(); + const field = new FormFieldModel(form); + const model = new ContainerWidgetComponentModel(field); expect(model.form).toBe(form); }); @@ -64,7 +64,7 @@ describe('ContainerWidgetComponentModel', () => { }); it('should be collapsed by default', () => { - let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { + const container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { type: FormFieldTypes.GROUP, params: { allowCollapse: true, diff --git a/lib/core/form/components/widgets/container/container.widget.spec.ts b/lib/core/form/components/widgets/container/container.widget.spec.ts index d1d2749787..9a98ebc028 100644 --- a/lib/core/form/components/widgets/container/container.widget.spec.ts +++ b/lib/core/form/components/widgets/container/container.widget.spec.ts @@ -49,7 +49,7 @@ describe('ContainerWidgetComponent', () => { }); it('should wrap field with model instance', () => { - let field = new FormFieldModel(null); + const field = new FormFieldModel(null); widget.field = field; widget.ngOnInit(); expect(widget.content).toBeDefined(); @@ -57,7 +57,7 @@ describe('ContainerWidgetComponent', () => { }); it('should toggle underlying group container', () => { - let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { + const container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { type: FormFieldTypes.GROUP, params: { allowCollapse: true @@ -74,7 +74,7 @@ describe('ContainerWidgetComponent', () => { }); it('should toggle only collapsible container', () => { - let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { + const container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { type: FormFieldTypes.GROUP })); @@ -87,7 +87,7 @@ describe('ContainerWidgetComponent', () => { it('should toggle only group container', () => { - let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { + const container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { type: FormFieldTypes.CONTAINER, params: { allowCollapse: true @@ -102,8 +102,8 @@ describe('ContainerWidgetComponent', () => { }); it('should send an event when a value is changed in the form', (done) => { - let fakeForm = new FormModel(); - let fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'}); + const fakeForm = new FormModel(); + const fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'}); widget.fieldChanged.subscribe((field) => { expect(field).not.toBe(null); expect(field.id).toBe('fakeField'); @@ -124,7 +124,7 @@ describe('ContainerWidgetComponent', () => { field5 = <FormFieldModel> {id: '5'}, field6 = <FormFieldModel> {id: '6'}; - let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel())); + const container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel())); container.columns = [ <ContainerColumnModel> { fields: [ field1, @@ -157,7 +157,7 @@ describe('ContainerWidgetComponent', () => { describe('getColumnWith', () => { it('should calculate the column width based on the numberOfColumns and current field\'s colspan property', () => { - let container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { numberOfColumns: 4 })); + const container = new ContainerWidgetComponentModel(new FormFieldModel(new FormModel(), { numberOfColumns: 4 })); widget.content = container; expect(widget.getColumnWith(undefined)).toBe('25%'); diff --git a/lib/core/form/components/widgets/container/container.widget.ts b/lib/core/form/components/widgets/container/container.widget.ts index 18cf60ae1a..74bacbffd7 100644 --- a/lib/core/form/components/widgets/container/container.widget.ts +++ b/lib/core/form/components/widgets/container/container.widget.ts @@ -62,7 +62,7 @@ export class ContainerWidgetComponent extends WidgetComponent implements OnInit, while (rowContainsElement) { rowContainsElement = false; for (let i = 0; i < this.content.columns.length; i++ ) { - let field = this.content.columns[i].fields[rowIndex]; + const field = this.content.columns[i].fields[rowIndex]; if (field) { rowContainsElement = true; } diff --git a/lib/core/form/components/widgets/content/content.widget.spec.ts b/lib/core/form/components/widgets/content/content.widget.spec.ts index 422db01b82..6703d5d8d1 100644 --- a/lib/core/form/components/widgets/content/content.widget.spec.ts +++ b/lib/core/form/components/widgets/content/content.widget.spec.ts @@ -41,12 +41,12 @@ describe('ContentWidgetComponent', () => { let serviceContent: ContentService; function createFakeImageBlob() { - let data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='); + const data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='); return new Blob([data], {type: 'image/png'}); } function createFakePdfBlob(): Blob { - let pdfData = atob( + const pdfData = atob( 'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwog' + 'IC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAv' + 'TWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0K' + @@ -99,12 +99,12 @@ describe('ContentWidgetComponent', () => { component.content = new ContentLinkModel(); fixture.detectChanges(); - let content = fixture.debugElement.query(By.css('div.upload-widget__content-thumbnail')); + const content = fixture.debugElement.query(By.css('div.upload-widget__content-thumbnail')); expect(content).toBeDefined(); }); it('should load the thumbnail preview of the png image', (done) => { - let blob = createFakeImageBlob(); + const blob = createFakeImageBlob(); spyOn(processContentService, 'getFileRawContent').and.returnValue(of(blob)); component.thumbnailLoaded.subscribe((res) => { @@ -114,14 +114,14 @@ describe('ContentWidgetComponent', () => { expect(res.changingThisBreaksApplicationSecurity).toContain('blob'); fixture.whenStable() .then(() => { - let thumbnailPreview: any = element.querySelector('#thumbnailPreview'); + const thumbnailPreview: any = element.querySelector('#thumbnailPreview'); expect(thumbnailPreview.src).toContain('blob'); }); done(); }); - let contentId = 1; - let change = new SimpleChange(null, contentId, true); + const contentId = 1; + const change = new SimpleChange(null, contentId, true); component.ngOnChanges({ 'id': change }); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -147,7 +147,7 @@ describe('ContentWidgetComponent', () => { }); it('should load the thumbnail preview of a pdf', (done) => { - let blob = createFakePdfBlob(); + const blob = createFakePdfBlob(); spyOn(processContentService, 'getContentThumbnail').and.returnValue(of(blob)); component.thumbnailLoaded.subscribe((res) => { @@ -157,14 +157,14 @@ describe('ContentWidgetComponent', () => { expect(res.changingThisBreaksApplicationSecurity).toContain('blob'); fixture.whenStable() .then(() => { - let thumbnailPreview: any = element.querySelector('#thumbnailPreview'); + const thumbnailPreview: any = element.querySelector('#thumbnailPreview'); expect(thumbnailPreview.src).toContain('blob'); }); done(); }); - let contentId = 1; - let change = new SimpleChange(null, contentId, true); + const contentId = 1; + const change = new SimpleChange(null, contentId, true); component.ngOnChanges({'id': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -191,15 +191,15 @@ describe('ContentWidgetComponent', () => { it('should show unsupported preview with unsupported file', (done) => { - let contentId = 1; - let change = new SimpleChange(null, contentId, true); + const contentId = 1; + const change = new SimpleChange(null, contentId, true); component.ngOnChanges({'id': change}); component.contentLoaded.subscribe((res) => { fixture.detectChanges(); fixture.whenStable() .then(() => { - let thumbnailPreview: any = element.querySelector('#unsupported-thumbnail'); + const thumbnailPreview: any = element.querySelector('#unsupported-thumbnail'); expect(thumbnailPreview).toBeDefined(); expect(element.querySelector('div.upload-widget__content-text').innerHTML).toEqual('FakeBlob.zip'); }); @@ -229,7 +229,7 @@ describe('ContentWidgetComponent', () => { }); it('should open the viewer when the view button is clicked', (done) => { - let blob = createFakePdfBlob(); + const blob = createFakePdfBlob(); spyOn(processContentService, 'getContentPreview').and.returnValue(of(blob)); spyOn(processContentService, 'getFileRawContent').and.returnValue(of(blob)); @@ -258,12 +258,12 @@ describe('ContentWidgetComponent', () => { }); fixture.detectChanges(); - let viewButton: any = element.querySelector('#view'); + const viewButton: any = element.querySelector('#view'); viewButton.click(); }); it('should download the pdf when the download button is clicked', () => { - let blob = createFakePdfBlob(); + const blob = createFakePdfBlob(); spyOn(processContentService, 'getFileRawContent').and.returnValue(of(blob)); spyOn(serviceContent, 'downloadBlob').and.callThrough(); @@ -285,7 +285,7 @@ describe('ContentWidgetComponent', () => { }); fixture.detectChanges(); - let downloadButton: any = element.querySelector('#download'); + const downloadButton: any = element.querySelector('#download'); downloadButton.click(); fixture.whenStable() diff --git a/lib/core/form/components/widgets/core/container.model.spec.ts b/lib/core/form/components/widgets/core/container.model.spec.ts index 6c7909c7dc..c5c0d37d24 100644 --- a/lib/core/form/components/widgets/core/container.model.spec.ts +++ b/lib/core/form/components/widgets/core/container.model.spec.ts @@ -22,8 +22,8 @@ import { FormModel } from './form.model'; describe('ContainerModel', () => { it('should store the form reference', () => { - let form = new FormModel(); - let model = new ContainerModel(new FormFieldModel(form)); + const form = new FormModel(); + const model = new ContainerModel(new FormFieldModel(form)); expect(model.form).toBe(form); }); diff --git a/lib/core/form/components/widgets/core/error-message.model.ts b/lib/core/form/components/widgets/core/error-message.model.ts index be5fa7af00..63b62d9bbf 100644 --- a/lib/core/form/components/widgets/core/error-message.model.ts +++ b/lib/core/form/components/widgets/core/error-message.model.ts @@ -34,7 +34,7 @@ export class ErrorMessageModel { getAttributesAsJsonObj() { let result = {}; if (this.attributes.size > 0) { - let obj = Object.create(null); + const obj = Object.create(null); this.attributes.forEach((value, key) => { obj[key] = value; }); diff --git a/lib/core/form/components/widgets/core/form-field-validator.spec.ts b/lib/core/form/components/widgets/core/form-field-validator.spec.ts index cd9524046a..e701b80456 100644 --- a/lib/core/form/components/widgets/core/form-field-validator.spec.ts +++ b/lib/core/form/components/widgets/core/form-field-validator.spec.ts @@ -45,7 +45,7 @@ describe('FormFieldValidator', () => { }); it('should require [required] setting', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, value: '<value>' }); @@ -60,12 +60,12 @@ describe('FormFieldValidator', () => { }); it('should skip unsupported type', () => { - let field = new FormFieldModel(new FormModel(), { type: 'wrong-type' }); + const field = new FormFieldModel(new FormModel(), { type: 'wrong-type' }); expect(validator.validate(field)).toBeTruthy(); }); it('should fail for dropdown with empty value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DROPDOWN, value: '<empty>', hasEmptyValue: true, @@ -80,7 +80,7 @@ describe('FormFieldValidator', () => { }); it('should fail for radio buttons', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.RADIO_BUTTONS, required: true, options: [{ id: 'two', name: 'two' }] @@ -91,7 +91,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for radio buttons', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.RADIO_BUTTONS, required: true, value: 'two', @@ -102,7 +102,7 @@ describe('FormFieldValidator', () => { }); it('should fail for upload', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.UPLOAD, value: null, required: true @@ -116,7 +116,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for upload', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.UPLOAD, value: [{}], required: true @@ -126,7 +126,7 @@ describe('FormFieldValidator', () => { }); it('should fail for text', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, value: null, required: true @@ -140,7 +140,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for date', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATE, value: '2016-12-31', required: true @@ -150,7 +150,7 @@ describe('FormFieldValidator', () => { }); it('should fail for date', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATE, value: null, required: true @@ -164,7 +164,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for text', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, value: '<value>', required: true @@ -174,7 +174,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for check box', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.BOOLEAN, required: true, value: true, @@ -185,7 +185,7 @@ describe('FormFieldValidator', () => { }); it('should fail for check box', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.BOOLEAN, required: true, value: false, @@ -224,7 +224,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty number value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: null }); @@ -233,7 +233,7 @@ describe('FormFieldValidator', () => { }); it('should allow number value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: 44 }); @@ -242,7 +242,7 @@ describe('FormFieldValidator', () => { }); it('should allow zero number value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: 0 }); @@ -251,7 +251,7 @@ describe('FormFieldValidator', () => { }); it('should fail for wrong number value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: '<value>' }); @@ -272,7 +272,7 @@ describe('FormFieldValidator', () => { }); it('should require minLength defined', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT }); @@ -283,7 +283,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, minLength: 10, value: null @@ -293,7 +293,7 @@ describe('FormFieldValidator', () => { }); it('should succeed text validation', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, minLength: 3, value: '1234' @@ -303,7 +303,7 @@ describe('FormFieldValidator', () => { }); it('should fail text validation', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, minLength: 3, value: '12' @@ -325,7 +325,7 @@ describe('FormFieldValidator', () => { }); it('should require maxLength defined', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT }); @@ -336,7 +336,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, maxLength: 10, value: null @@ -346,7 +346,7 @@ describe('FormFieldValidator', () => { }); it('should succeed text validation', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, maxLength: 3, value: '123' @@ -356,7 +356,7 @@ describe('FormFieldValidator', () => { }); it('should fail text validation', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, maxLength: 3, value: '1234' @@ -377,7 +377,7 @@ describe('FormFieldValidator', () => { }); it('should require minValue defined', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER }); expect(validator.isSupported(field)).toBeFalsy(); @@ -387,7 +387,7 @@ describe('FormFieldValidator', () => { }); it('should support numeric widgets only', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, minValue: '1' }); @@ -399,7 +399,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: null, minValue: '1' @@ -409,7 +409,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for unsupported types', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT }); @@ -417,7 +417,7 @@ describe('FormFieldValidator', () => { }); it('should succeed validating value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: '10', minValue: '10' @@ -427,7 +427,7 @@ describe('FormFieldValidator', () => { }); it('should fail validating value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: '9', minValue: '10' @@ -449,7 +449,7 @@ describe('FormFieldValidator', () => { }); it('should require maxValue defined', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER }); expect(validator.isSupported(field)).toBeFalsy(); @@ -459,7 +459,7 @@ describe('FormFieldValidator', () => { }); it('should support numeric widgets only', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, maxValue: '1' }); @@ -471,7 +471,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: null, maxValue: '1' @@ -481,7 +481,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for unsupported types', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT }); @@ -489,7 +489,7 @@ describe('FormFieldValidator', () => { }); it('should succeed validating value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: '10', maxValue: '10' @@ -499,7 +499,7 @@ describe('FormFieldValidator', () => { }); it('should fail validating value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.NUMBER, value: '11', maxValue: '10' @@ -521,7 +521,7 @@ describe('FormFieldValidator', () => { }); it('should require regex pattern to be defined', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT }); expect(validator.isSupported(field)).toBeFalsy(); @@ -531,7 +531,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, value: null, regexPattern: 'pattern' @@ -541,7 +541,7 @@ describe('FormFieldValidator', () => { }); it('should succeed validating regex', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, value: 'pattern', regexPattern: 'pattern' @@ -551,7 +551,7 @@ describe('FormFieldValidator', () => { }); it('should fail validating regex', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT, value: 'some value', regexPattern: 'pattern' @@ -584,7 +584,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TYPEAHEAD, value: null, regexPattern: 'pattern' @@ -594,7 +594,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for a valid input value in options', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TYPEAHEAD, value: '1', options: [{id: '1', name: 'Leanne Graham'}, {id: '2', name: 'Ervin Howell'}] @@ -604,7 +604,7 @@ describe('FormFieldValidator', () => { }); it('should fail for an invalid input value in options', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TYPEAHEAD, value: 'Lean', options: [{id: '1', name: 'Leanne Graham'}, {id: '2', name: 'Ervin Howell'}] @@ -624,7 +624,7 @@ describe('FormFieldValidator', () => { }); it('should require maxValue defined', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME }); expect(validator.isSupported(field)).toBeFalsy(); @@ -634,7 +634,7 @@ describe('FormFieldValidator', () => { }); it('should support date time widgets only', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, maxValue: '9999-02-08 10:10 AM' }); @@ -646,7 +646,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: null, maxValue: '9999-02-08 10:10 AM' @@ -656,7 +656,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for unsupported types', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT }); @@ -669,7 +669,7 @@ describe('FormFieldValidator', () => { const localValidValue = '2018-3-30 11:59 PM'; - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: localValidValue, maxValue: maxValueSavedInForm @@ -682,9 +682,9 @@ describe('FormFieldValidator', () => { const maxValueFromActivitiInput = '31-3-2018 12:00 AM'; const maxValueSavedInForm = moment(maxValueFromActivitiInput, 'DD-M-YYYY hh:mm A').utc().format(); - let localInvalidValue = '2018-3-31 12:01 AM'; + const localInvalidValue = '2018-3-31 12:01 AM'; - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: localInvalidValue, maxValue: maxValueSavedInForm @@ -697,7 +697,7 @@ describe('FormFieldValidator', () => { }); it('should succeed validating value checking the time', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '08-02-9999 09:10 AM', maxValue: '9999-02-08 10:10 AM' @@ -707,7 +707,7 @@ describe('FormFieldValidator', () => { }); it('should fail validating value checking the time', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '08-02-9999 11:10 AM', maxValue: '9999-02-08 10:10 AM' @@ -719,7 +719,7 @@ describe('FormFieldValidator', () => { }); it('should succeed validating value checking the date', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '08-02-9999 09:10 AM', maxValue: '9999-02-08 10:10 AM' @@ -729,7 +729,7 @@ describe('FormFieldValidator', () => { }); it('should fail validating value checking the date', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '08-02-9999 12:10 AM', maxValue: '9999-02-07 10:10 AM' @@ -751,7 +751,7 @@ describe('FormFieldValidator', () => { }); it('should require minValue defined', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME }); expect(validator.isSupported(field)).toBeFalsy(); @@ -761,7 +761,7 @@ describe('FormFieldValidator', () => { }); it('should support date time widgets only', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, minValue: '9999-02-08 09:10 AM' }); @@ -773,7 +773,7 @@ describe('FormFieldValidator', () => { }); it('should allow empty values', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: null, minValue: '9999-02-08 09:10 AM' @@ -783,7 +783,7 @@ describe('FormFieldValidator', () => { }); it('should succeed for unsupported types', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.TEXT }); @@ -796,7 +796,7 @@ describe('FormFieldValidator', () => { const localValidValue = '2018-3-02 06:01 AM'; - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: localValidValue, minValue: minValueSavedInForm @@ -809,9 +809,9 @@ describe('FormFieldValidator', () => { const minValueFromActivitiInput = '02-3-2018 06:00 AM'; const minValueSavedInForm = moment(minValueFromActivitiInput, 'DD-M-YYYY hh:mm A').utc().format(); - let localInvalidValue = '2018-3-02 05:59 AM'; + const localInvalidValue = '2018-3-02 05:59 AM'; - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: localInvalidValue, minValue: minValueSavedInForm @@ -824,7 +824,7 @@ describe('FormFieldValidator', () => { }); it('should succeed validating value by time', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '08-02-9999 09:10 AM', minValue: '9999-02-08 09:00 AM' @@ -834,7 +834,7 @@ describe('FormFieldValidator', () => { }); it('should succeed validating value by date', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '09-02-9999 09:10 AM', minValue: '9999-02-08 09:10 AM' @@ -844,7 +844,7 @@ describe('FormFieldValidator', () => { }); it('should fail validating value by time', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '08-02-9999 09:00 AM', minValue: '9999-02-08 09:10 AM' @@ -856,7 +856,7 @@ describe('FormFieldValidator', () => { }); it('should fail validating value by date', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DATETIME, value: '07-02-9999 09:10 AM', minValue: '9999-02-08 09:10 AM' diff --git a/lib/core/form/components/widgets/core/form-field-validator.ts b/lib/core/form/components/widgets/core/form-field-validator.ts index 4e3e1a59f7..8795a03846 100644 --- a/lib/core/form/components/widgets/core/form-field-validator.ts +++ b/lib/core/form/components/widgets/core/form-field-validator.ts @@ -66,7 +66,7 @@ export class RequiredFieldValidator implements FormFieldValidator { } if (field.type === FormFieldTypes.RADIO_BUTTONS) { - let option = field.options.find((opt) => opt.id === field.value); + const option = field.options.find((opt) => opt.id === field.value); return !!option; } @@ -117,7 +117,7 @@ export class NumberFieldValidator implements FormFieldValidator { field.value === '') { return true; } - let valueStr = '' + field.value; + const valueStr = '' + field.value; let pattern = new RegExp(/^-?\d+$/); if (field.enableFractions) { pattern = new RegExp(/^-?[0-9]+(\.[0-9]{1,2})?$/); @@ -141,7 +141,7 @@ export class DateFieldValidator implements FormFieldValidator { // Validates that the input string is a valid date formatted as <dateFormat> (default D-M-YYYY) static isValidDate(inputDate: string, dateFormat: string = 'D-M-YYYY'): boolean { if (inputDate) { - let d = moment(inputDate, dateFormat, true); + const d = moment(inputDate, dateFormat, true); return d.isValid(); } @@ -200,7 +200,7 @@ export class MinDateFieldValidator implements FormFieldValidator { } else { fieldValueData = field.value; } - let min = moment(field.minValue, MIN_DATE_FORMAT); + const min = moment(field.minValue, MIN_DATE_FORMAT); if (fieldValueData.isBefore(min)) { field.validationSummary.message = `FORM.FIELD.VALIDATOR.NOT_LESS_THAN`; @@ -240,7 +240,7 @@ export class MaxDateFieldValidator implements FormFieldValidator { } else { d = field.value; } - let max = moment(field.maxValue, this.MAX_DATE_FORMAT); + const max = moment(field.maxValue, this.MAX_DATE_FORMAT); if (d.isAfter(max)) { field.validationSummary.message = `FORM.FIELD.VALIDATOR.NOT_GREATER_THAN`; @@ -287,7 +287,7 @@ export class MinDateTimeFieldValidator implements FormFieldValidator { } else { fieldValueDate = field.value; } - let min = moment(field.minValue, this.MIN_DATETIME_FORMAT); + const min = moment(field.minValue, this.MIN_DATETIME_FORMAT); if (fieldValueDate.isBefore(min)) { field.validationSummary.message = `FORM.FIELD.VALIDATOR.NOT_LESS_THAN`; @@ -334,7 +334,7 @@ export class MaxDateTimeFieldValidator implements FormFieldValidator { } else { fieldValueDate = field.value; } - let max = moment(field.maxValue, this.MAX_DATETIME_FORMAT); + const max = moment(field.maxValue, this.MAX_DATETIME_FORMAT); if (fieldValueDate.isAfter(max)) { field.validationSummary.message = `FORM.FIELD.VALIDATOR.NOT_GREATER_THAN`; @@ -412,8 +412,8 @@ export class MinValueFieldValidator implements FormFieldValidator { validate(field: FormFieldModel): boolean { if (this.isSupported(field) && field.value && field.isVisible) { - let value: number = +field.value; - let minValue: number = +field.minValue; + const value: number = +field.value; + const minValue: number = +field.minValue; if (value >= minValue) { return true; @@ -442,8 +442,8 @@ export class MaxValueFieldValidator implements FormFieldValidator { validate(field: FormFieldModel): boolean { if (this.isSupported(field) && field.value && field.isVisible) { - let value: number = +field.value; - let maxValue: number = +field.maxValue; + const value: number = +field.value; + const maxValue: number = +field.maxValue; if (value <= maxValue) { return true; diff --git a/lib/core/form/components/widgets/core/form-field.model.spec.ts b/lib/core/form/components/widgets/core/form-field.model.spec.ts index 27f1a866c5..69d0c99e46 100644 --- a/lib/core/form/components/widgets/core/form-field.model.spec.ts +++ b/lib/core/form/components/widgets/core/form-field.model.spec.ts @@ -22,19 +22,19 @@ import { FormModel } from './form.model'; describe('FormFieldModel', () => { it('should store the form reference', () => { - let form = new FormModel(); - let model = new FormFieldModel(form); + const form = new FormModel(); + const model = new FormFieldModel(form); expect(model.form).toBe(form); }); it('should store original json', () => { - let json = {}; - let model = new FormFieldModel(new FormModel(), json); + const json = {}; + const model = new FormFieldModel(new FormModel(), json); expect(model.json).toBe(json); }); it('should setup with json config', () => { - let json = { + const json = { fieldType: '<fieldType>', id: '<id>', name: '<name>', @@ -57,7 +57,7 @@ describe('FormFieldModel', () => { displayText: '<text>', value: '<value>' }; - let field = new FormFieldModel(new FormModel(), json); + const field = new FormFieldModel(new FormModel(), json); Object.keys(json).forEach((key) => { expect(field[key]).toBe(json[key]); }); @@ -82,9 +82,9 @@ describe('FormFieldModel', () => { }); it('should update form on every value change', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, {id: 'field1'}); - let value = 10; + const form = new FormModel(); + const field = new FormFieldModel(form, {id: 'field1'}); + const value = 10; spyOn(field, 'updateForm').and.callThrough(); field.value = value; @@ -95,8 +95,8 @@ describe('FormFieldModel', () => { }); it('should get form readonly state', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, null); + const form = new FormModel(); + const field = new FormFieldModel(form, null); expect(field.readOnly).toBeFalsy(); form.readOnly = true; @@ -104,15 +104,15 @@ describe('FormFieldModel', () => { }); it('should take own readonly state if form is writable', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, {readOnly: true}); + const form = new FormModel(); + const field = new FormFieldModel(form, {readOnly: true}); expect(form.readOnly).toBeFalsy(); expect(field.readOnly).toBeTruthy(); }); it('should parse and leave dropdown value as is', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DROPDOWN, options: [], value: 'deferred' @@ -122,8 +122,8 @@ describe('FormFieldModel', () => { }); it('should parse the date with the default format (D-M-YYYY) if the display format is missing', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { fieldType: 'FormFieldRepresentation', id: 'mmddyyyy', name: 'MM-DD-YYYY', @@ -147,8 +147,8 @@ describe('FormFieldModel', () => { }); it('should parse the date with the format MM-DD-YYYY', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { fieldType: 'FormFieldRepresentation', id: 'mmddyyyy', name: 'MM-DD-YYYY', @@ -173,8 +173,8 @@ describe('FormFieldModel', () => { }); it('should parse the date with the format MM-YY-DD', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { fieldType: 'FormFieldRepresentation', id: 'mmyydd', name: 'MM-YY-DD', @@ -199,8 +199,8 @@ describe('FormFieldModel', () => { }); it('should parse the date with the format DD-MM-YYYY', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { fieldType: 'FormFieldRepresentation', id: 'ddmmyyy', name: 'DD-MM-YYYY', @@ -225,8 +225,8 @@ describe('FormFieldModel', () => { }); it('should parse the date with the format DD-MM-YYYY when it is readonly', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { fieldType: 'FormFieldRepresentation', id: 'ddmmyyy', name: 'DD-MM-YYYY', @@ -250,7 +250,7 @@ describe('FormFieldModel', () => { }); it('should return the label of selected dropdown value ', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.DROPDOWN, options: [ {id: 'fake-option-1', name: 'fake label 1'}, @@ -263,7 +263,7 @@ describe('FormFieldModel', () => { }); it('should parse and resolve radio button value', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.RADIO_BUTTONS, options: [ {id: 'opt1', name: 'Option 1'}, @@ -276,7 +276,7 @@ describe('FormFieldModel', () => { }); it('should parse and leave radio button value as is', () => { - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { type: FormFieldTypes.RADIO_BUTTONS, options: [], value: 'deferred-radio' @@ -285,8 +285,8 @@ describe('FormFieldModel', () => { }); it('should update form with empty dropdown value', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { id: 'dropdown-1', type: FormFieldTypes.DROPDOWN }); @@ -299,8 +299,8 @@ describe('FormFieldModel', () => { }); it('should update form with dropdown value', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { id: 'dropdown-2', type: FormFieldTypes.DROPDOWN, options: [ @@ -314,8 +314,8 @@ describe('FormFieldModel', () => { }); it('should update form with radio button value', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { id: 'radio-1', type: FormFieldTypes.RADIO_BUTTONS, options: [ @@ -329,8 +329,8 @@ describe('FormFieldModel', () => { }); it('radio button value should be null when no default is set', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { id: 'radio-2', type: FormFieldTypes.RADIO_BUTTONS, options: [ @@ -344,10 +344,10 @@ describe('FormFieldModel', () => { }); it('should not update form with display-only field value', () => { - let form = new FormModel(); + const form = new FormModel(); FormFieldTypes.READONLY_TYPES.forEach((typeName) => { - let field = new FormFieldModel(form, { + const field = new FormFieldModel(form, { id: typeName, type: typeName }); @@ -358,8 +358,8 @@ describe('FormFieldModel', () => { }); it('should be able to check if the field has options available', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { id: 'dropdown-happy', type: FormFieldTypes.DROPDOWN, options: [ @@ -372,8 +372,8 @@ describe('FormFieldModel', () => { }); it('should return false if field has no options', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { id: 'dropdown-sad', type: FormFieldTypes.DROPDOWN }); @@ -382,8 +382,8 @@ describe('FormFieldModel', () => { }); it('should calculate the columns in case of container type', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { type: FormFieldTypes.CONTAINER, numberOfColumns: 888 }); @@ -392,8 +392,8 @@ describe('FormFieldModel', () => { }); it('should calculate the columns in case of group type', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { type: FormFieldTypes.GROUP, numberOfColumns: 999 }); diff --git a/lib/core/form/components/widgets/core/form-field.model.ts b/lib/core/form/components/widgets/core/form-field.model.ts index 96f4c7f25c..56a6cc9e71 100644 --- a/lib/core/form/components/widgets/core/form-field.model.ts +++ b/lib/core/form/components/widgets/core/form-field.model.ts @@ -121,8 +121,8 @@ export class FormFieldModel extends FormWidgetModel { this.validationSummary = new ErrorMessageModel(); if (!this.readOnly) { - let validators = this.form.fieldValidators || []; - for (let validator of validators) { + const validators = this.form.fieldValidators || []; + for (const validator of validators) { if (!validator.validate(this)) { this._isValid = false; return this._isValid; @@ -229,7 +229,7 @@ export class FormFieldModel extends FormWidgetModel { } private getVariablesValue(variableName: string, form: FormModel) { - let variable = form.json.variables.find((currentVariable) => { + const variable = form.json.variables.find((currentVariable) => { return currentVariable.name === variableName; }); @@ -267,11 +267,11 @@ export class FormFieldModel extends FormWidgetModel { this.colspan = 1; if (json.fields) { - for (let currentField in json.fields) { + for (const currentField in json.fields) { if (json.fields.hasOwnProperty(currentField)) { - let col = new ContainerColumnModel(); + const col = new ContainerColumnModel(); - let fields: FormFieldModel[] = (json.fields[currentField] || []).map((f) => new FormFieldModel(form, f)); + const fields: FormFieldModel[] = (json.fields[currentField] || []).map((f) => new FormFieldModel(form, f)); col.fields = fields; col.rowspan = json.fields[currentField].length; @@ -295,9 +295,9 @@ export class FormFieldModel extends FormWidgetModel { */ if (json.type === FormFieldTypes.DROPDOWN) { if (json.hasEmptyValue && json.options) { - let options = <FormFieldOption[]> json.options || []; + const options = <FormFieldOption[]> json.options || []; if (options.length > 0) { - let emptyOption = json.options[0]; + const emptyOption = json.options[0]; if (value === '' || value === emptyOption.id || value === emptyOption.name) { value = emptyOption.id; } else if (value.id && value.name) { @@ -315,7 +315,7 @@ export class FormFieldModel extends FormWidgetModel { // Activiti has a bug with default radio button value where initial selection passed as `name` value // so try resolving current one with a fallback to first entry via name or id // TODO: needs to be reported and fixed at Activiti side - let entry: FormFieldOption[] = this.options.filter((opt) => + const entry: FormFieldOption[] = this.options.filter((opt) => opt.id === value || opt.name === value || (value && (opt.id === value.id || opt.name === value.name))); if (entry.length > 0) { value = entry[0].id; @@ -357,7 +357,7 @@ export class FormFieldModel extends FormWidgetModel { if (this.value === 'empty' || this.value === '') { this.form.values[this.id] = {}; } else { - let entry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value); + const entry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value); if (entry.length > 0) { this.form.values[this.id] = entry[0]; } @@ -368,7 +368,7 @@ export class FormFieldModel extends FormWidgetModel { This is needed due to Activiti issue related to reading radio button values as value string but saving back as object: { id: <id>, name: <name> } */ - let rbEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value); + const rbEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value); if (rbEntry.length > 0) { this.form.values[this.id] = rbEntry[0]; } @@ -381,7 +381,7 @@ export class FormFieldModel extends FormWidgetModel { } break; case FormFieldTypes.TYPEAHEAD: - let taEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value || opt.name === this.value); + const taEntry: FormFieldOption[] = this.options.filter((opt) => opt.id === this.value || opt.name === this.value); if (taEntry.length > 0) { this.form.values[this.id] = taEntry[0]; } else if (this.options.length > 0) { @@ -389,7 +389,7 @@ export class FormFieldModel extends FormWidgetModel { } break; case FormFieldTypes.DATE: - let dateValue = moment(this.value, this.dateDisplayFormat, true); + const dateValue = moment(this.value, this.dateDisplayFormat, true); if (dateValue && dateValue.isValid()) { this.form.values[this.id] = `${dateValue.format('YYYY-MM-DD')}T00:00:00.000Z`; } else { @@ -435,7 +435,7 @@ export class FormFieldModel extends FormWidgetModel { } getOptionName(): string { - let option: FormFieldOption = this.options.find((opt) => opt.id === this.value); + const option: FormFieldOption = this.options.find((opt) => opt.id === this.value); return option ? option.name : null; } diff --git a/lib/core/form/components/widgets/core/form-outcome.model.spec.ts b/lib/core/form/components/widgets/core/form-outcome.model.spec.ts index a9891a823c..4bcde60ba7 100644 --- a/lib/core/form/components/widgets/core/form-outcome.model.spec.ts +++ b/lib/core/form/components/widgets/core/form-outcome.model.spec.ts @@ -21,24 +21,24 @@ import { FormModel } from './form.model'; describe('FormOutcomeModel', () => { it('should setup with json config', () => { - let json = { + const json = { id: '<id>', name: '<name>' }; - let model = new FormOutcomeModel(null, json); + const model = new FormOutcomeModel(null, json); expect(model.id).toBe(json.id); expect(model.name).toBe(json.name); }); it('should store the form reference', () => { - let form = new FormModel(); - let model = new FormOutcomeModel(form); + const form = new FormModel(); + const model = new FormOutcomeModel(form); expect(model.form).toBe(form); }); it('should store original json', () => { - let json = {}; - let model = new FormOutcomeModel(null, json); + const json = {}; + const model = new FormOutcomeModel(null, json); expect(model.json).toBe(json); }); diff --git a/lib/core/form/components/widgets/core/form-widget.model.spec.ts b/lib/core/form/components/widgets/core/form-widget.model.spec.ts index 200fecb17a..293ae59b9d 100644 --- a/lib/core/form/components/widgets/core/form-widget.model.spec.ts +++ b/lib/core/form/components/widgets/core/form-widget.model.spec.ts @@ -27,14 +27,14 @@ describe('FormWidgetModel', () => { } it('should store the form reference', () => { - let form = new FormModel(); - let model = new FormWidgetModelMock(form, null); + const form = new FormModel(); + const model = new FormWidgetModelMock(form, null); expect(model.form).toBe(form); }); it('should store original json', () => { - let json = {}; - let model = new FormWidgetModelMock(null, json); + const json = {}; + const model = new FormWidgetModelMock(null, json); expect(model.json).toBe(json); }); diff --git a/lib/core/form/components/widgets/core/form.model.spec.ts b/lib/core/form/components/widgets/core/form.model.spec.ts index c925fcf5f6..5ada0ac272 100644 --- a/lib/core/form/components/widgets/core/form.model.spec.ts +++ b/lib/core/form/components/widgets/core/form.model.spec.ts @@ -35,19 +35,19 @@ describe('FormModel', () => { }); it('should store original json', () => { - let json = {}; - let form = new FormModel(json); + const json = {}; + const form = new FormModel(json); expect(form.json).toBe(json); }); it('should setup properties with json', () => { - let json = { + const json = { id: '<id>', name: '<name>', taskId: '<task-id>', taskName: '<task-name>' }; - let form = new FormModel(json); + const form = new FormModel(json); Object.keys(json).forEach((key) => { expect(form[key]).toEqual(form[key]); @@ -55,26 +55,26 @@ describe('FormModel', () => { }); it('should take form name when task name is missing', () => { - let json = { + const json = { id: '<id>', name: '<name>' }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.taskName).toBe(json.name); }); it('should use fallback value for task name', () => { - let form = new FormModel({}); + const form = new FormModel({}); expect(form.taskName).toBe(FormModel.UNSET_TASK_NAME); }); it('should set readonly state from params', () => { - let form = new FormModel({}, null, true); + const form = new FormModel({}, null, true); expect(form.readOnly).toBeTruthy(); }); it('should check tabs', () => { - let form = new FormModel(); + const form = new FormModel(); form.tabs = null; expect(form.hasTabs()).toBeFalsy(); @@ -87,7 +87,7 @@ describe('FormModel', () => { }); it('should check fields', () => { - let form = new FormModel(); + const form = new FormModel(); form.fields = null; expect(form.hasFields()).toBeFalsy(); @@ -95,13 +95,13 @@ describe('FormModel', () => { form.fields = []; expect(form.hasFields()).toBeFalsy(); - let field = new FormFieldModel(form); + const field = new FormFieldModel(form); form.fields = [new ContainerModel(field)]; expect(form.hasFields()).toBeTruthy(); }); it('should check outcomes', () => { - let form = new FormModel(); + const form = new FormModel(); form.outcomes = null; expect(form.hasOutcomes()).toBeFalsy(); @@ -114,21 +114,21 @@ describe('FormModel', () => { }); it('should parse tabs', () => { - let json = { + const json = { tabs: [ { id: 'tab1' }, { id: 'tab2' } ] }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.tabs.length).toBe(2); expect(form.tabs[0].id).toBe('tab1'); expect(form.tabs[1].id).toBe('tab2'); }); it('should parse fields', () => { - let json = { + const json = { fields: [ { id: 'field1', @@ -141,14 +141,14 @@ describe('FormModel', () => { ] }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.fields.length).toBe(2); expect(form.fields[0].id).toBe('field1'); expect(form.fields[1].id).toBe('field2'); }); it('should parse fields from the definition', () => { - let json = { + const json = { fields: null, formDefinition: { fields: [ @@ -164,24 +164,24 @@ describe('FormModel', () => { } }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.fields.length).toBe(2); expect(form.fields[0].id).toBe('field1'); expect(form.fields[1].id).toBe('field2'); }); it('should convert missing fields to empty collection', () => { - let json = { + const json = { fields: null }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.fields).toBeDefined(); expect(form.fields.length).toBe(0); }); it('should put fields into corresponding tabs', () => { - let json = { + const json = { tabs: [ { id: 'tab1' }, { id: 'tab2' } @@ -194,28 +194,28 @@ describe('FormModel', () => { ] }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.tabs.length).toBe(2); expect(form.fields.length).toBe(4); - let tab1 = form.tabs[0]; + const tab1 = form.tabs[0]; expect(tab1.fields.length).toBe(2); expect(tab1.fields[0].id).toBe('field1'); expect(tab1.fields[1].id).toBe('field3'); - let tab2 = form.tabs[1]; + const tab2 = form.tabs[1]; expect(tab2.fields.length).toBe(1); expect(tab2.fields[0].id).toBe('field2'); }); it('should create standard form outcomes', () => { - let json = { + const json = { fields: [ { id: 'container1' } ] }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.outcomes.length).toBe(3); expect(form.outcomes[0].id).toBe(FormModel.SAVE_OUTCOME); @@ -229,15 +229,15 @@ describe('FormModel', () => { }); it('should create outcomes only when fields available', () => { - let json = { + const json = { fields: null }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.outcomes.length).toBe(0); }); it('should use custom form outcomes', () => { - let json = { + const json = { fields: [ { id: 'container1' } ], @@ -246,7 +246,7 @@ describe('FormModel', () => { ] }; - let form = new FormModel(json); + const form = new FormModel(json); expect(form.outcomes.length).toBe(2); expect(form.outcomes[0].id).toBe(FormModel.SAVE_OUTCOME); @@ -381,7 +381,7 @@ describe('FormModel', () => { spyOn(form, 'getFormFields').and.returnValue([testField]); - let validator = <FormFieldValidator> { + const validator = <FormFieldValidator> { isSupported(field: FormFieldModel): boolean { return true; }, diff --git a/lib/core/form/components/widgets/core/form.model.ts b/lib/core/form/components/widgets/core/form.model.ts index 2b9f9c3097..e845a66dc6 100644 --- a/lib/core/form/components/widgets/core/form.model.ts +++ b/lib/core/form/components/widgets/core/form.model.ts @@ -95,12 +95,12 @@ export class FormModel { this.selectedOutcome = json.selectedOutcome || {}; this.className = json.className || ''; - let tabCache: FormWidgetModelCache<TabModel> = {}; + const tabCache: FormWidgetModelCache<TabModel> = {}; this.processVariables = json.processVariables; this.tabs = (json.tabs || []).map((t) => { - let model = new TabModel(this, t); + const model = new TabModel(this, t); tabCache[model.id] = model; return model; }); @@ -112,9 +112,9 @@ export class FormModel { } for (let i = 0; i < this.fields.length; i++) { - let field = this.fields[i]; + const field = this.fields[i]; if (field.tab) { - let tab = tabCache[field.tab]; + const tab = tabCache[field.tab]; if (tab) { tab.fields.push(field); } @@ -122,23 +122,23 @@ export class FormModel { } if (json.fields) { - let saveOutcome = new FormOutcomeModel(this, { + const saveOutcome = new FormOutcomeModel(this, { id: FormModel.SAVE_OUTCOME, name: 'SAVE', isSystem: true }); - let completeOutcome = new FormOutcomeModel(this, { + const completeOutcome = new FormOutcomeModel(this, { id: FormModel.COMPLETE_OUTCOME, name: 'COMPLETE', isSystem: true }); - let startProcessOutcome = new FormOutcomeModel(this, { + const startProcessOutcome = new FormOutcomeModel(this, { id: FormModel.START_PROCESS_OUTCOME, name: 'START PROCESS', isSystem: true }); - let customOutcomes = (json.outcomes || []).map((obj) => new FormOutcomeModel(this, obj)); + const customOutcomes = (json.outcomes || []).map((obj) => new FormOutcomeModel(this, obj)); this.outcomes = [saveOutcome].concat( customOutcomes.length > 0 ? customOutcomes : [completeOutcome, startProcessOutcome] @@ -162,13 +162,13 @@ export class FormModel { // TODO: consider evaluating and caching once the form is loaded getFormFields(): FormFieldModel[] { - let formFieldModel: FormFieldModel[] = []; + const formFieldModel: FormFieldModel[] = []; for (let i = 0; i < this.fields.length; i++) { - let field = this.fields[i]; + const field = this.fields[i]; if (field instanceof ContainerModel) { - let container = <ContainerModel> field; + const container = <ContainerModel> field; formFieldModel.push(container.field); container.field.columns.forEach((column) => { @@ -192,9 +192,9 @@ export class FormModel { validateForm(): void { const validateFormEvent: any = new ValidateFormEvent(this); - let errorsField: FormFieldModel[] = []; + const errorsField: FormFieldModel[] = []; - let fields = this.getFormFields(); + const fields = this.getFormFields(); for (let i = 0; i < fields.length; i++) { if (!fields[i].validate()) { errorsField.push(fields[i]); @@ -254,13 +254,13 @@ export class FormModel { fields = json.formDefinition.fields; } - let formWidgetModel: FormWidgetModel[] = []; + const formWidgetModel: FormWidgetModel[] = []; - for (let field of fields) { + for (const field of fields) { if (field.type === FormFieldTypes.DISPLAY_VALUE) { // workaround for dynamic table on a completed/readonly form if (field.params) { - let originalField = field.params['field']; + const originalField = field.params['field']; if (originalField.type === FormFieldTypes.DYNAMIC_TABLE) { formWidgetModel.push(new ContainerModel(new FormFieldModel(this, field))); } @@ -276,7 +276,7 @@ export class FormModel { // Loads external data and overrides field values // Typically used when form definition and form data coming from different sources private loadData(formValues: FormValues) { - for (let field of this.getFormFields()) { + for (const field of this.getFormFields()) { if (formValues[field.id]) { field.json.value = formValues[field.id]; field.value = field.parseValue(field.json); diff --git a/lib/core/form/components/widgets/core/tab.model.spec.ts b/lib/core/form/components/widgets/core/tab.model.spec.ts index 342f270418..f93f28a0eb 100644 --- a/lib/core/form/components/widgets/core/tab.model.spec.ts +++ b/lib/core/form/components/widgets/core/tab.model.spec.ts @@ -23,20 +23,20 @@ import { TabModel } from './tab.model'; describe('TabModel', () => { it('should setup with json config', () => { - let json = { + const json = { id: '<id>', title: '<title>', visibilityCondition: '<condition>' }; - let model = new TabModel(null, json); + const model = new TabModel(null, json); expect(model.id).toBe(json.id); expect(model.title).toBe(json.title); expect(model.isVisible).toBe(true); }); it('should not setup with json config', () => { - let model = new TabModel(null, null); + const model = new TabModel(null, null); expect(model.id).toBeUndefined(); expect(model.title).toBeUndefined(); expect(model.isVisible).toBeDefined(); @@ -45,7 +45,7 @@ describe('TabModel', () => { }); it('should evaluate content based on fields', () => { - let model = new TabModel(null, null); + const model = new TabModel(null, null); model.fields = null; expect(model.hasContent()).toBeFalsy(); @@ -53,21 +53,21 @@ describe('TabModel', () => { model.fields = []; expect(model.hasContent()).toBeFalsy(); - let form = new FormModel(); - let field = new FormFieldModel(form); + const form = new FormModel(); + const field = new FormFieldModel(form); model.fields = [new ContainerModel(field)]; expect(model.hasContent()).toBeTruthy(); }); it('should store the form reference', () => { - let form = new FormModel(); - let model = new TabModel(form); + const form = new FormModel(); + const model = new TabModel(form); expect(model.form).toBe(form); }); it('should store original json', () => { - let json = {}; - let model = new TabModel(null, json); + const json = {}; + const model = new TabModel(null, json); expect(model.json).toBe(json); }); diff --git a/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts b/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts index 5fb66d8c20..18540602b5 100644 --- a/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts +++ b/lib/core/form/components/widgets/date-time/date-time.widget.spec.ts @@ -50,7 +50,7 @@ describe('DateTimeWidgetComponent', () => { }); it('should setup min value for date picker', () => { - let minValue = '1982-03-13T10:00Z'; + const minValue = '1982-03-13T10:00Z'; widget.field = new FormFieldModel(null, { id: 'date-id', name: 'date-name', @@ -60,7 +60,7 @@ describe('DateTimeWidgetComponent', () => { fixture.detectChanges(); - let expected = moment(minValue, 'YYYY-MM-DDTHH:mm:ssZ'); + const expected = moment(minValue, 'YYYY-MM-DDTHH:mm:ssZ'); expect(widget.minDate.isSame(expected)).toBeTruthy(); }); @@ -77,20 +77,20 @@ describe('DateTimeWidgetComponent', () => { }); it('should setup max value for date picker', () => { - let maxValue = '1982-03-13T10:00Z'; + const maxValue = '1982-03-13T10:00Z'; widget.field = new FormFieldModel(null, { maxValue: maxValue }); fixture.detectChanges(); - let expected = moment(maxValue, 'YYYY-MM-DDTHH:mm:ssZ'); + const expected = moment(maxValue, 'YYYY-MM-DDTHH:mm:ssZ'); expect(widget.maxDate.isSame(expected)).toBeTruthy(); }); it('should eval visibility on date changed', () => { spyOn(widget, 'onFieldChanged').and.callThrough(); - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { id: 'date-field-id', name: 'date-name', value: '9-12-9999 10:00 AM', @@ -119,7 +119,7 @@ describe('DateTimeWidgetComponent', () => { .then(() => { expect(element.querySelector('#date-field-id')).toBeDefined(); expect(element.querySelector('#date-field-id')).not.toBeNull(); - let dateElement: any = element.querySelector('#date-field-id'); + const dateElement: any = element.querySelector('#date-field-id'); expect(dateElement.value).toBe('30-11-9999 10:30 AM'); }); })); @@ -141,7 +141,7 @@ describe('DateTimeWidgetComponent', () => { .then(() => { expect(element.querySelector('#date-field-id')).toBeDefined(); expect(element.querySelector('#date-field-id')).not.toBeNull(); - let dateElement: any = element.querySelector('#date-field-id'); + const dateElement: any = element.querySelector('#date-field-id'); expect(dateElement.value).toContain('11-29-9999 10:30 AM'); expect(element.querySelector('.adf-error-text').textContent).toBe('FORM.FIELD.VALIDATOR.NOT_LESS_THAN'); }); @@ -162,7 +162,7 @@ describe('DateTimeWidgetComponent', () => { fixture.detectChanges(); expect(element.querySelector('#date-field-id')).toBeDefined(); expect(element.querySelector('#date-field-id')).not.toBeNull(); - let dateElement: any = element.querySelector('#date-field-id'); + const dateElement: any = element.querySelector('#date-field-id'); expect(dateElement.value).toContain('12-30-9999 10:30 AM'); }); })); diff --git a/lib/core/form/components/widgets/date-time/date-time.widget.ts b/lib/core/form/components/widgets/date-time/date-time.widget.ts index c3bfa80876..2dfbdf1ad6 100644 --- a/lib/core/form/components/widgets/date-time/date-time.widget.ts +++ b/lib/core/form/components/widgets/date-time/date-time.widget.ts @@ -58,7 +58,7 @@ export class DateTimeWidgetComponent extends WidgetComponent implements OnInit { this.dateAdapter.setLocale(locale); }); - let momentDateAdapter = <MomentDateAdapter> this.dateAdapter; + const momentDateAdapter = <MomentDateAdapter> this.dateAdapter; momentDateAdapter.overrideDisplayFormat = this.field.dateDisplayFormat; if (this.field) { diff --git a/lib/core/form/components/widgets/date/date.widget.spec.ts b/lib/core/form/components/widgets/date/date.widget.spec.ts index c2d1bcfa58..9ea6977d58 100644 --- a/lib/core/form/components/widgets/date/date.widget.spec.ts +++ b/lib/core/form/components/widgets/date/date.widget.spec.ts @@ -45,7 +45,7 @@ describe('DateWidgetComponent', () => { }); it('should setup min value for date picker', () => { - let minValue = '13-03-1982'; + const minValue = '13-03-1982'; widget.field = new FormFieldModel(null, { id: 'date-id', name: 'date-name', @@ -54,12 +54,12 @@ describe('DateWidgetComponent', () => { widget.ngOnInit(); - let expected = moment(minValue, widget.field.dateDisplayFormat); + const expected = moment(minValue, widget.field.dateDisplayFormat); expect(widget.minDate.isSame(expected)).toBeTruthy(); }); it('should date field be present', () => { - let minValue = '13-03-1982'; + const minValue = '13-03-1982'; widget.field = new FormFieldModel(null, { minValue: minValue }); @@ -71,20 +71,20 @@ describe('DateWidgetComponent', () => { }); it('should setup max value for date picker', () => { - let maxValue = '31-03-1982'; + const maxValue = '31-03-1982'; widget.field = new FormFieldModel(null, { maxValue: maxValue }); widget.ngOnInit(); - let expected = moment(maxValue, widget.field.dateDisplayFormat); + const expected = moment(maxValue, widget.field.dateDisplayFormat); expect(widget.maxDate.isSame(expected)).toBeTruthy(); }); it('should eval visibility on date changed', () => { spyOn(widget, 'onFieldChanged').and.callThrough(); - let field = new FormFieldModel(new FormModel(), { + const field = new FormFieldModel(new FormModel(), { id: 'date-field-id', name: 'date-name', value: '9-9-9999', @@ -119,7 +119,7 @@ describe('DateWidgetComponent', () => { fixture.whenStable().then(() => { expect(element.querySelector('#date-field-id')).toBeDefined(); expect(element.querySelector('#date-field-id')).not.toBeNull(); - let dateElement: any = element.querySelector('#date-field-id'); + const dateElement: any = element.querySelector('#date-field-id'); expect(dateElement.value).toContain('9-9-9999'); }); })); @@ -141,7 +141,7 @@ describe('DateWidgetComponent', () => { fixture.detectChanges(); expect(element.querySelector('#date-field-id')).toBeDefined(); expect(element.querySelector('#date-field-id')).not.toBeNull(); - let dateElement: any = element.querySelector('#date-field-id'); + const dateElement: any = element.querySelector('#date-field-id'); expect(dateElement.value).toContain('11-30-9999'); expect(element.querySelector('.adf-error-text').textContent).toBe('FORM.FIELD.VALIDATOR.NOT_LESS_THAN'); }); @@ -163,7 +163,7 @@ describe('DateWidgetComponent', () => { .then(() => { expect(element.querySelector('#date-field-id')).toBeDefined(); expect(element.querySelector('#date-field-id')).not.toBeNull(); - let dateElement: any = element.querySelector('#date-field-id'); + const dateElement: any = element.querySelector('#date-field-id'); expect(dateElement.value).toContain('12-30-9999'); }); })); diff --git a/lib/core/form/components/widgets/date/date.widget.ts b/lib/core/form/components/widgets/date/date.widget.ts index b063c861d7..e9f3a75fe9 100644 --- a/lib/core/form/components/widgets/date/date.widget.ts +++ b/lib/core/form/components/widgets/date/date.widget.ts @@ -55,7 +55,7 @@ export class DateWidgetComponent extends WidgetComponent implements OnInit { this.dateAdapter.setLocale(locale); }); - let momentDateAdapter = <MomentDateAdapter> this.dateAdapter; + const momentDateAdapter = <MomentDateAdapter> this.dateAdapter; momentDateAdapter.overrideDisplayFormat = this.field.dateDisplayFormat; if (this.field) { diff --git a/lib/core/form/components/widgets/dropdown/dropdown.widget.spec.ts b/lib/core/form/components/widgets/dropdown/dropdown.widget.spec.ts index 460db169be..075cd70bf8 100644 --- a/lib/core/form/components/widgets/dropdown/dropdown.widget.spec.ts +++ b/lib/core/form/components/widgets/dropdown/dropdown.widget.spec.ts @@ -42,7 +42,7 @@ describe('DropdownWidgetComponent', () => { fixture.detectChanges(); } - let fakeOptionList: FormFieldOption[] = [ + const fakeOptionList: FormFieldOption[] = [ { id: 'opt_1', name: 'option_1' }, { id: 'opt_2', name: 'option_2' }, { id: 'opt_3', name: 'option_3' }]; @@ -79,7 +79,7 @@ describe('DropdownWidgetComponent', () => { const taskId = '<form-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ taskId: taskId }); @@ -99,7 +99,7 @@ describe('DropdownWidgetComponent', () => { }); it('should preserve empty option when loading fields', () => { - let restFieldValue: FormFieldOption = <FormFieldOption> { id: '1', name: 'Option1' }; + const restFieldValue: FormFieldOption = <FormFieldOption> { id: '1', name: 'Option1' }; spyOn(formService, 'getRestFieldValues').and.callFake(() => { return new Observable((observer) => { observer.next([restFieldValue]); @@ -107,8 +107,8 @@ describe('DropdownWidgetComponent', () => { }); }); - let form = new FormModel({ taskId: '<id>' }); - let emptyOption: FormFieldOption = <FormFieldOption> { id: 'empty', name: 'Empty' }; + const form = new FormModel({ taskId: '<id>' }); + const emptyOption: FormFieldOption = <FormFieldOption> { id: 'empty', name: 'Empty' }; widget.field = new FormFieldModel(form, { id: '<id>', restUrl: '/some/url/address', @@ -165,7 +165,7 @@ describe('DropdownWidgetComponent', () => { fixture.detectChanges(); fixture.whenStable() .then(() => { - let dropDownElement: any = element.querySelector('#dropdown-id'); + const dropDownElement: any = element.querySelector('#dropdown-id'); expect(dropDownElement.attributes['ng-reflect-model'].value).toBe('option_2'); expect(dropDownElement.attributes['ng-reflect-model'].textContent).toBe('option_2'); }); @@ -182,7 +182,7 @@ describe('DropdownWidgetComponent', () => { fixture.whenStable() .then(() => { - let dropDownElement: any = element.querySelector('#dropdown-id'); + const dropDownElement: any = element.querySelector('#dropdown-id'); expect(dropDownElement.attributes['ng-reflect-model'].value).toBe('empty'); }); })); @@ -229,7 +229,7 @@ describe('DropdownWidgetComponent', () => { fixture.detectChanges(); fixture.whenStable() .then(() => { - let dropDownElement: any = element.querySelector('#dropdown-id'); + const dropDownElement: any = element.querySelector('#dropdown-id'); expect(dropDownElement.attributes['ng-reflect-model'].value).toBe('option_2'); expect(dropDownElement.attributes['ng-reflect-model'].textContent).toBe('option_2'); }); @@ -246,7 +246,7 @@ describe('DropdownWidgetComponent', () => { fixture.whenStable() .then(() => { - let dropDownElement: any = element.querySelector('#dropdown-id'); + const dropDownElement: any = element.querySelector('#dropdown-id'); expect(dropDownElement.attributes['ng-reflect-model'].value).toBe('empty'); }); })); @@ -263,7 +263,7 @@ describe('DropdownWidgetComponent', () => { fixture.detectChanges(); fixture.whenStable() .then(() => { - let dropDownElement: HTMLSelectElement = <HTMLSelectElement> element.querySelector('#dropdown-id'); + const dropDownElement: HTMLSelectElement = <HTMLSelectElement> element.querySelector('#dropdown-id'); expect(dropDownElement).not.toBeNull(); expect(dropDownElement.getAttribute('aria-disabled')).toBe('true'); }); diff --git a/lib/core/form/components/widgets/dropdown/dropdown.widget.ts b/lib/core/form/components/widgets/dropdown/dropdown.widget.ts index 365c876691..2df258a7f6 100644 --- a/lib/core/form/components/widgets/dropdown/dropdown.widget.ts +++ b/lib/core/form/components/widgets/dropdown/dropdown.widget.ts @@ -55,7 +55,7 @@ export class DropdownWidgetComponent extends WidgetComponent implements OnInit { ) .subscribe( (formFieldOption: FormFieldOption[]) => { - let options = []; + const options = []; if (this.field.emptyOption) { options.push(this.field.emptyOption); } @@ -74,7 +74,7 @@ export class DropdownWidgetComponent extends WidgetComponent implements OnInit { ) .subscribe( (formFieldOption: FormFieldOption[]) => { - let options = []; + const options = []; if (this.field.emptyOption) { options.push(this.field.emptyOption); } diff --git a/lib/core/form/components/widgets/dynamic-table/date-cell-validator-model.ts b/lib/core/form/components/widgets/dynamic-table/date-cell-validator-model.ts index 430154c7ff..73a650b361 100644 --- a/lib/core/form/components/widgets/dynamic-table/date-cell-validator-model.ts +++ b/lib/core/form/components/widgets/dynamic-table/date-cell-validator-model.ts @@ -36,8 +36,8 @@ export class DateCellValidator implements CellValidator { validate(row: DynamicTableRow, column: DynamicTableColumn, summary?: DynamicRowValidationSummary): boolean { if (this.isSupported(column)) { - let value = row.value[column.id]; - let dateValue = moment(value, 'D-M-YYYY'); + const value = row.value[column.id]; + const dateValue = moment(value, 'D-M-YYYY'); if (!dateValue.isValid()) { if (summary) { summary.isValid = false; diff --git a/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.model.ts b/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.model.ts index 8d5c37abde..4ed690c53a 100644 --- a/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.model.ts +++ b/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.model.ts @@ -105,7 +105,7 @@ export class DynamicTableModel extends FormWidgetModel { } moveRow(row: DynamicTableRow, offset: number) { - let oldIndex = this.rows.indexOf(row); + const oldIndex = this.rows.indexOf(row); if (oldIndex > -1) { let newIndex = (oldIndex + offset); @@ -115,7 +115,7 @@ export class DynamicTableModel extends FormWidgetModel { newIndex = this.rows.length; } - let arr = this.rows.slice(); + const arr = this.rows.slice(); arr.splice(oldIndex, 1); arr.splice(newIndex, 0, row); this.rows = arr; @@ -129,7 +129,7 @@ export class DynamicTableModel extends FormWidgetModel { if (this.selectedRow === row) { this.selectedRow = null; } - let idx = this.rows.indexOf(row); + const idx = this.rows.indexOf(row); if (idx > -1) { this.rows.splice(idx, 1); this.flushValue(); @@ -158,8 +158,8 @@ export class DynamicTableModel extends FormWidgetModel { } if (row) { - for (let col of this.columns) { - for (let validator of this._validators) { + for (const col of this.columns) { + for (const validator of this._validators) { if (!validator.validate(row, col, summary)) { return summary; } @@ -171,7 +171,7 @@ export class DynamicTableModel extends FormWidgetModel { } getCellValue(row: DynamicTableRow, column: DynamicTableColumn): any { - let rowValue = row.value[column.id]; + const rowValue = row.value[column.id]; if (column.type === 'Dropdown') { if (rowValue) { @@ -195,7 +195,7 @@ export class DynamicTableModel extends FormWidgetModel { getDisplayText(column: DynamicTableColumn): string { let columnName = column.name; if (column.type === 'Amount') { - let currency = column.amountCurrency || '$'; + const currency = column.amountCurrency || '$'; columnName = `${column.name} (${currency})`; } return columnName; diff --git a/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.spec.ts b/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.spec.ts index 7851c84994..539b13e4ed 100644 --- a/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.spec.ts +++ b/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.spec.ts @@ -27,7 +27,7 @@ import { setupTestBed } from '../../../../testing/setupTestBed'; import { CoreModule } from '../../../../core.module'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -let fakeFormField = { +const fakeFormField = { id: 'fake-dynamic-table', name: 'fake-label', value: [{1: 1, 2: 2, 3: 4}], @@ -89,10 +89,10 @@ describe('DynamicTableWidgetComponent', () => { logService = TestBed.get(LogService); formService = TestBed.get(FormService); table = new DynamicTableModel(field, formService); - let changeDetectorSpy = jasmine.createSpyObj('cd', ['detectChanges']); - let nativeElementSpy = jasmine.createSpyObj('nativeElement', ['querySelector']); + const changeDetectorSpy = jasmine.createSpyObj('cd', ['detectChanges']); + const nativeElementSpy = jasmine.createSpyObj('nativeElement', ['querySelector']); changeDetectorSpy.nativeElement = nativeElementSpy; - let elementRefSpy = jasmine.createSpyObj('elementRef', ['']); + const elementRefSpy = jasmine.createSpyObj('elementRef', ['']); elementRefSpy.nativeElement = nativeElementSpy; fixture = TestBed.createComponent(DynamicTableWidgetComponent); @@ -107,7 +107,7 @@ describe('DynamicTableWidgetComponent', () => { }); it('should select row on click', () => { - let row = <DynamicTableRow> {selected: false}; + const row = <DynamicTableRow> {selected: false}; widget.onRowClicked(row); expect(row.selected).toBeTruthy(); @@ -115,7 +115,7 @@ describe('DynamicTableWidgetComponent', () => { }); it('should require table to select clicked row', () => { - let row = <DynamicTableRow> {selected: false}; + const row = <DynamicTableRow> {selected: false}; widget.content = null; widget.onRowClicked(row); @@ -123,7 +123,7 @@ describe('DynamicTableWidgetComponent', () => { }); it('should reset selected row', () => { - let row = <DynamicTableRow> {selected: false}; + const row = <DynamicTableRow> {selected: false}; widget.content.rows.push(row); widget.content.selectedRow = row; expect(widget.content.selectedRow).toBe(row); @@ -135,7 +135,7 @@ describe('DynamicTableWidgetComponent', () => { }); it('should check selection', () => { - let row = <DynamicTableRow> {selected: false}; + const row = <DynamicTableRow> {selected: false}; widget.content.rows.push(row); widget.content.selectedRow = row; expect(widget.hasSelection()).toBeTruthy(); @@ -153,8 +153,8 @@ describe('DynamicTableWidgetComponent', () => { }); it('should move selection up', () => { - let row1 = <DynamicTableRow> {}; - let row2 = <DynamicTableRow> {}; + const row1 = <DynamicTableRow> {}; + const row2 = <DynamicTableRow> {}; widget.content.rows.push(...[row1, row2]); widget.content.selectedRow = row2; @@ -168,8 +168,8 @@ describe('DynamicTableWidgetComponent', () => { }); it('should move selection down', () => { - let row1 = <DynamicTableRow> {}; - let row2 = <DynamicTableRow> {}; + const row1 = <DynamicTableRow> {}; + const row2 = <DynamicTableRow> {}; widget.content.rows.push(...[row1, row2]); widget.content.selectedRow = row1; @@ -183,7 +183,7 @@ describe('DynamicTableWidgetComponent', () => { }); it('should delete selected row', () => { - let row = <DynamicTableRow> {}; + const row = <DynamicTableRow> {}; widget.content.rows.push(row); widget.content.selectedRow = row; widget.deleteSelection(); @@ -213,7 +213,7 @@ describe('DynamicTableWidgetComponent', () => { expect(widget.editMode).toBeFalsy(); expect(widget.editRow).toBeFalsy(); - let row = <DynamicTableRow> {value: true}; + const row = <DynamicTableRow> {value: true}; widget.content.selectedRow = row; expect(widget.editSelection()).toBeTruthy(); @@ -223,8 +223,8 @@ describe('DynamicTableWidgetComponent', () => { }); it('should copy row', () => { - let row = <DynamicTableRow> {value: {opt: {key: '1', value: 1}}}; - let copy = widget.copyRow(row); + const row = <DynamicTableRow> {value: {opt: {key: '1', value: 1}}}; + const copy = widget.copyRow(row); expect(copy.value).toEqual(row.value); }); @@ -235,14 +235,14 @@ describe('DynamicTableWidgetComponent', () => { it('should retrieve cell value', () => { const value = '<value>'; - let row = <DynamicTableRow> {value: {key: value}}; - let column = <DynamicTableColumn> {id: 'key'}; + const row = <DynamicTableRow> {value: {key: value}}; + const column = <DynamicTableColumn> {id: 'key'}; expect(widget.getCellValue(row, column)).toBe(value); }); it('should save changes and add new row', () => { - let row = <DynamicTableRow> {isNew: true, value: {key: 'value'}}; + const row = <DynamicTableRow> {isNew: true, value: {key: 'value'}}; widget.editMode = true; widget.editRow = row; @@ -255,7 +255,7 @@ describe('DynamicTableWidgetComponent', () => { }); it('should save changes and update row', () => { - let row = <DynamicTableRow> {isNew: false, value: {key: 'value'}}; + const row = <DynamicTableRow> {isNew: false, value: {key: 'value'}}; widget.editMode = true; widget.editRow = row; widget.content.selectedRow = row; @@ -291,8 +291,8 @@ describe('DynamicTableWidgetComponent', () => { }); it('should take validation state from underlying field', () => { - let form = new FormModel(); - let field = new FormFieldModel(form, { + const form = new FormModel(); + const field = new FormFieldModel(form, { type: FormFieldTypes.DYNAMIC_TABLE, required: true, value: null @@ -312,16 +312,16 @@ describe('DynamicTableWidgetComponent', () => { }); it('should prepend default currency for amount columns', () => { - let row = <DynamicTableRow> {value: {key: '100'}}; - let column = <DynamicTableColumn> {id: 'key', type: 'Amount'}; - let actual = widget.getCellValue(row, column); + const row = <DynamicTableRow> {value: {key: '100'}}; + const column = <DynamicTableColumn> {id: 'key', type: 'Amount'}; + const actual = widget.getCellValue(row, column); expect(actual).toBe('$ 100'); }); it('should prepend custom currency for amount columns', () => { - let row = <DynamicTableRow> {value: {key: '100'}}; - let column = <DynamicTableColumn> {id: 'key', type: 'Amount', amountCurrency: 'GBP'}; - let actual = widget.getCellValue(row, column); + const row = <DynamicTableRow> {value: {key: '100'}}; + const column = <DynamicTableColumn> {id: 'key', type: 'Amount', amountCurrency: 'GBP'}; + const actual = widget.getCellValue(row, column); expect(actual).toBe('GBP 100'); }); @@ -340,25 +340,25 @@ describe('DynamicTableWidgetComponent', () => { }); it('should select a row when press space bar', async(() => { - let rowElement = element.querySelector('#fake-dynamic-table-row-0'); + const rowElement = element.querySelector('#fake-dynamic-table-row-0'); expect(element.querySelector('#dynamic-table-fake-dynamic-table')).not.toBeNull(); expect(rowElement).not.toBeNull(); expect(rowElement.className).not.toContain('adf-dynamic-table-widget__row-selected'); - let event: any = new Event('keyup'); + const event: any = new Event('keyup'); event.keyCode = 32; rowElement.dispatchEvent(event); fixture.detectChanges(); fixture.whenStable().then(() => { - let selectedRow = element.querySelector('#fake-dynamic-table-row-0'); + const selectedRow = element.querySelector('#fake-dynamic-table-row-0'); expect(selectedRow.className).toContain('adf-dynamic-table-widget__row-selected'); }); })); it('should focus on add button when a new row is saved', async(() => { - let addNewRowButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#fake-dynamic-table-add-row'); + const addNewRowButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#fake-dynamic-table-add-row'); expect(element.querySelector('#dynamic-table-fake-dynamic-table')).not.toBeNull(); expect(addNewRowButton).not.toBeNull(); diff --git a/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.ts b/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.ts index 4048757e22..91476637c2 100644 --- a/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.ts +++ b/lib/core/form/components/widgets/dynamic-table/dynamic-table.widget.ts @@ -62,7 +62,7 @@ export class DynamicTableWidgetComponent extends WidgetComponent implements OnIn forceFocusOnAddButton() { if (this.content) { this.cd.detectChanges(); - let buttonAddRow = <HTMLButtonElement> this.elementRef.nativeElement.querySelector('#' + this.content.id + '-add-row'); + const buttonAddRow = <HTMLButtonElement> this.elementRef.nativeElement.querySelector('#' + this.content.id + '-add-row'); if (this.isDynamicTableReady(buttonAddRow)) { buttonAddRow.focus(); } @@ -151,7 +151,7 @@ export class DynamicTableWidgetComponent extends WidgetComponent implements OnIn getCellValue(row: DynamicTableRow, column: DynamicTableColumn): any { if (this.content) { - let cellValue = this.content.getCellValue(row, column); + const cellValue = this.content.getCellValue(row, column); if (column.type === 'Amount') { return (column.amountCurrency || '$') + ' ' + (cellValue || 0); } @@ -163,7 +163,7 @@ export class DynamicTableWidgetComponent extends WidgetComponent implements OnIn onSaveChanges() { if (this.content) { if (this.editRow.isNew) { - let row = this.copyRow(this.editRow); + const row = this.copyRow(this.editRow); this.content.selectedRow = null; this.content.addRow(row); this.editRow.isNew = false; diff --git a/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.spec.ts b/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.spec.ts index 91c12c8573..94281ab8ef 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.spec.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.spec.ts @@ -29,9 +29,9 @@ describe('BooleanEditorComponent', () => { }); it('should update row value on change', () => { - let row = <DynamicTableRow> { value: {} }; - let column = <DynamicTableColumn> { id: 'key' }; - let event = { checked: true } ; + const row = <DynamicTableRow> { value: {} }; + const column = <DynamicTableColumn> { id: 'key' }; + const event = { checked: true } ; component.onValueChanged(row, column, event); expect(row.value[column.id]).toBeTruthy(); diff --git a/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.ts b/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.ts index f100b1a4b6..4203fabd5d 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/boolean/boolean.editor.ts @@ -39,7 +39,7 @@ export class BooleanEditorComponent { column: DynamicTableColumn; onValueChanged(row: DynamicTableRow, column: DynamicTableColumn, event: any) { - let value: boolean = (<HTMLInputElement> event).checked; + const value: boolean = (<HTMLInputElement> event).checked; row.value[column.id] = value; } diff --git a/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.spec.ts b/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.spec.ts index 41675ed494..7c4b57a5cc 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.spec.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.spec.ts @@ -61,7 +61,7 @@ describe('DateEditorComponent', () => { it('should update fow value on change', () => { component.ngOnInit(); - let newDate = moment('14-03-1879', 'DD-MM-YYYY'); + const newDate = moment('14-03-1879', 'DD-MM-YYYY'); component.onDateChanged(newDate); expect(row.value[column.id]).toBe('1879-03-14T00:00:00.000Z'); }); @@ -72,7 +72,7 @@ describe('DateEditorComponent', () => { component.ngOnInit(); component.onDateChanged(input); - let actual = row.value[column.id]; + const actual = row.value[column.id]; expect(actual).toBe('2016-03-14T00:00:00.000Z'); }); diff --git a/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.ts b/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.ts index 945ce685fe..23f29dc4c6 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/date/date.editor.ts @@ -63,7 +63,7 @@ export class DateEditorComponent implements OnInit { this.dateAdapter.setLocale(locale); }); - let momentDateAdapter = <MomentDateAdapter> this.dateAdapter; + const momentDateAdapter = <MomentDateAdapter> this.dateAdapter; momentDateAdapter.overrideDisplayFormat = this.DATE_FORMAT; this.value = moment(this.table.getCellValue(this.row, this.column), 'YYYY-MM-DD'); @@ -71,7 +71,7 @@ export class DateEditorComponent implements OnInit { onDateChanged(newDateValue) { if (newDateValue && newDateValue.value) { - let momentDate = moment(newDateValue.value, this.DATE_FORMAT, true); + const momentDate = moment(newDateValue.value, this.DATE_FORMAT, true); if (!momentDate.isValid()) { this.row.value[this.column.id] = ''; diff --git a/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.spec.ts b/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.spec.ts index f496a36457..e1a0dfa3e0 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.spec.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.spec.ts @@ -61,7 +61,7 @@ describe('DateTimeEditorComponent', () => { it('should update fow value on change', () => { component.ngOnInit(); - let newDate = moment('22-6-2018 04:20 AM', 'D-M-YYYY hh:mm A'); + const newDate = moment('22-6-2018 04:20 AM', 'D-M-YYYY hh:mm A'); component.onDateChanged(newDate); expect(moment(row.value[column.id]).isSame(newDate)).toBeTruthy(); }); @@ -72,7 +72,7 @@ describe('DateTimeEditorComponent', () => { component.ngOnInit(); component.onDateChanged(input); - let actual = row.value[column.id]; + const actual = row.value[column.id]; expect(actual).toBe('22-6-2018 04:20 AM'); }); diff --git a/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.ts b/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.ts index 5bf214c34c..4dbc70740f 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/datetime/datetime.editor.ts @@ -68,7 +68,7 @@ export class DateTimeEditorComponent implements OnInit { this.dateAdapter.setLocale(locale); }); - let momentDateAdapter = <MomentDateAdapter> this.dateAdapter; + const momentDateAdapter = <MomentDateAdapter> this.dateAdapter; momentDateAdapter.overrideDisplayFormat = this.DATE_FORMAT; this.value = moment(this.table.getCellValue(this.row, this.column), this.DATE_FORMAT); diff --git a/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.spec.ts b/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.spec.ts index 48485332d2..8c54da4e9a 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.spec.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.spec.ts @@ -92,7 +92,7 @@ describe('DropdownEditorComponent', () => { column.optionType = 'rest'; row.value[column.id] = 'twelve'; - let restResults = [ + const restResults = [ <DynamicTableColumnOption> {id: '11', name: 'eleven'}, <DynamicTableColumnOption> {id: '12', name: 'twelve'} ]; @@ -155,8 +155,8 @@ describe('DropdownEditorComponent', () => { it('should handle REST error getting option with processDefinitionId', () => { column.optionType = 'rest'; - let procForm = new FormModel({processDefinitionId: '<process-definition-id>'}); - let procTable = new DynamicTableModel(new FormFieldModel(procForm, {id: '<field-id>'}), formService); + const procForm = new FormModel({processDefinitionId: '<process-definition-id>'}); + const procTable = new DynamicTableModel(new FormFieldModel(procForm, {id: '<field-id>'}), formService); component.table = procTable; const error = 'error'; @@ -170,7 +170,7 @@ describe('DropdownEditorComponent', () => { }); it('should update row on value change', () => { - let event = {value: 'two'}; + const event = {value: 'two'}; component.onValueChanged(row, column, event); expect(row.value[column.id]).toBe(column.options[1]); }); @@ -180,7 +180,7 @@ describe('DropdownEditorComponent', () => { let fixture: ComponentFixture<DropdownEditorComponent>; let element: HTMLElement; let stubFormService; - let fakeOptionList: DynamicTableColumnOption[] = [{ + const fakeOptionList: DynamicTableColumnOption[] = [{ id: 'opt_1', name: 'option_1' }, { diff --git a/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.ts b/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.ts index cf53007c08..41deea0e65 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/dropdown/dropdown.editor.ts @@ -49,7 +49,7 @@ export class DropdownEditorComponent implements OnInit { } ngOnInit() { - let field = this.table.field; + const field = this.table.field; if (field) { if (this.column.optionType === 'rest') { if (this.table.form && this.table.form.taskId) { diff --git a/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.spec.ts b/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.spec.ts index 9ac9bcbb11..1b02fdbe5a 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.spec.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.spec.ts @@ -28,11 +28,11 @@ describe('TextEditorComponent', () => { }); it('should update row value on change', () => { - let row = <DynamicTableRow> { value: {} }; - let column = <DynamicTableColumn> { id: 'key' }; + const row = <DynamicTableRow> { value: {} }; + const column = <DynamicTableColumn> { id: 'key' }; const value = '<value>'; - let event = { target: { value } }; + const event = { target: { value } }; editor.onValueChanged(row, column, event); expect(row.value[column.id]).toBe(value); diff --git a/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.ts b/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.ts index 6afcf58988..15bebcc3d4 100644 --- a/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.ts +++ b/lib/core/form/components/widgets/dynamic-table/editors/text/text.editor.ts @@ -45,7 +45,7 @@ export class TextEditorComponent implements OnInit { } onValueChanged(row: DynamicTableRow, column: DynamicTableColumn, event: any) { - let value: any = (<HTMLInputElement> event.target).value; + const value: any = (<HTMLInputElement> event.target).value; row.value[column.id] = value; } diff --git a/lib/core/form/components/widgets/dynamic-table/number-cell-validator.model.ts b/lib/core/form/components/widgets/dynamic-table/number-cell-validator.model.ts index b9432d67ed..cfe2a49a19 100644 --- a/lib/core/form/components/widgets/dynamic-table/number-cell-validator.model.ts +++ b/lib/core/form/components/widgets/dynamic-table/number-cell-validator.model.ts @@ -44,7 +44,7 @@ export class NumberCellValidator implements CellValidator { validate(row: DynamicTableRow, column: DynamicTableColumn, summary?: DynamicRowValidationSummary): boolean { if (this.isSupported(column)) { - let value = row.value[column.id]; + const value = row.value[column.id]; if (value === null || value === undefined || value === '' || diff --git a/lib/core/form/components/widgets/dynamic-table/required-cell-validator.model.ts b/lib/core/form/components/widgets/dynamic-table/required-cell-validator.model.ts index 1aafcb4759..bf7de85d8b 100644 --- a/lib/core/form/components/widgets/dynamic-table/required-cell-validator.model.ts +++ b/lib/core/form/components/widgets/dynamic-table/required-cell-validator.model.ts @@ -38,7 +38,7 @@ export class RequiredCellValidator implements CellValidator { validate(row: DynamicTableRow, column: DynamicTableColumn, summary?: DynamicRowValidationSummary): boolean { if (this.isSupported(column)) { - let value = row.value[column.id]; + const value = row.value[column.id]; if (column.required) { if (value === null || value === undefined || value === '') { if (summary) { diff --git a/lib/core/form/components/widgets/functional-group/functional-group.widget.spec.ts b/lib/core/form/components/widgets/functional-group/functional-group.widget.spec.ts index 8ba64b7bc1..2900bd9e4b 100644 --- a/lib/core/form/components/widgets/functional-group/functional-group.widget.spec.ts +++ b/lib/core/form/components/widgets/functional-group/functional-group.widget.spec.ts @@ -36,7 +36,7 @@ describe('FunctionalGroupWidgetComponent', () => { }); it('should setup text from underlying field on init', () => { - let group = new GroupModel({ name: 'group-1'}); + const group = new GroupModel({ name: 'group-1'}); widget.field.value = group; spyOn(formService, 'getWorkflowGroups').and.returnValue( @@ -75,13 +75,13 @@ describe('FunctionalGroupWidgetComponent', () => { }); it('should prevent default behaviour on option item click', () => { - let event = jasmine.createSpyObj('event', ['preventDefault']); + const event = jasmine.createSpyObj('event', ['preventDefault']); widget.onItemClick(null, event); expect(event.preventDefault).toHaveBeenCalled(); }); it('should update values on item click', () => { - let item = new GroupModel({ name: 'group-1' }); + const item = new GroupModel({ name: 'group-1' }); widget.onItemClick(item, null); expect(widget.field.value).toBe(item); @@ -95,7 +95,7 @@ describe('FunctionalGroupWidgetComponent', () => { }); it('should flush selected value', () => { - let groups: GroupModel[] = [ + const groups: GroupModel[] = [ new GroupModel({ id: '1', name: 'group 1' }), new GroupModel({ id: '2', name: 'group 2' }) ]; @@ -109,7 +109,7 @@ describe('FunctionalGroupWidgetComponent', () => { }); it('should be case insensitive when flushing value', () => { - let groups: GroupModel[] = [ + const groups: GroupModel[] = [ new GroupModel({ id: '1', name: 'group 1' }), new GroupModel({ id: '2', name: 'gRoUp 2' }) ]; @@ -123,7 +123,7 @@ describe('FunctionalGroupWidgetComponent', () => { }); it('should fetch groups and show popup on key up', () => { - let groups: GroupModel[] = [ + const groups: GroupModel[] = [ new GroupModel(), new GroupModel() ]; @@ -134,7 +134,7 @@ describe('FunctionalGroupWidgetComponent', () => { }) ); - let keyboardEvent = new KeyboardEvent('keypress'); + const keyboardEvent = new KeyboardEvent('keypress'); widget.value = 'group'; widget.onKeyUp(keyboardEvent); @@ -143,7 +143,7 @@ describe('FunctionalGroupWidgetComponent', () => { }); it('should fetch groups with a group filter', () => { - let groups: GroupModel[] = [ + const groups: GroupModel[] = [ new GroupModel(), new GroupModel() ]; @@ -154,7 +154,7 @@ describe('FunctionalGroupWidgetComponent', () => { }) ); - let keyboardEvent = new KeyboardEvent('keypress'); + const keyboardEvent = new KeyboardEvent('keypress'); widget.groupId = 'parentGroup'; widget.value = 'group'; widget.onKeyUp(keyboardEvent); @@ -171,7 +171,7 @@ describe('FunctionalGroupWidgetComponent', () => { }) ); - let keyboardEvent = new KeyboardEvent('keypress'); + const keyboardEvent = new KeyboardEvent('keypress'); widget.value = 'group'; widget.onKeyUp(keyboardEvent); @@ -182,7 +182,7 @@ describe('FunctionalGroupWidgetComponent', () => { it('should not fetch groups when value is missing', () => { spyOn(formService, 'getWorkflowGroups').and.stub(); - let keyboardEvent = new KeyboardEvent('keypress'); + const keyboardEvent = new KeyboardEvent('keypress'); widget.value = null; widget.onKeyUp(keyboardEvent); @@ -192,7 +192,7 @@ describe('FunctionalGroupWidgetComponent', () => { it('should not fetch groups when value violates constraints', () => { spyOn(formService, 'getWorkflowGroups').and.stub(); - let keyboardEvent = new KeyboardEvent('keypress'); + const keyboardEvent = new KeyboardEvent('keypress'); widget.minTermLength = 4; widget.value = '123'; widget.onKeyUp(keyboardEvent); diff --git a/lib/core/form/components/widgets/functional-group/functional-group.widget.ts b/lib/core/form/components/widgets/functional-group/functional-group.widget.ts index 7c824aa63c..a0eb391c8c 100644 --- a/lib/core/form/components/widgets/functional-group/functional-group.widget.ts +++ b/lib/core/form/components/widgets/functional-group/functional-group.widget.ts @@ -45,14 +45,14 @@ export class FunctionalGroupWidgetComponent extends WidgetComponent implements O ngOnInit() { if (this.field) { - let group = this.field.value; + const group = this.field.value; if (group) { this.value = group.name; } - let params = this.field.params; + const params = this.field.params; if (params && params['restrictWithGroup']) { - let restrictWithGroup = <GroupModel> params['restrictWithGroup']; + const restrictWithGroup = <GroupModel> params['restrictWithGroup']; this.groupId = restrictWithGroup.id; } @@ -78,7 +78,7 @@ export class FunctionalGroupWidgetComponent extends WidgetComponent implements O } flushValue() { - let option = this.groups.find((item) => item.name.toLocaleLowerCase() === this.value.toLocaleLowerCase()); + const option = this.groups.find((item) => item.name.toLocaleLowerCase() === this.value.toLocaleLowerCase()); if (option) { this.field.value = option; diff --git a/lib/core/form/components/widgets/people/people.widget.spec.ts b/lib/core/form/components/widgets/people/people.widget.spec.ts index b3f32c1629..44ed1b36a7 100644 --- a/lib/core/form/components/widgets/people/people.widget.spec.ts +++ b/lib/core/form/components/widgets/people/people.widget.spec.ts @@ -63,7 +63,7 @@ describe('PeopleWidgetComponent', () => { }); it('should return full name for a given model', () => { - let model = new UserProcessModel({ + const model = new UserProcessModel({ firstName: 'John', lastName: 'Doe' }); @@ -71,12 +71,12 @@ describe('PeopleWidgetComponent', () => { }); it('should skip first name for display name', () => { - let model = new UserProcessModel({ firstName: null, lastName: 'Doe' }); + const model = new UserProcessModel({ firstName: null, lastName: 'Doe' }); expect(widget.getDisplayName(model)).toBe('Doe'); }); it('should skip last name for display name', () => { - let model = new UserProcessModel({ firstName: 'John', lastName: null }); + const model = new UserProcessModel({ firstName: 'John', lastName: null }); expect(widget.getDisplayName(model)).toBe('John'); }); @@ -129,7 +129,7 @@ describe('PeopleWidgetComponent', () => { widget.field.value = null; widget.ngOnInit(); fixture.detectChanges(); - let input = widget.input; + const input = widget.input; expect(input.nativeElement.value).toBe(''); expect(widget.groupId).toBeUndefined(); }); @@ -161,7 +161,7 @@ describe('PeopleWidgetComponent', () => { describe('when template is ready', () => { - let fakeUserResult = [ + const fakeUserResult = [ { id: 1001, firstName: 'Test01', lastName: 'Test01', email: 'test' }, { id: 1002, firstName: 'Test02', lastName: 'Test02', email: 'test2' }]; @@ -190,7 +190,7 @@ describe('PeopleWidgetComponent', () => { }); it('should show an error message if the user is invalid', async(() => { - let peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); peopleHTMLElement.focus(); peopleHTMLElement.value = 'K'; peopleHTMLElement.dispatchEvent(new Event('keyup')); @@ -203,7 +203,7 @@ describe('PeopleWidgetComponent', () => { })); it('should show the people if the typed result match', async(() => { - let peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); peopleHTMLElement.focus(); peopleHTMLElement.value = 'T'; peopleHTMLElement.dispatchEvent(new Event('keyup')); @@ -217,7 +217,7 @@ describe('PeopleWidgetComponent', () => { })); it('should hide result list if input is empty', () => { - let peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); peopleHTMLElement.focus(); peopleHTMLElement.value = ''; peopleHTMLElement.dispatchEvent(new Event('keyup')); @@ -230,7 +230,7 @@ describe('PeopleWidgetComponent', () => { }); it('should display two options if we tap one letter', async(() => { - let peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); peopleHTMLElement.focus(); peopleHTMLElement.value = 'T'; peopleHTMLElement.dispatchEvent(new Event('keyup')); @@ -244,8 +244,8 @@ describe('PeopleWidgetComponent', () => { })); it('should emit peopleSelected if option is valid', async() => { - let selectEmitSpy = spyOn(widget.peopleSelected, 'emit'); - let peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const selectEmitSpy = spyOn(widget.peopleSelected, 'emit'); + const peopleHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); peopleHTMLElement.focus(); peopleHTMLElement.value = 'Test01 Test01'; peopleHTMLElement.dispatchEvent(new Event('keyup')); diff --git a/lib/core/form/components/widgets/people/people.widget.ts b/lib/core/form/components/widgets/people/people.widget.ts index 5a247de1d7..6fe42de6ae 100644 --- a/lib/core/form/components/widgets/people/people.widget.ts +++ b/lib/core/form/components/widgets/people/people.widget.ts @@ -61,7 +61,7 @@ export class PeopleWidgetComponent extends WidgetComponent implements OnInit { }), distinctUntilChanged(), switchMap((searchTerm) => { - let value = searchTerm.email ? this.getDisplayName(searchTerm) : searchTerm; + const value = searchTerm.email ? this.getDisplayName(searchTerm) : searchTerm; return this.formService.getWorkflowUsers(value, this.groupId) .pipe( catchError((err) => { @@ -71,7 +71,7 @@ export class PeopleWidgetComponent extends WidgetComponent implements OnInit { ); }), map((list: UserProcessModel[]) => { - let value = this.searchTerm.value.email ? this.getDisplayName(this.searchTerm.value) : this.searchTerm.value; + const value = this.searchTerm.value.email ? this.getDisplayName(this.searchTerm.value) : this.searchTerm.value; this.checkUserAndValidateForm(list, value); return list; }) @@ -90,9 +90,9 @@ export class PeopleWidgetComponent extends WidgetComponent implements OnInit { if (this.field.readOnly) { this.searchTerm.disable(); } - let params = this.field.params; + const params = this.field.params; if (params && params.restrictWithGroup) { - let restrictWithGroup = <GroupModel> params.restrictWithGroup; + const restrictWithGroup = <GroupModel> params.restrictWithGroup; this.groupId = restrictWithGroup.id; } } @@ -125,7 +125,7 @@ export class PeopleWidgetComponent extends WidgetComponent implements OnInit { getDisplayName(model: UserProcessModel) { if (model) { - let displayName = `${model.firstName || ''} ${model.lastName || ''}`; + const displayName = `${model.firstName || ''} ${model.lastName || ''}`; return displayName.trim(); } return ''; diff --git a/lib/core/form/components/widgets/radio-buttons/radio-buttons.widget.spec.ts b/lib/core/form/components/widgets/radio-buttons/radio-buttons.widget.spec.ts index 2c55cb5785..02315a9c1d 100644 --- a/lib/core/form/components/widgets/radio-buttons/radio-buttons.widget.spec.ts +++ b/lib/core/form/components/widgets/radio-buttons/radio-buttons.widget.spec.ts @@ -50,7 +50,7 @@ describe('RadioButtonsWidgetComponent', () => { const taskId = '<form-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ taskId: taskId }); @@ -71,7 +71,7 @@ describe('RadioButtonsWidgetComponent', () => { const taskId = '<form-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ taskId: taskId }); @@ -79,7 +79,7 @@ describe('RadioButtonsWidgetComponent', () => { id: fieldId, restUrl: '<url>' }); - let field = widget.field; + const field = widget.field; spyOn(field, 'updateForm').and.stub(); spyOn(formService, 'getRestFieldValues').and.returnValue(new Observable((observer) => { @@ -94,7 +94,7 @@ describe('RadioButtonsWidgetComponent', () => { const taskId = '<form-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ taskId: taskId }); @@ -107,7 +107,7 @@ describe('RadioButtonsWidgetComponent', () => { observer.complete(); })); - let field = widget.field; + const field = widget.field; widget.field = null; widget.ngOnInit(); expect(formService.getRestFieldValues).not.toHaveBeenCalled(); @@ -134,7 +134,7 @@ describe('RadioButtonsWidgetComponent', () => { let fixture: ComponentFixture<RadioButtonsWidgetComponent>; let element: HTMLElement; let stubFormService: FormService; - let restOption: FormFieldOption[] = [{ id: 'opt-1', name: 'opt-name-1' }, { + const restOption: FormFieldOption[] = [{ id: 'opt-1', name: 'opt-name-1' }, { id: 'opt-2', name: 'opt-name-2' }]; @@ -161,7 +161,7 @@ describe('RadioButtonsWidgetComponent', () => { restUrl: 'rest-url' }); radioButtonWidget.field.isVisible = true; - let fakeContainer = new ContainerModel(radioButtonWidget.field); + const fakeContainer = new ContainerModel(radioButtonWidget.field); radioButtonWidget.field.form.fields.push(fakeContainer); fixture.detectChanges(); })); @@ -175,7 +175,7 @@ describe('RadioButtonsWidgetComponent', () => { })); it('should trigger field changed event on click', async(() => { - let option: HTMLElement = <HTMLElement> element.querySelector('#radio-id-opt-1-input'); + const option: HTMLElement = <HTMLElement> element.querySelector('#radio-id-opt-1-input'); expect(element.querySelector('#radio-id')).not.toBeNull(); expect(option).not.toBeNull(); option.click(); diff --git a/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts b/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts index 33b68e8a30..e43adde4ef 100644 --- a/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts +++ b/lib/core/form/components/widgets/tabs/tabs.widget.spec.ts @@ -56,7 +56,7 @@ describe('TabsWidgetComponent', () => { }); it('should emit tab changed event', (done) => { - let field = new FormFieldModel(null); + const field = new FormFieldModel(null); widget.formTabChanged.subscribe((tab) => { expect(tab).toBe(field); done(); @@ -65,7 +65,7 @@ describe('TabsWidgetComponent', () => { }); it('should remove invisible tabs', () => { - let fakeTab = new TabModel(null, { id: 'fake-tab-id', title: 'fake-tab-title' }); + const fakeTab = new TabModel(null, { id: 'fake-tab-id', title: 'fake-tab-title' }); fakeTab.isVisible = false; widget.tabs.push(fakeTab); widget.ngAfterContentChecked(); @@ -74,7 +74,7 @@ describe('TabsWidgetComponent', () => { }); it('should leave visible tabs', () => { - let fakeTab = new TabModel(null, { id: 'fake-tab-id', title: 'fake-tab-title' }); + const fakeTab = new TabModel(null, { id: 'fake-tab-id', title: 'fake-tab-title' }); fakeTab.isVisible = true; widget.tabs.push(fakeTab); widget.ngAfterContentChecked(); diff --git a/lib/core/form/components/widgets/text/text-mask.component.ts b/lib/core/form/components/widgets/text/text-mask.component.ts index bc65345dae..41cf5febc6 100644 --- a/lib/core/form/components/widgets/text/text-mask.component.ts +++ b/lib/core/form/components/widgets/text/text-mask.component.ts @@ -101,8 +101,8 @@ export class InputMaskDirective implements OnChanges, ControlValueAccessor { private maskValue(actualValue, startCaret, maskToApply, isMaskReversed, keyCode) { if (this.byPassKeys.indexOf(keyCode) === -1) { - let value = this.getMasked(false, actualValue, maskToApply, isMaskReversed); - let calculatedCaret = this.calculateCaretPosition(startCaret, actualValue, keyCode); + const value = this.getMasked(false, actualValue, maskToApply, isMaskReversed); + const calculatedCaret = this.calculateCaretPosition(startCaret, actualValue, keyCode); this.render.setAttribute(this.el.nativeElement, 'value', value); this.el.nativeElement.value = value; this.setValue(value); @@ -117,9 +117,9 @@ export class InputMaskDirective implements OnChanges, ControlValueAccessor { } calculateCaretPosition(caretPosition, newValue, keyCode) { - let newValueLength = newValue.length; - let oldValue = this.getValue() || ''; - let oldValueLength = oldValue.length; + const newValueLength = newValue.length; + const oldValue = this.getValue() || ''; + const oldValueLength = oldValue.length; if (keyCode === 8 && oldValue !== newValue) { caretPosition = caretPosition - (newValue.slice(0, caretPosition).length - oldValue.slice(0, caretPosition).length); @@ -134,18 +134,18 @@ export class InputMaskDirective implements OnChanges, ControlValueAccessor { } getMasked(skipMaskChars, val, mask, isReversed = false) { - let buf = [], - value = val, - maskIndex = 0, - maskLen = mask.length, - valueIndex = 0, - valueLength = value.length, - offset = 1, - addMethod = 'push', - resetPos = -1, - lastMaskChar, - lastUntranslatedMaskChar, - check; + const buf = []; + const value = val; + let maskIndex = 0; + const maskLen = mask.length; + let valueIndex = 0; + const valueLength = value.length; + let offset = 1; + let addMethod = 'push'; + let resetPos = -1; + let lastMaskChar; + let lastUntranslatedMaskChar; + let check; if (isReversed) { addMethod = 'unshift'; @@ -158,7 +158,7 @@ export class InputMaskDirective implements OnChanges, ControlValueAccessor { } check = this.isToCheck(isReversed, maskIndex, maskLen, valueIndex, valueLength); while (check) { - let maskDigit = mask.charAt(maskIndex), + const maskDigit = mask.charAt(maskIndex), valDigit = value.charAt(valueIndex), translation = this.translationMask[maskDigit]; @@ -203,7 +203,7 @@ export class InputMaskDirective implements OnChanges, ControlValueAccessor { check = this.isToCheck(isReversed, maskIndex, maskLen, valueIndex, valueLength); } - let lastMaskCharDigit = mask.charAt(lastMaskChar); + const lastMaskCharDigit = mask.charAt(lastMaskChar); if (maskLen === valueLength + 1 && !this.translationMask[lastMaskCharDigit]) { buf.push(lastMaskCharDigit); } diff --git a/lib/core/form/components/widgets/text/text.widget.spec.ts b/lib/core/form/components/widgets/text/text.widget.spec.ts index 0c58ad72a9..4f3f2cc38f 100644 --- a/lib/core/form/components/widgets/text/text.widget.spec.ts +++ b/lib/core/form/components/widgets/text/text.widget.spec.ts @@ -151,7 +151,7 @@ describe('TextWidgetComponent', () => { inputElement.value = 'F'; widget.field.value = 'F'; - let event: any = new Event('keyup'); + const event: any = new Event('keyup'); event.keyCode = '70'; inputElement.dispatchEvent(event); fixture.detectChanges(); @@ -183,13 +183,13 @@ describe('TextWidgetComponent', () => { inputElement.value = '1'; widget.field.value = '1'; - let event: any = new Event('keyup'); + const event: any = new Event('keyup'); event.keyCode = '49'; inputElement.dispatchEvent(event); fixture.whenStable().then(() => { fixture.detectChanges(); - let textEle: HTMLInputElement = <HTMLInputElement> element.querySelector('#text-id'); + const textEle: HTMLInputElement = <HTMLInputElement> element.querySelector('#text-id'); expect(textEle.value).toBe('1'); }); })); @@ -199,13 +199,13 @@ describe('TextWidgetComponent', () => { inputElement.value = '12345678'; widget.field.value = '12345678'; - let event: any = new Event('keyup'); + const event: any = new Event('keyup'); event.keyCode = '49'; inputElement.dispatchEvent(event); fixture.whenStable().then(() => { fixture.detectChanges(); - let textEle: HTMLInputElement = <HTMLInputElement> element.querySelector('#text-id'); + const textEle: HTMLInputElement = <HTMLInputElement> element.querySelector('#text-id'); expect(textEle.value).toBe('12-345,67%'); }); })); @@ -239,13 +239,13 @@ describe('TextWidgetComponent', () => { inputElement.value = '1234'; widget.field.value = '1234'; - let event: any = new Event('keyup'); + const event: any = new Event('keyup'); event.keyCode = '49'; inputElement.dispatchEvent(event); fixture.whenStable().then(() => { fixture.detectChanges(); - let textEle: HTMLInputElement = <HTMLInputElement> element.querySelector('#text-id'); + const textEle: HTMLInputElement = <HTMLInputElement> element.querySelector('#text-id'); expect(textEle.value).toBe('12,34%'); }); })); diff --git a/lib/core/form/components/widgets/typeahead/typeahead.widget.spec.ts b/lib/core/form/components/widgets/typeahead/typeahead.widget.spec.ts index 07967f90d6..e577445192 100644 --- a/lib/core/form/components/widgets/typeahead/typeahead.widget.spec.ts +++ b/lib/core/form/components/widgets/typeahead/typeahead.widget.spec.ts @@ -58,7 +58,7 @@ describe('TypeaheadWidgetComponent', () => { const taskId = '<form-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ taskId: taskId }); @@ -79,7 +79,7 @@ describe('TypeaheadWidgetComponent', () => { const taskId = '<form-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ taskId: taskId }); @@ -96,7 +96,7 @@ describe('TypeaheadWidgetComponent', () => { const taskId = '<form-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ taskId: taskId }); @@ -118,7 +118,7 @@ describe('TypeaheadWidgetComponent', () => { const processDefinitionId = '<process-id>'; const fieldId = '<field-id>'; - let form = new FormModel({ + const form = new FormModel({ processDefinitionId: processDefinitionId }); @@ -170,7 +170,7 @@ describe('TypeaheadWidgetComponent', () => { }); it('should setup field options on load', () => { - let options: FormFieldOption[] = [ + const options: FormFieldOption[] = [ { id: '1', name: 'One' }, { id: '2', name: 'Two' } ]; @@ -197,27 +197,27 @@ describe('TypeaheadWidgetComponent', () => { }); it('should get filtered options', () => { - let options: FormFieldOption[] = [ + const options: FormFieldOption[] = [ { id: '1', name: 'Item one' }, { id: '2', name: 'Item two' } ]; widget.field.options = options; widget.value = 'tw'; - let filtered = widget.getOptions(); + const filtered = widget.getOptions(); expect(filtered.length).toBe(1); expect(filtered[0]).toEqual(options[1]); }); it('should be case insensitive when filtering options', () => { - let options: FormFieldOption[] = [ + const options: FormFieldOption[] = [ { id: '1', name: 'Item one' }, { id: '2', name: 'iTEM TWo' } ]; widget.field.options = options; widget.value = 'tW'; - let filtered = widget.getOptions(); + const filtered = widget.getOptions(); expect(filtered.length).toBe(1); expect(filtered[0]).toEqual(options[1]); }); @@ -227,7 +227,7 @@ describe('TypeaheadWidgetComponent', () => { let fixture: ComponentFixture<TypeaheadWidgetComponent>; let element: HTMLElement; let stubFormService; - let fakeOptionList: FormFieldOption[] = [{ + const fakeOptionList: FormFieldOption[] = [{ id: '1', name: 'Fake Name 1 ' }, { @@ -259,7 +259,7 @@ describe('TypeaheadWidgetComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let readonlyInput: HTMLInputElement = <HTMLInputElement> element.querySelector('#typeahead-id'); + const readonlyInput: HTMLInputElement = <HTMLInputElement> element.querySelector('#typeahead-id'); expect(readonlyInput.disabled).toBeTruthy(); expect(readonlyInput).not.toBeNull(); expect(readonlyInput.value).toBe('FakeProcessValue'); @@ -294,8 +294,8 @@ describe('TypeaheadWidgetComponent', () => { })); it('should show typeahead options', async(() => { - let typeaheadElement = fixture.debugElement.query(By.css('#typeahead-id')); - let typeaheadHTMLElement: HTMLInputElement = <HTMLInputElement> typeaheadElement.nativeElement; + const typeaheadElement = fixture.debugElement.query(By.css('#typeahead-id')); + const typeaheadHTMLElement: HTMLInputElement = <HTMLInputElement> typeaheadElement.nativeElement; typeaheadHTMLElement.focus(); typeaheadWidgetComponent.value = 'F'; typeaheadHTMLElement.value = 'F'; @@ -311,8 +311,8 @@ describe('TypeaheadWidgetComponent', () => { })); it('should hide the option when the value is empty', async(() => { - let typeaheadElement = fixture.debugElement.query(By.css('#typeahead-id')); - let typeaheadHTMLElement: HTMLInputElement = <HTMLInputElement> typeaheadElement.nativeElement; + const typeaheadElement = fixture.debugElement.query(By.css('#typeahead-id')); + const typeaheadHTMLElement: HTMLInputElement = <HTMLInputElement> typeaheadElement.nativeElement; typeaheadHTMLElement.focus(); typeaheadWidgetComponent.value = 'F'; typeaheadHTMLElement.value = 'F'; @@ -339,7 +339,7 @@ describe('TypeaheadWidgetComponent', () => { typeaheadWidgetComponent.field.value = 'Fake Name'; typeaheadWidgetComponent.field.options = fakeOptionList; expect(element.querySelector('.adf-error-text')).toBeNull(); - let keyboardEvent = new KeyboardEvent('keypress'); + const keyboardEvent = new KeyboardEvent('keypress'); typeaheadWidgetComponent.onKeyUp(keyboardEvent); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -372,7 +372,7 @@ describe('TypeaheadWidgetComponent', () => { })); it('should show typeahead options', async(() => { - let keyboardEvent = new KeyboardEvent('keypress'); + const keyboardEvent = new KeyboardEvent('keypress'); typeaheadWidgetComponent.value = 'F'; typeaheadWidgetComponent.onKeyUp(keyboardEvent); fixture.detectChanges(); diff --git a/lib/core/form/components/widgets/typeahead/typeahead.widget.ts b/lib/core/form/components/widgets/typeahead/typeahead.widget.ts index ce43ffcf90..e24153db3c 100644 --- a/lib/core/form/components/widgets/typeahead/typeahead.widget.ts +++ b/lib/core/form/components/widgets/typeahead/typeahead.widget.ts @@ -62,12 +62,12 @@ export class TypeaheadWidgetComponent extends WidgetComponent implements OnInit ) .subscribe( (formFieldOption: FormFieldOption[]) => { - let options = formFieldOption || []; + const options = formFieldOption || []; this.field.options = options; - let fieldValue = this.field.value; + const fieldValue = this.field.value; if (fieldValue) { - let toSelect = options.find((item) => item.id === fieldValue || item.name.toLocaleLowerCase() === fieldValue.toLocaleLowerCase()); + const toSelect = options.find((item) => item.id === fieldValue || item.name.toLocaleLowerCase() === fieldValue.toLocaleLowerCase()); if (toSelect) { this.value = toSelect.name; } @@ -87,12 +87,12 @@ export class TypeaheadWidgetComponent extends WidgetComponent implements OnInit ) .subscribe( (formFieldOption: FormFieldOption[]) => { - let options = formFieldOption || []; + const options = formFieldOption || []; this.field.options = options; - let fieldValue = this.field.value; + const fieldValue = this.field.value; if (fieldValue) { - let toSelect = options.find((item) => item.id === fieldValue); + const toSelect = options.find((item) => item.id === fieldValue); if (toSelect) { this.value = toSelect.name; } @@ -105,15 +105,15 @@ export class TypeaheadWidgetComponent extends WidgetComponent implements OnInit } getOptions(): FormFieldOption[] { - let val = this.value.trim().toLocaleLowerCase(); + const val = this.value.trim().toLocaleLowerCase(); return this.field.options.filter((item) => { - let name = item.name.toLocaleLowerCase(); + const name = item.name.toLocaleLowerCase(); return name.indexOf(val) > -1; }); } isValidOptionName(optionName: string): boolean { - let option = this.field.options.find((item) => item.name && item.name.toLocaleLowerCase() === optionName.toLocaleLowerCase()); + const option = this.field.options.find((item) => item.name && item.name.toLocaleLowerCase() === optionName.toLocaleLowerCase()); return option ? true : false; } diff --git a/lib/core/form/components/widgets/upload-folder/upload-folder.widget.ts b/lib/core/form/components/widgets/upload-folder/upload-folder.widget.ts index 8d09b01b26..9ef17cd27a 100644 --- a/lib/core/form/components/widgets/upload-folder/upload-folder.widget.ts +++ b/lib/core/form/components/widgets/upload-folder/upload-folder.widget.ts @@ -67,7 +67,7 @@ export class UploadFolderWidgetComponent extends WidgetComponent implements OnIn } onFileChanged(event: any) { - let files = event.target.files; + const files = event.target.files; let filesSaved = []; if (this.field.json.value) { @@ -112,7 +112,7 @@ export class UploadFolderWidgetComponent extends WidgetComponent implements OnIn } private removeElementFromList(file) { - let index = this.field.value.indexOf(file); + const index = this.field.value.indexOf(file); if (index !== -1) { this.field.value.splice(index, 1); diff --git a/lib/core/form/components/widgets/upload/upload.widget.spec.ts b/lib/core/form/components/widgets/upload/upload.widget.spec.ts index c3eeea498b..15e45da58b 100644 --- a/lib/core/form/components/widgets/upload/upload.widget.spec.ts +++ b/lib/core/form/components/widgets/upload/upload.widget.spec.ts @@ -29,7 +29,7 @@ import { setupTestBed } from '../../../../testing/setupTestBed'; import { CoreModule } from '../../../../core.module'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -let fakePngAnswer = { +const fakePngAnswer = { 'id': 1155, 'name': 'a_png_file.png', 'created': '2017-07-25T17:17:37.099Z', @@ -43,7 +43,7 @@ let fakePngAnswer = { 'thumbnailStatus': 'queued' }; -let fakeJpgAnswer = { +const fakeJpgAnswer = { 'id': 1156, 'name': 'a_jpg_file.jpg', 'created': '2017-07-25T17:17:37.118Z', @@ -77,8 +77,8 @@ describe('UploadWidgetComponent', () => { let contentService: ProcessContentService; - let filePngFake = new File(['fakePng'], 'file-fake.png', { type: 'image/png' }); - let filJpgFake = new File(['fakeJpg'], 'file-fake.jpg', { type: 'image/jpg' }); + const filePngFake = new File(['fakePng'], 'file-fake.png', { type: 'image/png' }); + const filJpgFake = new File(['fakeJpg'], 'file-fake.jpg', { type: 'image/jpg' }); setupTestBed({ imports: [ @@ -193,10 +193,10 @@ describe('UploadWidgetComponent', () => { uploadWidgetComponent.field.params.multiple = false; fixture.detectChanges(); - let inputDebugElement = fixture.debugElement.query(By.css('#upload-id')); + const inputDebugElement = fixture.debugElement.query(By.css('#upload-id')); inputDebugElement.triggerEventHandler('change', { target: { files: [filJpgFake] } }); - let filesList = fixture.debugElement.query(By.css('#file-1156')); + const filesList = fixture.debugElement.query(By.css('#file-1156')); expect(filesList).toBeDefined(); })); @@ -216,12 +216,12 @@ describe('UploadWidgetComponent', () => { spyOn(uploadWidgetComponent.field, 'updateForm'); fixture.detectChanges(); - let inputDebugElement = fixture.debugElement.query(By.css('#upload-id')); + const inputDebugElement = fixture.debugElement.query(By.css('#upload-id')); inputDebugElement.triggerEventHandler('change', { target: { files: [filePngFake, filJpgFake] } }); fixture.whenStable().then(() => { fixture.detectChanges(); - let deleteButton = <HTMLInputElement> element.querySelector('#file-1155-remove'); + const deleteButton = <HTMLInputElement> element.querySelector('#file-1155-remove'); deleteButton.click(); expect(uploadWidgetComponent.field.updateForm).toHaveBeenCalled(); @@ -242,7 +242,7 @@ describe('UploadWidgetComponent', () => { uploadWidgetComponent.field.params.multiple = true; fixture.detectChanges(); - let inputDebugElement = fixture.debugElement.query(By.css('#upload-id')); + const inputDebugElement = fixture.debugElement.query(By.css('#upload-id')); inputDebugElement.triggerEventHandler('change', { target: { files: [filePngFake, filJpgFake] } }); fixture.whenStable().then(() => { @@ -266,8 +266,8 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-1156'); - let pngElement = element.querySelector('#file-1155'); + const jpegElement = element.querySelector('#file-1156'); + const pngElement = element.querySelector('#file-1155'); expect(jpegElement).not.toBeNull(); expect(pngElement).not.toBeNull(); expect(jpegElement.textContent).toBe('a_jpg_file.jpg'); @@ -281,20 +281,20 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-10'); + const jpegElement = element.querySelector('#file-10'); expect(jpegElement).not.toBeNull(); expect(jpegElement.textContent).toBe(`±!@#$%^&*()_+{}:”|<>?§™£-=[];’\\,./.jpg`); }); })); it('should show correctly the file name when is formed with Arabic characters', async(() => { - let name = 'غ ظ ض ذ خ ث ت ش ر ق ص ف ع س ن م ل ك ي ط ح ز و ه د ج ب ا.jpg'; + const name = 'غ ظ ض ذ خ ث ت ش ر ق ص ف ع س ن م ل ك ي ط ح ز و ه د ج ب ا.jpg'; uploadWidgetComponent.field.value.push(fakeCreationFile(name, 11)); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-11'); + const jpegElement = element.querySelector('#file-11'); expect(jpegElement).not.toBeNull(); expect(jpegElement.textContent).toBe('غ ظ ض ذ خ ث ت ش ر ق ص ف ع س ن م ل ك ي ط ح ز و ه د ج ب ا.jpg'); }); @@ -308,7 +308,7 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-12'); + const jpegElement = element.querySelector('#file-12'); expect(jpegElement).not.toBeNull(); // cspell: disable-next expect(jpegElement.textContent).toBe('Àâæçéèêëïîôœùûüÿ.jpg'); @@ -323,7 +323,7 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-13'); + const jpegElement = element.querySelector('#file-13'); expect(jpegElement).not.toBeNull(); // cspell: disable-next expect(jpegElement.textContent).toBe('άέήίϊϊΐόύϋΰώθωερτψυιοπασδφγηςκλζχξωβνμ.jpg'); @@ -336,7 +336,7 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-14'); + const jpegElement = element.querySelector('#file-14'); expect(jpegElement).not.toBeNull(); expect(jpegElement.textContent).toBe('Ą Ć Ę Ł Ń Ó Ś Ź Żą ć ę ł ń ó ś ź ż.jpg'); }); @@ -348,7 +348,7 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-15'); + const jpegElement = element.querySelector('#file-15'); expect(jpegElement).not.toBeNull(); expect(jpegElement.textContent).toBe('á, é, í, ó, ú, ñ, Ñ, ü, Ü, ¿, ¡. Á, É, Í, Ó, Ú.jpg'); }); @@ -361,7 +361,7 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let jpegElement = element.querySelector('#file-16'); + const jpegElement = element.querySelector('#file-16'); expect(jpegElement).not.toBeNull(); // cspell: disable-next expect(jpegElement.textContent).toBe('Äåéö.jpg'); @@ -376,10 +376,10 @@ describe('UploadWidgetComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let buttonElement = <HTMLButtonElement> element.querySelector('#file-1156-remove'); + const buttonElement = <HTMLButtonElement> element.querySelector('#file-1156-remove'); buttonElement.click(); fixture.detectChanges(); - let jpegElement = element.querySelector('#file-1156'); + const jpegElement = element.querySelector('#file-1156'); expect(jpegElement).toBeNull(); expect(uploadWidgetComponent.field.value.length).toBe(1); }); @@ -402,7 +402,7 @@ describe('UploadWidgetComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let fileJpegIcon = debugElement.query(By.css('#file-1156-icon')); + const fileJpegIcon = debugElement.query(By.css('#file-1156-icon')); fileJpegIcon.nativeElement.dispatchEvent(new MouseEvent('click')); }); diff --git a/lib/core/form/components/widgets/upload/upload.widget.ts b/lib/core/form/components/widgets/upload/upload.widget.ts index d33246528c..3f18a94f15 100644 --- a/lib/core/form/components/widgets/upload/upload.widget.ts +++ b/lib/core/form/components/widgets/upload/upload.widget.ts @@ -67,7 +67,7 @@ export class UploadWidgetComponent extends WidgetComponent implements OnInit { } onFileChanged(event: any) { - let files = event.target.files; + const files = event.target.files; let filesSaved = []; if (this.field.json.value) { @@ -109,7 +109,7 @@ export class UploadWidgetComponent extends WidgetComponent implements OnInit { } private removeElementFromList(file) { - let index = this.field.value.indexOf(file); + const index = this.field.value.indexOf(file); if (index !== -1) { this.field.value.splice(index, 1); diff --git a/lib/core/form/components/widgets/widget.component.spec.ts b/lib/core/form/components/widgets/widget.component.spec.ts index 9bfb274e21..97ff34825f 100644 --- a/lib/core/form/components/widgets/widget.component.spec.ts +++ b/lib/core/form/components/widgets/widget.component.spec.ts @@ -64,8 +64,8 @@ describe('WidgetComponent', () => { }); it('should send an event after view init', (done) => { - let fakeForm = new FormModel(); - let fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'}); + const fakeForm = new FormModel(); + const fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'}); widget.field = fakeField; widget.fieldChanged.subscribe((field) => { @@ -79,8 +79,8 @@ describe('WidgetComponent', () => { }); it('should send an event when a field is changed', (done) => { - let fakeForm = new FormModel(); - let fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'}); + const fakeForm = new FormModel(); + const fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'}); widget.fieldChanged.subscribe((field) => { expect(field).not.toBe(null); expect(field.id).toBe('fakeField'); diff --git a/lib/core/form/models/form-definition.model.ts b/lib/core/form/models/form-definition.model.ts index 09f7f45ef2..3160458748 100644 --- a/lib/core/form/models/form-definition.model.ts +++ b/lib/core/form/models/form-definition.model.ts @@ -62,11 +62,11 @@ export class FormDefinitionModel extends FormSaveRepresentation { } private metadataToFields(metadata: any): any[] { - let fields = []; + const fields = []; if (metadata) { metadata.forEach(function(property) { if (property) { - let field = { + const field = { type: 'text', id: property.name, name: property.name, diff --git a/lib/core/form/services/activiti-alfresco.service.ts b/lib/core/form/services/activiti-alfresco.service.ts index fec4f133e6..afb8af1a25 100644 --- a/lib/core/form/services/activiti-alfresco.service.ts +++ b/lib/core/form/services/activiti-alfresco.service.ts @@ -43,8 +43,8 @@ export class ActivitiContentService { * @param folderId */ getAlfrescoNodes(accountId: string, folderId: string): Observable<[ExternalContent]> { - let apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); - let accountShortId = accountId.replace('alfresco-', ''); + const apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); + const accountShortId = accountId.replace('alfresco-', ''); return from(apiService.activiti.alfrescoApi.getContentInFolder(accountShortId, folderId)) .pipe( map(this.toJsonArray), @@ -59,7 +59,7 @@ export class ActivitiContentService { * @param folderId */ getAlfrescoRepositories(tenantId: number, includeAccount: boolean): Observable<any> { - let apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); + const apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); const opts = { tenantId: tenantId, includeAccounts: includeAccount @@ -94,7 +94,7 @@ export class ActivitiContentService { } applyAlfrescoNode(node: MinimalNode, siteId: string, accountId: string) { - let apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); + const apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); const currentSideId = siteId ? siteId : this.getSiteNameFromNodePath(node); const params: RelatedContentRepresentation = { source: accountId, diff --git a/lib/core/form/services/ecm-model.service.spec.ts b/lib/core/form/services/ecm-model.service.spec.ts index 35e0bf5d4b..ca1664fb6c 100644 --- a/lib/core/form/services/ecm-model.service.spec.ts +++ b/lib/core/form/services/ecm-model.service.spec.ts @@ -63,7 +63,7 @@ describe('EcmModelService', () => { it('Should fetch ECM types', (done) => { - let modelName = 'modelTest'; + const modelName = 'modelTest'; service.getEcmType(modelName).subscribe(() => { expect(jasmine.Ajax.requests.mostRecent().url.endsWith('versions/1/cmm/' + modelName + '/types')).toBeTruthy(); @@ -79,7 +79,7 @@ describe('EcmModelService', () => { it('Should create ECM types', (done) => { - let typeName = 'typeTest'; + const typeName = 'typeTest'; service.createEcmType(typeName, EcmModelService.MODEL_NAME, EcmModelService.TYPE_MODEL).subscribe(() => { expect(jasmine.Ajax.requests.mostRecent().url.endsWith('versions/1/cmm/' + EcmModelService.MODEL_NAME + '/types')).toBeTruthy(); @@ -98,8 +98,8 @@ describe('EcmModelService', () => { it('Should create ECM types with a clean and preserve real name in the title', (done) => { - let typeName = 'typeTest:testName@#$*!'; - let cleanName = 'testName'; + const typeName = 'typeTest:testName@#$*!'; + const cleanName = 'testName'; service.createEcmType(typeName, EcmModelService.MODEL_NAME, EcmModelService.TYPE_MODEL).subscribe(() => { expect(jasmine.Ajax.requests.mostRecent().url.endsWith('versions/1/cmm/' + EcmModelService.MODEL_NAME + '/types')).toBeTruthy(); @@ -118,8 +118,8 @@ describe('EcmModelService', () => { it('Should add property to a type', (done) => { - let typeName = 'typeTest'; - let formFields = { + const typeName = 'typeTest'; + const formFields = { values: { test: 'test', test2: 'test2' @@ -157,9 +157,9 @@ describe('EcmModelService', () => { it('Should add property to a type and clean name type', (done) => { - let typeName = 'typeTest:testName@#$*!'; - let cleanName = 'testName'; - let formFields = { + const typeName = 'typeTest:testName@#$*!'; + const cleanName = 'testName'; + const formFields = { values: { test: 'test', test2: 'test2' diff --git a/lib/core/form/services/ecm-model.service.ts b/lib/core/form/services/ecm-model.service.ts index 323cdee17d..7d32a1b587 100644 --- a/lib/core/form/services/ecm-model.service.ts +++ b/lib/core/form/services/ecm-model.service.ts @@ -160,7 +160,7 @@ export class EcmModelService { } public createEcmType(typeName: string, modelName: string, parentType: string): Observable<any> { - let name = this.cleanNameType(typeName); + const name = this.cleanNameType(typeName); return from(this.apiService.getInstance().core.customModelApi.createCustomType(modelName, name, parentType, typeName, '')) .pipe( @@ -170,11 +170,11 @@ export class EcmModelService { } public addPropertyToAType(modelName: string, typeName: string, formFields: any) { - let name = this.cleanNameType(typeName); + const name = this.cleanNameType(typeName); - let properties = []; + const properties = []; if (formFields && formFields.values) { - for (let key in formFields.values) { + for (const key in formFields.values) { if (key) { properties.push({ name: key, diff --git a/lib/core/form/services/form-rendering.service.spec.ts b/lib/core/form/services/form-rendering.service.spec.ts index 861d31f8ad..5e08dba434 100644 --- a/lib/core/form/services/form-rendering.service.spec.ts +++ b/lib/core/form/services/form-rendering.service.spec.ts @@ -33,37 +33,37 @@ describe('FormRenderingService', () => { }); it('should resolve Upload field as Upload widget', () => { - let field = new FormFieldModel(null, { + const field = new FormFieldModel(null, { type: FormFieldTypes.UPLOAD, params: { link: null } }); - let type = service.resolveComponentType(field); + const type = service.resolveComponentType(field); expect(type).toBe(UploadWidgetComponent); }); it('should resolve Upload widget for Upload field', () => { - let resolver = service.getComponentTypeResolver(FormFieldTypes.UPLOAD); - let type = resolver(null); + const resolver = service.getComponentTypeResolver(FormFieldTypes.UPLOAD); + const type = resolver(null); expect(type).toBe(UploadWidgetComponent); }); it('should resolve Unknown widget for unknown field type', () => { - let resolver = service.getComponentTypeResolver('missing-type'); - let type = resolver(null); + const resolver = service.getComponentTypeResolver('missing-type'); + const type = resolver(null); expect(type).toBe(UnknownWidgetComponent); }); it('should fallback to default resolver when field type missing', () => { - let resolver = service.getComponentTypeResolver(null); - let type = resolver(null); + const resolver = service.getComponentTypeResolver(null); + const type = resolver(null); expect(type).toBe(UnknownWidgetComponent); }); it('should fallback to custom resolver when field type missing', () => { - let resolver = service.getComponentTypeResolver(null, UploadWidgetComponent); - let type = resolver(null); + const resolver = service.getComponentTypeResolver(null, UploadWidgetComponent); + const type = resolver(null); expect(type).toBe(UploadWidgetComponent); }); @@ -96,13 +96,13 @@ describe('FormRenderingService', () => { }); it('should override existing resolver with explicit flag', () => { - let customResolver = DynamicComponentResolver.fromType(UnknownWidgetComponent); + const customResolver = DynamicComponentResolver.fromType(UnknownWidgetComponent); service.setComponentTypeResolver(FormFieldTypes.TEXT, customResolver, true); expect(service.getComponentTypeResolver(FormFieldTypes.TEXT)).toBe(customResolver); }); it('should override existing resolver without explicit flag', () => { - let customResolver = DynamicComponentResolver.fromType(UnknownWidgetComponent); + const customResolver = DynamicComponentResolver.fromType(UnknownWidgetComponent); service.setComponentTypeResolver(FormFieldTypes.TEXT, customResolver); expect(service.getComponentTypeResolver(FormFieldTypes.TEXT)).toBe(customResolver); }); diff --git a/lib/core/form/services/form.service.spec.ts b/lib/core/form/services/form.service.spec.ts index aa543a73dc..2e31d2b953 100644 --- a/lib/core/form/services/form.service.spec.ts +++ b/lib/core/form/services/form.service.spec.ts @@ -26,7 +26,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; declare let jasmine: any; -let fakeGroupResponse = { +const fakeGroupResponse = { 'size': 2, 'total': 2, 'start': 0, @@ -39,7 +39,7 @@ let fakeGroupResponse = { }, { 'id': 2005, 'name': 'PEOPLE_GROUP_2', 'externalId': null, 'status': 'active', 'groups': null }] }; -let fakePeopleResponse = { +const fakePeopleResponse = { 'size': 3, 'total': 3, 'start': 0, @@ -78,19 +78,19 @@ describe('Form service', () => { describe('Content tests', () => { - let responseBody = { + const responseBody = { data: [ { id: '1' }, { id: '2' } ] }; - let values = { + const values = { field1: 'one', field2: 'two' }; - let simpleResponseBody = { id: 1, modelType: 'test' }; + const simpleResponseBody = { id: 1, modelType: 'test' }; it('should fetch and parse process definitions', (done) => { service.getProcessDefinitions().subscribe((result) => { @@ -211,7 +211,7 @@ describe('Form service', () => { it('should get form definition id by name', (done) => { const formName = 'form1'; const formId = 1; - let response = { + const response = { data: [ { id: formId } ] @@ -232,7 +232,7 @@ describe('Form service', () => { it('should get start form definition by process definition id', (done) => { - let processApiSpy = jasmine.createSpyObj(['getProcessDefinitionStartForm']); + const processApiSpy = jasmine.createSpyObj(['getProcessDefinitionStartForm']); spyOn(apiService, 'getInstance').and.returnValue({ activiti: { processApi: processApiSpy @@ -327,7 +327,7 @@ describe('Form service', () => { }); it('should search for Form with modelType=2', (done) => { - let response = { data: [{ id: 1, name: 'findMe' }, { id: 2, name: 'testForm' }] }; + const response = { data: [{ id: 1, name: 'findMe' }, { id: 2, name: 'testForm' }] }; service.searchFrom('findMe').subscribe((result) => { expect(jasmine.Ajax.requests.mostRecent().url.endsWith('models?modelType=2')).toBeTruthy(); @@ -360,7 +360,7 @@ describe('Form service', () => { it('should return list of people', (done) => { spyOn(service, 'getUserProfileImageApi').and.returnValue('/app/rest/users/2002/picture'); - let fakeFilter: string = 'whatever'; + const fakeFilter: string = 'whatever'; service.getWorkflowUsers(fakeFilter).subscribe((result) => { expect(result).toBeDefined(); @@ -378,7 +378,7 @@ describe('Form service', () => { }); it('should return list of groups', (done) => { - let fakeFilter: string = 'whatever'; + const fakeFilter: string = 'whatever'; service.getWorkflowGroups(fakeFilter).subscribe((result) => { expect(result).toBeDefined(); @@ -403,9 +403,9 @@ describe('Form service', () => { it('should create a Form form a Node', (done) => { - let nameForm = 'testNode'; + const nameForm = 'testNode'; - let formId = 100; + const formId = 100; stubCreateForm(); diff --git a/lib/core/form/services/form.service.ts b/lib/core/form/services/form.service.ts index 00fc1cade1..65f5a57d28 100644 --- a/lib/core/form/services/form.service.ts +++ b/lib/core/form/services/form.service.ts @@ -102,7 +102,7 @@ export class FormService { */ parseForm(json: any, data?: FormValues, readOnly: boolean = false): FormModel { if (json) { - let form = new FormModel(json, data, readOnly, this); + const form = new FormModel(json, data, readOnly, this); if (!json.fields) { form.outcomes = [ new FormOutcomeModel(form, { @@ -128,7 +128,7 @@ export class FormService { (form) => { this.ecmModelService.searchEcmType(formName, EcmModelService.MODEL_NAME).subscribe( (customType) => { - let formDefinitionModel = new FormDefinitionModel(form.id, form.name, form.lastUpdatedByFullName, form.lastUpdated, customType.entry.properties); + const formDefinitionModel = new FormDefinitionModel(form.id, form.name, form.lastUpdatedByFullName, form.lastUpdated, customType.entry.properties); from( this.editorApi.saveForm(form.id, formDefinitionModel) ).subscribe((formData) => { @@ -148,7 +148,7 @@ export class FormService { * @returns The new form */ createForm(formName: string): Observable<any> { - let dataModel = { + const dataModel = { name: formName, description: '', modelType: 2, @@ -178,7 +178,7 @@ export class FormService { * @returns Form model(s) matching the search name */ searchFrom(name: string): Observable<any> { - let opts = { + const opts = { 'modelType': 2 }; @@ -198,7 +198,7 @@ export class FormService { * @returns List of form models */ getForms(): Observable<any> { - let opts = { + const opts = { 'modelType': 2 }; @@ -266,7 +266,7 @@ export class FormService { * @returns Null response when the operation is complete */ saveTaskForm(taskId: string, formValues: FormValues): Observable<any> { - let saveFormRepresentation = <SaveFormRepresentation> { values: formValues }; + const saveFormRepresentation = <SaveFormRepresentation> { values: formValues }; return from(this.taskApi.saveTaskForm(taskId, saveFormRepresentation)) .pipe( @@ -282,7 +282,7 @@ export class FormService { * @returns Null response when the operation is complete */ completeTaskForm(taskId: string, formValues: FormValues, outcome?: string): Observable<any> { - let completeFormRepresentation: any = <CompleteFormRepresentation> { values: formValues }; + const completeFormRepresentation: any = <CompleteFormRepresentation> { values: formValues }; if (outcome) { completeFormRepresentation.outcome = outcome; } @@ -325,7 +325,7 @@ export class FormService { * @returns Form definition */ getFormDefinitionByName(name: string): Observable<any> { - let opts = { + const opts = { 'filter': 'myReusableForms', 'filterText': name, 'modelType': 2 @@ -447,7 +447,7 @@ export class FormService { * @returns Array of users */ getWorkflowUsers(filter: string, groupId?: string): Observable<UserProcessModel[]> { - let option: any = { filter: filter }; + const option: any = { filter: filter }; if (groupId) { option.groupId = groupId; } @@ -471,7 +471,7 @@ export class FormService { * @returns Array of groups */ getWorkflowGroups(filter: string, groupId?: string): Observable<GroupModel[]> { - let option: any = { filter: filter }; + const option: any = { filter: filter }; if (groupId) { option.groupId = groupId; } diff --git a/lib/core/form/services/node.service.spec.ts b/lib/core/form/services/node.service.spec.ts index 6579aaaadf..54503d9883 100644 --- a/lib/core/form/services/node.service.spec.ts +++ b/lib/core/form/services/node.service.spec.ts @@ -54,7 +54,7 @@ describe('NodeService', () => { }); it('Should fetch and node metadata', (done) => { - let responseBody = { + const responseBody = { entry: { id: '111-222-33-44-1123', nodeType: 'typeTest', @@ -67,7 +67,7 @@ describe('NodeService', () => { service.getNodeMetadata('-nodeid-').subscribe((result) => { expect(jasmine.Ajax.requests.mostRecent().url.endsWith('nodes/-nodeid-')).toBeTruthy(); - let node = new NodeMetadata({ + const node = new NodeMetadata({ test: 'test', testdata: 'testdata' }, 'typeTest'); @@ -83,7 +83,7 @@ describe('NodeService', () => { }); it('Should clean the metadata from :', (done) => { - let responseBody = { + const responseBody = { entry: { id: '111-222-33-44-1123', nodeType: 'typeTest', @@ -96,7 +96,7 @@ describe('NodeService', () => { service.getNodeMetadata('-nodeid-').subscribe((result) => { expect(jasmine.Ajax.requests.mostRecent().url.endsWith('nodes/-nodeid-')).toBeTruthy(); - let node = new NodeMetadata({ + const node = new NodeMetadata({ test: 'test', testdata: 'testdata' }, 'typeTest'); @@ -112,12 +112,12 @@ describe('NodeService', () => { }); it('Should create a node with metadata', (done) => { - let data = { + const data = { test: 'test', testdata: 'testdata' }; - let responseBody = { + const responseBody = { id: 'a74d91fb-ea8a-4812-ad98-ad878366b5be', isFile: false, isFolder: true @@ -136,7 +136,7 @@ describe('NodeService', () => { }); it('Should add activitiForms suffix to the metadata properties', (done) => { - let data = { + const data = { test: 'test', testdata: 'testdata' }; @@ -156,7 +156,7 @@ describe('NodeService', () => { }); it('Should assign an UUID to the name when name not passed', (done) => { - let data = { + const data = { test: 'test', testdata: 'testdata' }; diff --git a/lib/core/form/services/node.service.ts b/lib/core/form/services/node.service.ts index 83e887f919..be942956a1 100644 --- a/lib/core/form/services/node.service.ts +++ b/lib/core/form/services/node.service.ts @@ -50,8 +50,8 @@ export class NodeService { * @returns The created node */ public createNodeMetadata(nodeType: string, nameSpace: any, data: any, path: string, name?: string): Observable<NodeEntry> { - let properties = {}; - for (let key in data) { + const properties = {}; + for (const key in data) { if (data[key]) { properties[nameSpace + ':' + key] = data[key]; } @@ -69,29 +69,29 @@ export class NodeService { * @returns The created node */ public createNode(name: string, nodeType: string, properties: any, path: string): Observable<NodeEntry> { - let body = { + const body = { name: name, nodeType: nodeType, properties: properties, relativePath: path }; - let apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); + const apiService: AlfrescoApiCompatibility = this.apiService.getInstance(); return from(apiService.nodes.addNode('-root-', body, {})); } private generateUuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - let r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); + const r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } private cleanMetadataFromSemicolon(nodeEntry: NodeEntry): NodeMetadata { - let metadata = {}; + const metadata = {}; if (nodeEntry && nodeEntry.entry.properties) { - for (let key in nodeEntry.entry.properties) { + for (const key in nodeEntry.entry.properties) { if (key) { if (key.indexOf(':') !== -1) { metadata [key.split(':')[1]] = nodeEntry.entry.properties[key]; diff --git a/lib/core/form/services/process-content.service.spec.ts b/lib/core/form/services/process-content.service.spec.ts index 3340e8987f..148048cf98 100644 --- a/lib/core/form/services/process-content.service.spec.ts +++ b/lib/core/form/services/process-content.service.spec.ts @@ -26,7 +26,7 @@ import { AlfrescoApiServiceMock } from '../../mock/alfresco-api.service.mock'; declare let jasmine: any; -let fileContentPdfResponseBody = { +const fileContentPdfResponseBody = { id: 999, name: 'fake-name.pdf', created: '2017-01-23T12:12:53.219+0000', @@ -40,7 +40,7 @@ let fileContentPdfResponseBody = { thumbnailStatus: 'created' }; -let fileContentJpgResponseBody = { +const fileContentJpgResponseBody = { id: 888, name: 'fake-name.jpg', created: '2017-01-23T12:12:53.219+0000', @@ -55,9 +55,9 @@ let fileContentJpgResponseBody = { }; function createFakeBlob() { - let data = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='; + const data = 'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='; - let bytes = new Uint8Array(data.length / 2); + const bytes = new Uint8Array(data.length / 2); for (let i = 0; i < data.length; i += 2) { bytes[i / 2] = parseInt(data.substring(i, i + 2), /* base = */ 16); @@ -144,7 +144,7 @@ describe('ProcessContentService', () => { }); it('should return the unsupported content when the file is an image', (done) => { - let contentId: number = 888; + const contentId: number = 888; service.getFileContent(contentId).subscribe((result) => { expect(result.id).toEqual(contentId); @@ -162,7 +162,7 @@ describe('ProcessContentService', () => { }); it('should return the supported content when the file is a pdf', (done) => { - let contentId: number = 999; + const contentId: number = 999; service.getFileContent(contentId).subscribe((result) => { expect(result.id).toEqual(contentId); @@ -180,14 +180,14 @@ describe('ProcessContentService', () => { }); it('should return the raw content URL', () => { - let contentId: number = 999; - let contentUrl = service.getFileRawContentUrl(contentId); + const contentId: number = 999; + const contentUrl = service.getFileRawContentUrl(contentId); expect(contentUrl).toContain(`/api/enterprise/content/${contentId}/raw`); }); it('should return a Blob as thumbnail', (done) => { - let contentId: number = 999; - let blob = createFakeBlob(); + const contentId: number = 999; + const blob = createFakeBlob(); spyOn(service, 'getContentThumbnail').and.returnValue(of(blob)); service.getContentThumbnail(contentId).subscribe((result) => { expect(result).toEqual(jasmine.any(Blob)); diff --git a/lib/core/form/services/widget-visibility.service.spec.ts b/lib/core/form/services/widget-visibility.service.spec.ts index f553e65a18..73449a2135 100644 --- a/lib/core/form/services/widget-visibility.service.spec.ts +++ b/lib/core/form/services/widget-visibility.service.spec.ts @@ -38,7 +38,7 @@ describe('WidgetVisibilityService', () => { let service: WidgetVisibilityService; let booleanResult: boolean; - let stubFormWithFields = new FormModel(fakeFormJson); + const stubFormWithFields = new FormModel(fakeFormJson); setupTestBed({ imports: [ @@ -186,9 +186,9 @@ describe('WidgetVisibilityService', () => { }); describe('should retrieve the process variables', () => { - let fakeFormWithField = new FormModel(fakeFormJson); + const fakeFormWithField = new FormModel(fakeFormJson); let visibilityObjTest: WidgetVisibilityModel; - let chainedVisibilityObj = new WidgetVisibilityModel(); + const chainedVisibilityObj = new WidgetVisibilityModel(); beforeEach(() => { visibilityObjTest = new WidgetVisibilityModel(); @@ -216,7 +216,7 @@ describe('WidgetVisibilityService', () => { service.getTaskProcessVariable('9999').subscribe( (res: TaskProcessVariableModel[]) => { expect(res).toBeDefined(); - let varValue = service.getVariableValue(formTest, 'TEST_VAR_1', res); + const varValue = service.getVariableValue(formTest, 'TEST_VAR_1', res); expect(varValue).not.toBeUndefined(); expect(varValue).toBe('test_value_1'); done(); @@ -232,7 +232,7 @@ describe('WidgetVisibilityService', () => { it('should return undefined if the variable does not exist', (done) => { service.getTaskProcessVariable('9999').subscribe( (res: TaskProcessVariableModel[]) => { - let varValue = service.getVariableValue(formTest, 'TEST_MYSTERY_VAR', res); + const varValue = service.getVariableValue(formTest, 'TEST_MYSTERY_VAR', res); expect(varValue).toBeUndefined(); done(); } @@ -248,7 +248,7 @@ describe('WidgetVisibilityService', () => { service.getTaskProcessVariable('9999').subscribe( (res: TaskProcessVariableModel[]) => { visibilityObjTest.rightRestResponseId = 'TEST_VAR_2'; - let rightValue = service.getRightValue(formTest, visibilityObjTest); + const rightValue = service.getRightValue(formTest, visibilityObjTest); expect(rightValue).not.toBeNull(); expect(rightValue).toBe('test_value_2'); @@ -266,7 +266,7 @@ describe('WidgetVisibilityService', () => { service.getTaskProcessVariable('9999').subscribe( (res: TaskProcessVariableModel[]) => { visibilityObjTest.leftRestResponseId = 'TEST_VAR_2'; - let rightValue = service.getLeftValue(formTest, visibilityObjTest); + const rightValue = service.getLeftValue(formTest, visibilityObjTest); expect(rightValue).not.toBeNull(); expect(rightValue).toBe('test_value_2'); @@ -286,7 +286,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'LEFT_FORM_FIELD_ID'; visibilityObjTest.operator = '!='; visibilityObjTest.rightRestResponseId = 'TEST_VAR_2'; - let isVisible = service.isFieldVisible(fakeFormWithField, visibilityObjTest); + const isVisible = service.isFieldVisible(fakeFormWithField, visibilityObjTest); expect(isVisible).toBeTruthy(); done(); @@ -310,7 +310,7 @@ describe('WidgetVisibilityService', () => { chainedVisibilityObj.operator = '!empty'; visibilityObjTest.nextCondition = chainedVisibilityObj; - let isVisible = service.isFieldVisible(fakeFormWithField, visibilityObjTest); + const isVisible = service.isFieldVisible(fakeFormWithField, visibilityObjTest); expect(isVisible).toBeTruthy(); done(); @@ -337,13 +337,13 @@ describe('WidgetVisibilityService', () => { describe('should return the value of the field', () => { let visibilityObjTest: WidgetVisibilityModel; - let fakeFormWithField = new FormModel(fakeFormJson); - let jsonFieldFake = { + const fakeFormWithField = new FormModel(fakeFormJson); + const jsonFieldFake = { id: 'FAKE_FORM_FIELD_ID', value: 'FAKE_FORM_FIELD_VALUE', visibilityCondition: undefined }; - let fakeForm = new FormModel({ + const fakeForm = new FormModel({ variables: [ { name: 'FORM_VARIABLE_TEST', @@ -363,28 +363,28 @@ describe('WidgetVisibilityService', () => { }); it('should be able to retrieve a field value searching in the form', () => { - let formValue = service.searchValueInForm(stubFormWithFields, 'FIELD_WITH_CONDITION'); + const formValue = service.searchValueInForm(stubFormWithFields, 'FIELD_WITH_CONDITION'); expect(formValue).not.toBeNull(); expect(formValue).toBe('field_with_condition_value'); }); it('should return empty string if the field value is not in the form', () => { - let formValue = service.searchValueInForm(stubFormWithFields, 'FIELD_MYSTERY'); + const formValue = service.searchValueInForm(stubFormWithFields, 'FIELD_MYSTERY'); expect(formValue).not.toBeUndefined(); expect(formValue).toBe(''); }); it('should search in the form if element value is not in form values', () => { - let value = service.getFormValue(fakeFormWithField, 'FIELD_WITH_CONDITION'); + const value = service.getFormValue(fakeFormWithField, 'FIELD_WITH_CONDITION'); expect(value).not.toBeNull(); expect(value).toBe('field_with_condition_value'); }); it('should return empty string if the element is not present anywhere', () => { - let formValue = service.getFormValue(fakeFormWithField, 'FIELD_MYSTERY'); + const formValue = service.getFormValue(fakeFormWithField, 'FIELD_MYSTERY'); expect(formValue).not.toBeUndefined(); expect(formValue).toBe(''); @@ -392,35 +392,35 @@ describe('WidgetVisibilityService', () => { it('should retrieve the value for the right field when it is a value', () => { visibilityObjTest.rightValue = '100'; - let rightValue = service.getRightValue(formTest, visibilityObjTest); + const rightValue = service.getRightValue(formTest, visibilityObjTest); expect(rightValue).toBe('100'); }); it('should return formatted date when right value is a date', () => { visibilityObjTest.rightValue = '9999-12-31'; - let rightValue = service.getRightValue(formTest, visibilityObjTest); + const rightValue = service.getRightValue(formTest, visibilityObjTest); expect(rightValue).toBe('9999-12-31T00:00:00.000Z'); }); it('should return the value when right value is not a date', () => { visibilityObjTest.rightValue = '9999-99-99'; - let rightValue = service.getRightValue(formTest, visibilityObjTest); + const rightValue = service.getRightValue(formTest, visibilityObjTest); expect(rightValue).toBe('9999-99-99'); }); it('should retrieve the value for the right field when it is a form variable', () => { visibilityObjTest.rightFormFieldId = 'RIGHT_FORM_FIELD_ID'; - let rightValue = service.getRightValue(fakeFormWithField, visibilityObjTest); + const rightValue = service.getRightValue(fakeFormWithField, visibilityObjTest); expect(rightValue).not.toBeNull(); expect(rightValue).toBe('RIGHT_FORM_FIELD_VALUE'); }); it('should take the value from form values if it is present', () => { - let formValue = service.getFormValue(formTest, 'test_1'); + const formValue = service.getFormValue(formTest, 'test_1'); expect(formValue).not.toBeNull(); expect(formValue).toBe('value_1'); @@ -428,7 +428,7 @@ describe('WidgetVisibilityService', () => { it('should retrieve right value from form values if it is present', () => { visibilityObjTest.rightFormFieldId = 'test_2'; - let rightValue = service.getRightValue(formTest, visibilityObjTest); + const rightValue = service.getRightValue(formTest, visibilityObjTest); expect(rightValue).not.toBeNull(); expect(formTest.values).toEqual(formValues); @@ -437,7 +437,7 @@ describe('WidgetVisibilityService', () => { it('should retrieve the value for the left field when it is a form value', () => { visibilityObjTest.leftFormFieldId = 'FIELD_WITH_CONDITION'; - let leftValue = service.getLeftValue(fakeFormWithField, visibilityObjTest); + const leftValue = service.getLeftValue(fakeFormWithField, visibilityObjTest); expect(leftValue).not.toBeNull(); expect(leftValue).toBe('field_with_condition_value'); @@ -445,14 +445,14 @@ describe('WidgetVisibilityService', () => { it('should retrieve left value from form values if it is present', () => { visibilityObjTest.leftFormFieldId = 'test_2'; - let leftValue = service.getLeftValue(formTest, visibilityObjTest); + const leftValue = service.getLeftValue(formTest, visibilityObjTest); expect(leftValue).not.toBeNull(); expect(leftValue).toBe('value_2'); }); it('should return an empty string for a value that is not on variable or form', () => { - let leftValue = service.getLeftValue(fakeFormWithField, visibilityObjTest); + const leftValue = service.getLeftValue(fakeFormWithField, visibilityObjTest); expect(leftValue).toBe(''); }); @@ -461,7 +461,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'test_1'; visibilityObjTest.operator = '=='; visibilityObjTest.rightFormFieldId = 'test_3'; - let isVisible = service.isFieldVisible(formTest, visibilityObjTest); + const isVisible = service.isFieldVisible(formTest, visibilityObjTest); expect(isVisible).toBeTruthy(); }); @@ -470,14 +470,14 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'test_1'; visibilityObjTest.operator = '=='; visibilityObjTest.rightValue = 'value_1'; - let isVisible = service.isFieldVisible(formTest, visibilityObjTest); + const isVisible = service.isFieldVisible(formTest, visibilityObjTest); expect(isVisible).toBeTruthy(); }); it('should return empty string for a value that is not on variable or form', () => { visibilityObjTest.rightFormFieldId = 'NO_FIELD_FORM'; - let rightValue = service.getRightValue(fakeFormWithField, visibilityObjTest); + const rightValue = service.getRightValue(fakeFormWithField, visibilityObjTest); expect(rightValue).not.toBeUndefined(); expect(rightValue).toBe(''); @@ -487,7 +487,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'LEFT_FORM_FIELD_ID'; visibilityObjTest.operator = '!='; visibilityObjTest.rightFormFieldId = 'RIGHT_FORM_FIELD_ID'; - let isVisible = service.isFieldVisible(fakeFormWithField, visibilityObjTest); + const isVisible = service.isFieldVisible(fakeFormWithField, visibilityObjTest); expect(isVisible).toBeTruthy(); }); @@ -496,7 +496,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'test_1'; visibilityObjTest.operator = '!='; visibilityObjTest.rightFormFieldId = 'test_3'; - let fakeFormField: FormFieldModel = new FormFieldModel(formTest, jsonFieldFake); + const fakeFormField: FormFieldModel = new FormFieldModel(formTest, jsonFieldFake); service.refreshEntityVisibility(fakeFormField); expect(fakeFormField.isVisible).toBeFalsy(); @@ -506,14 +506,14 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = ''; visibilityObjTest.leftRestResponseId = ''; visibilityObjTest.operator = '!='; - let isVisible = service.evaluateVisibility(formTest, visibilityObjTest); + const isVisible = service.evaluateVisibility(formTest, visibilityObjTest); expect(isVisible).toBeTruthy(); }); it('should return always true when field does not have a visibility condition', () => { jsonFieldFake.visibilityCondition = null; - let fakeFormField: FormFieldModel = new FormFieldModel(fakeFormWithField, jsonFieldFake); + const fakeFormField: FormFieldModel = new FormFieldModel(fakeFormWithField, jsonFieldFake); fakeFormField.isVisible = false; service.refreshEntityVisibility(fakeFormField); @@ -521,28 +521,28 @@ describe('WidgetVisibilityService', () => { }); it('should be able to retrieve the value of a form variable', () => { - let varValue = service.getVariableValue(fakeForm, 'FORM_VARIABLE_TEST', null); + const varValue = service.getVariableValue(fakeForm, 'FORM_VARIABLE_TEST', null); expect(varValue).not.toBeUndefined(); expect(varValue).toBe('form_value_test'); }); it('should return undefined for not existing form variable', () => { - let varValue = service.getVariableValue(fakeForm, 'MYSTERY_FORM_VARIABLE', null); + const varValue = service.getVariableValue(fakeForm, 'MYSTERY_FORM_VARIABLE', null); expect(varValue).toBeUndefined(); }); it('should retrieve the value for the left field when it is a form variable', () => { visibilityObjTest.leftRestResponseId = 'FORM_VARIABLE_TEST'; - let leftValue = service.getLeftValue(fakeForm, visibilityObjTest); + const leftValue = service.getLeftValue(fakeForm, visibilityObjTest); expect(leftValue).not.toBeNull(); expect(leftValue).toBe('form_value_test'); }); it('should determine visibility for dropdown on label condition', () => { - let dropdownValue = service.getFieldValue(formTest.values, 'dropdown_LABEL'); + const dropdownValue = service.getFieldValue(formTest.values, 'dropdown_LABEL'); expect(dropdownValue).not.toBeNull(); expect(dropdownValue).toBeDefined(); @@ -550,7 +550,7 @@ describe('WidgetVisibilityService', () => { }); it('should be able to get the value for a dropdown filtered with Label', () => { - let dropdownValue = service.getFieldValue(formTest.values, 'dropdown_LABEL'); + const dropdownValue = service.getFieldValue(formTest.values, 'dropdown_LABEL'); expect(dropdownValue).not.toBeNull(); expect(dropdownValue).toBeDefined(); @@ -558,7 +558,7 @@ describe('WidgetVisibilityService', () => { }); it('should be able to get the value for a standard field', () => { - let dropdownValue = service.getFieldValue(formTest.values, 'test_2'); + const dropdownValue = service.getFieldValue(formTest.values, 'test_2'); expect(dropdownValue).not.toBeNull(); expect(dropdownValue).toBeDefined(); @@ -566,7 +566,7 @@ describe('WidgetVisibilityService', () => { }); it('should get the dropdown label value from a form', () => { - let dropdownValue = service.getFormValue(formTest, 'dropdown_LABEL'); + const dropdownValue = service.getFormValue(formTest, 'dropdown_LABEL'); expect(dropdownValue).not.toBeNull(); expect(dropdownValue).toBeDefined(); @@ -574,7 +574,7 @@ describe('WidgetVisibilityService', () => { }); it('should get the dropdown id value from a form', () => { - let dropdownValue = service.getFormValue(formTest, 'dropdown'); + const dropdownValue = service.getFormValue(formTest, 'dropdown'); expect(dropdownValue).not.toBeNull(); expect(dropdownValue).toBeDefined(); @@ -583,7 +583,7 @@ describe('WidgetVisibilityService', () => { it('should retrieve the value for the right field when it is a dropdown id', () => { visibilityObjTest.rightFormFieldId = 'dropdown'; - let rightValue = service.getRightValue(formTest, visibilityObjTest); + const rightValue = service.getRightValue(formTest, visibilityObjTest); expect(rightValue).toBeDefined(); expect(rightValue).toBe('dropdown_id'); @@ -591,7 +591,7 @@ describe('WidgetVisibilityService', () => { it('should retrieve the value for the right field when it is a dropdown label', () => { visibilityObjTest.rightFormFieldId = 'dropdown_LABEL'; - let rightValue = service.getRightValue(formTest, visibilityObjTest); + const rightValue = service.getRightValue(formTest, visibilityObjTest); expect(rightValue).toBeDefined(); expect(rightValue).toBe('dropdown_label'); @@ -601,7 +601,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'test_5'; visibilityObjTest.operator = '=='; visibilityObjTest.rightFormFieldId = 'dropdown_LABEL'; - let fakeFormField: FormFieldModel = new FormFieldModel(formTest, jsonFieldFake); + const fakeFormField: FormFieldModel = new FormFieldModel(formTest, jsonFieldFake); service.refreshEntityVisibility(fakeFormField); expect(fakeFormField.isVisible).toBeTruthy(); @@ -611,14 +611,14 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'test_4'; visibilityObjTest.operator = '=='; visibilityObjTest.rightFormFieldId = 'dropdown'; - let fakeFormField: FormFieldModel = new FormFieldModel(formTest, jsonFieldFake); + const fakeFormField: FormFieldModel = new FormFieldModel(formTest, jsonFieldFake); service.refreshEntityVisibility(fakeFormField); expect(fakeFormField.isVisible).toBeTruthy(); }); it('should be able to get value from form values', () => { - let res = service.getFormValue(formTest, 'test_1'); + const res = service.getFormValue(formTest, 'test_1'); expect(res).not.toBeNull(); expect(res).toBeDefined(); @@ -630,9 +630,9 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.operator = '!='; visibilityObjTest.rightFormFieldId = 'RIGHT_FORM_FIELD_ID'; - let container = <ContainerModel> fakeFormWithField.fields[0]; - let column0 = container.field.columns[0]; - let column1 = container.field.columns[1]; + const container = <ContainerModel> fakeFormWithField.fields[0]; + const column0 = container.field.columns[0]; + const column1 = container.field.columns[1]; column0.fields[0].visibilityCondition = visibilityObjTest; service.refreshVisibility(fakeFormWithField); @@ -647,7 +647,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'FIELD_TEST'; visibilityObjTest.operator = '!='; visibilityObjTest.rightFormFieldId = 'RIGHT_FORM_FIELD_ID'; - let tab = new TabModel(fakeFormWithField, { id: 'fake-tab-id', title: 'fake-tab-title', isVisible: true }); + const tab = new TabModel(fakeFormWithField, { id: 'fake-tab-id', title: 'fake-tab-title', isVisible: true }); tab.visibilityCondition = visibilityObjTest; fakeFormWithField.tabs.push(tab); service.refreshVisibility(fakeFormWithField); @@ -659,7 +659,7 @@ describe('WidgetVisibilityService', () => { service.getTaskProcessVariable('9999').subscribe( (res: TaskProcessVariableModel[]) => { expect(res).toBeDefined(); - let varValue = service.getVariableValue(formTest, 'FIELD_FORM_EMPTY', res); + const varValue = service.getVariableValue(formTest, 'FIELD_FORM_EMPTY', res); expect(varValue).not.toBeUndefined(); expect(varValue).toBe('PROCESS_RIGHT_FORM_FIELD_VALUE'); @@ -667,7 +667,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.operator = '=='; visibilityObjTest.rightValue = 'RIGHT_FORM_FIELD_VALUE'; - let myForm = new FormModel({ + const myForm = new FormModel({ id: '9999', name: 'FORM_PROCESS_VARIABLE_VISIBILITY', processDefinitionId: 'PROCESS_TEST:9:9999', @@ -733,7 +733,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.operator = '=='; visibilityObjTest.rightValue = 'PROCESS_RIGHT_FORM_FIELD_VALUE'; - let myForm = new FormModel({ + const myForm = new FormModel({ id: '9999', name: 'FORM_PROCESS_VARIABLE_VISIBILITY', processDefinitionId: 'PROCESS_TEST:9:9999', @@ -799,7 +799,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.operator = '=='; visibilityObjTest.rightValue = 'RIGHT_FORM_FIELD_VALUE'; - let myForm = new FormModel({ + const myForm = new FormModel({ id: '9999', name: 'FORM_PROCESS_VARIABLE_VISIBILITY', processDefinitionId: 'PROCESS_TEST:9:9999', @@ -859,7 +859,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'FIELD_TEST'; visibilityObjTest.operator = '!='; visibilityObjTest.rightFormFieldId = 'RIGHT_FORM_FIELD_ID'; - let tab = new TabModel(fakeFormWithField, { id: 'fake-tab-id', title: 'fake-tab-title', isVisible: true }); + const tab = new TabModel(fakeFormWithField, { id: 'fake-tab-id', title: 'fake-tab-title', isVisible: true }); tab.visibilityCondition = visibilityObjTest; service.refreshEntityVisibility(tab); @@ -870,7 +870,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'FIELD_TEST'; visibilityObjTest.operator = '=='; visibilityObjTest.rightFormFieldId = 'LEFT_FORM_FIELD_ID'; - let contModel = new ContainerModel(new FormFieldModel(fakeFormWithField, { + const contModel = new ContainerModel(new FormFieldModel(fakeFormWithField, { id: 'fake-container-id', type: FormFieldTypes.GROUP, name: 'fake-container-name', @@ -887,7 +887,7 @@ describe('WidgetVisibilityService', () => { visibilityObjTest.leftFormFieldId = 'FIELD_TEST'; visibilityObjTest.operator = '!='; visibilityObjTest.rightFormFieldId = 'RIGHT_FORM_FIELD_ID'; - let contModel = new ContainerModel(new FormFieldModel(fakeFormWithField, { + const contModel = new ContainerModel(new FormFieldModel(fakeFormWithField, { id: 'fake-container-id', type: FormFieldTypes.GROUP, name: 'fake-container-name', diff --git a/lib/core/form/services/widget-visibility.service.ts b/lib/core/form/services/widget-visibility.service.ts index df34689927..3abacaaf14 100644 --- a/lib/core/form/services/widget-visibility.service.ts +++ b/lib/core/form/services/widget-visibility.service.ts @@ -47,12 +47,12 @@ export class WidgetVisibilityService { } refreshEntityVisibility(element: FormFieldModel | TabModel) { - let visible = this.evaluateVisibility(element.form, element.visibilityCondition); + const visible = this.evaluateVisibility(element.form, element.visibilityCondition); element.isVisible = visible; } evaluateVisibility(form: FormModel, visibilityObj: WidgetVisibilityModel): boolean { - let isLeftFieldPresent = visibilityObj && ( visibilityObj.leftFormFieldId || visibilityObj.leftRestResponseId ); + const isLeftFieldPresent = visibilityObj && ( visibilityObj.leftFormFieldId || visibilityObj.leftRestResponseId ); if (!isLeftFieldPresent || isLeftFieldPresent === 'null') { return true; } else { @@ -61,9 +61,9 @@ export class WidgetVisibilityService { } isFieldVisible(form: FormModel, visibilityObj: WidgetVisibilityModel): boolean { - let leftValue = this.getLeftValue(form, visibilityObj); - let rightValue = this.getRightValue(form, visibilityObj); - let actualResult = this.evaluateCondition(leftValue, rightValue, visibilityObj.operator); + const leftValue = this.getLeftValue(form, visibilityObj); + const rightValue = this.getRightValue(form, visibilityObj); + const actualResult = this.evaluateCondition(leftValue, rightValue, visibilityObj.operator); if (visibilityObj.nextCondition) { return this.evaluateLogicalOperation( visibilityObj.nextConditionOperator, @@ -150,7 +150,7 @@ export class WidgetVisibilityService { if (field.value && field.value.name) { value = field.value.name; } else if (field.options) { - let option = field.options.find((opt) => opt.id === field.value); + const option = field.options.find((opt) => opt.id === field.value); if (option) { value = this.getValueFromOption(fieldId, option); } @@ -169,7 +169,7 @@ export class WidgetVisibilityService { } private isSearchedField(field: FormFieldModel, fieldToFind: string): boolean { - let formattedFieldName = this.removeLabel(field, fieldToFind); + const formattedFieldName = this.removeLabel(field, fieldToFind); return field.id ? field.id.toUpperCase() === formattedFieldName.toUpperCase() : false; } @@ -188,14 +188,14 @@ export class WidgetVisibilityService { private getFormVariableValue(form: FormModel, name: string) { if (form.json.variables) { - let formVariable = form.json.variables.find((formVar) => formVar.name === name); + const formVariable = form.json.variables.find((formVar) => formVar.name === name); return formVariable ? formVariable.value : formVariable; } } private getProcessVariableValue(name: string, processVarList: TaskProcessVariableModel[]) { if (this.processVarList) { - let processVariable = this.processVarList.find((variable) => variable.id === name); + const processVariable = this.processVarList.find((variable) => variable.id === name); return processVariable ? processVariable.value : processVariable; } } @@ -249,7 +249,7 @@ export class WidgetVisibilityService { return from(this.apiService.getInstance().activiti.taskFormsApi.getTaskFormVariables(taskId)) .pipe( map((res) => { - let jsonRes = this.toJson(res); + const jsonRes = this.toJson(res); this.processVarList = <TaskProcessVariableModel[]> jsonRes; return jsonRes; }), diff --git a/lib/core/info-drawer/info-drawer.component.spec.ts b/lib/core/info-drawer/info-drawer.component.spec.ts index 26a5cf08e9..0bdf4d1faf 100644 --- a/lib/core/info-drawer/info-drawer.component.spec.ts +++ b/lib/core/info-drawer/info-drawer.component.spec.ts @@ -47,13 +47,13 @@ describe('InfoDrawerComponent', () => { }); it('should define InfoDrawerTabLayout', () => { - let infoDrawerTabLayout = element.querySelector('adf-info-drawer-layout'); + const infoDrawerTabLayout = element.querySelector('adf-info-drawer-layout'); expect(infoDrawerTabLayout).toBeDefined(); }); it('should emit when tab is changed', () => { - let tabEmitSpy = spyOn(component.currentTab, 'emit'); - let event = {index: 1, tab: {textLabel: 'DETAILS'}}; + const tabEmitSpy = spyOn(component.currentTab, 'emit'); + const event = {index: 1, tab: {textLabel: 'DETAILS'}}; component.onTabChange(<MatTabChangeEvent> event); expect(tabEmitSpy).toHaveBeenCalledWith(1); }); @@ -61,7 +61,7 @@ describe('InfoDrawerComponent', () => { it('should render the title', () => { component.title = 'FakeTitle'; fixture.detectChanges(); - let title: any = fixture.debugElement.queryAll(By.css('[info-drawer-title]')); + const title: any = fixture.debugElement.queryAll(By.css('[info-drawer-title]')); expect(title.length).toBe(1); expect(title[0].nativeElement.innerText).toBe('FakeTitle'); }); @@ -106,14 +106,14 @@ describe('Custom InfoDrawer', () => { it('should render the title', () => { fixture.detectChanges(); - let title: any = fixture.debugElement.queryAll(By.css('[info-drawer-title]')); + const title: any = fixture.debugElement.queryAll(By.css('[info-drawer-title]')); expect(title.length).toBe(1); expect(title[0].nativeElement.innerText).toBe('Fake Title Custom'); }); it('should select the tab 1 (index 0) as default', () => { fixture.detectChanges(); - let tab: any = fixture.debugElement.queryAll(By.css('.mat-tab-label-active')); + const tab: any = fixture.debugElement.queryAll(By.css('.mat-tab-label-active')); expect(tab.length).toBe(1); expect(tab[0].nativeElement.innerText).toContain('Tab1'); }); @@ -121,7 +121,7 @@ describe('Custom InfoDrawer', () => { it('should select the tab 2 (index 1)', () => { component.tabIndex = 1; fixture.detectChanges(); - let tab: any = fixture.debugElement.queryAll(By.css('.mat-tab-label-active')); + const tab: any = fixture.debugElement.queryAll(By.css('.mat-tab-label-active')); expect(tab.length).toBe(1); expect(tab[0].nativeElement.innerText).toContain('Tab2'); }); @@ -129,7 +129,7 @@ describe('Custom InfoDrawer', () => { it('should render a tab with icon', () => { component.tabIndex = 2; fixture.detectChanges(); - let tab: any = fixture.debugElement.queryAll(By.css('.mat-tab-label-active')); + const tab: any = fixture.debugElement.queryAll(By.css('.mat-tab-label-active')); expect(tab[0].nativeElement.innerText).not.toBe('Tab3'); expect(tab[0].nativeElement.innerText).toContain('tab-icon'); }); diff --git a/lib/core/login/components/login.component.spec.ts b/lib/core/login/components/login.component.spec.ts index 458e7625a6..160d8dc0a1 100644 --- a/lib/core/login/components/login.component.spec.ts +++ b/lib/core/login/components/login.component.spec.ts @@ -49,8 +49,8 @@ describe('LoginComponent', () => { }; const getLoginErrorMessage = () => { - let errorMessage = undefined; - let errorElement = element.querySelector('#login-error .adf-login-error-message'); + const errorMessage = undefined; + const errorElement = element.querySelector('#login-error .adf-login-error-message'); if (errorElement) { return errorElement.innerText; diff --git a/lib/core/login/components/login.component.ts b/lib/core/login/components/login.component.ts index 9b88b602a0..315ea91888 100644 --- a/lib/core/login/components/login.component.ts +++ b/lib/core/login/components/login.component.ts @@ -150,7 +150,7 @@ export class LoginComponent implements OnInit { ngOnInit() { if (this.authService.isOauth()) { - let oauth: OauthConfigModel = this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null); + const oauth: OauthConfigModel = this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null); if (oauth && oauth.implicitFlow) { this.implicitFlow = true; } @@ -220,15 +220,15 @@ export class LoginComponent implements OnInit { */ onValueChanged(data: any) { this.disableError(); - for (let field in this.formError) { + for (const field in this.formError) { if (field) { this.formError[field] = ''; - let hasError = + const hasError = (this.form.controls[field].errors && data[field] !== '') || (this.form.controls[field].dirty && !this.form.controls[field].valid); if (hasError) { - for (let key in this.form.controls[field].errors) { + for (const key in this.form.controls[field].errors) { if (key) { const message = this._message[field][key]; if (message && message.value) { diff --git a/lib/core/mock/event.mock.ts b/lib/core/mock/event.mock.ts index 97411d1247..28bff694c3 100644 --- a/lib/core/mock/event.mock.ts +++ b/lib/core/mock/event.mock.ts @@ -18,14 +18,14 @@ export class EventMock { static keyDown(key: any) { - let event: any = document.createEvent('Event'); + const event: any = document.createEvent('Event'); event.keyCode = key; event.initEvent('keydown'); document.dispatchEvent(event); } static keyUp(key: any) { - let event: any = document.createEvent('Event'); + const event: any = document.createEvent('Event'); event.keyCode = key; event.initEvent('keyup'); document.dispatchEvent(event); diff --git a/lib/core/pagination/infinite-pagination.component.spec.ts b/lib/core/pagination/infinite-pagination.component.spec.ts index b51b187692..cc8434618b 100644 --- a/lib/core/pagination/infinite-pagination.component.spec.ts +++ b/lib/core/pagination/infinite-pagination.component.spec.ts @@ -36,7 +36,7 @@ class TestPaginatedComponent implements PaginatedComponent { get pagination(): BehaviorSubject<PaginationModel> { if (!this._pagination) { - let defaultPagination = <PaginationModel> { + const defaultPagination = <PaginationModel> { maxItems: 10, skipCount: 0, totalItems: 0, @@ -90,7 +90,7 @@ describe('InfinitePaginationComponent', () => { component.target = null; changeDetectorRef.detectChanges(); - let loadingSpinner = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-spinner"]')); + const loadingSpinner = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-spinner"]')); expect(loadingSpinner).not.toBeNull(); }); @@ -100,7 +100,7 @@ describe('InfinitePaginationComponent', () => { component.isLoading = false; changeDetectorRef.detectChanges(); - let loadingSpinner = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-spinner"]')); + const loadingSpinner = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-spinner"]')); expect(loadingSpinner).toBeNull(); }); @@ -110,7 +110,7 @@ describe('InfinitePaginationComponent', () => { component.isLoading = false; changeDetectorRef.detectChanges(); - let loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); + const loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); expect(loadMoreButton).not.toBeNull(); }); @@ -124,7 +124,7 @@ describe('InfinitePaginationComponent', () => { component.onLoadMore(); fixture.whenStable().then(() => { - let loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); + const loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); expect(loadMoreButton).toBeNull(); done(); }); @@ -138,7 +138,7 @@ describe('InfinitePaginationComponent', () => { changeDetectorRef.detectChanges(); fixture.whenStable().then(() => { - let loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); + const loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); expect(loadMoreButton).not.toBeNull(); done(); }); @@ -149,9 +149,9 @@ describe('InfinitePaginationComponent', () => { component.target.updatePagination(pagination); changeDetectorRef.detectChanges(); - let loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); + const loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); expect(loadMoreButton).toBeNull(); - let loadingSpinner = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-spinner"]')); + const loadingSpinner = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-spinner"]')); expect(loadingSpinner).toBeNull(); }); @@ -169,7 +169,7 @@ describe('InfinitePaginationComponent', () => { done(); }); - let loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); + const loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); loadMoreButton.triggerEventHandler('click', {}); }); @@ -187,7 +187,7 @@ describe('InfinitePaginationComponent', () => { done(); }); - let loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); + const loadMoreButton = fixture.debugElement.query(By.css('[data-automation-id="adf-infinite-pagination-button"]')); loadMoreButton.triggerEventHandler('click', {}); }); }); @@ -245,7 +245,7 @@ describe('InfinitePaginationComponent', () => { fixture.destroy(); const emitNewPaginationEvent = () => { - let newPagination = { maxItems: 1, skipCount: 0, totalItems: 2, hasMoreItems: true }; + const newPagination = { maxItems: 1, skipCount: 0, totalItems: 2, hasMoreItems: true }; component.target.pagination.next(newPagination); }; diff --git a/lib/core/pipes/format-space.pipe.spec.ts b/lib/core/pipes/format-space.pipe.spec.ts index 6972753f84..2f736a89f5 100644 --- a/lib/core/pipes/format-space.pipe.spec.ts +++ b/lib/core/pipes/format-space.pipe.spec.ts @@ -26,40 +26,40 @@ describe('FormatSpacePipe', () => { }); it('should replace the white space with an underscore by default', () => { - let result = pipe.transform('FAKE TEST'); + const result = pipe.transform('FAKE TEST'); expect(result).toBe('fake_test'); }); it('should replace all the white spaces with an underscore by default', () => { - let result = pipe.transform('FAKE TEST CHECK '); + const result = pipe.transform('FAKE TEST CHECK '); expect(result).toBe('fake_test_check'); }); it('should trim the space at the end of the string and replace the ones in the middle', () => { - let result = pipe.transform(' FAKE TEST CHECK '); + const result = pipe.transform(' FAKE TEST CHECK '); expect(result).toBe('fake_test_check'); }); it('should return a lower case string by default', () => { const testString = 'FAKE_TEST_LOWERCASE'; - let result = pipe.transform(testString); + const result = pipe.transform(testString); expect(result).toBe(testString.toLocaleLowerCase()); }); it('should replace the empty space with the character given', () => { const testString = 'FAKE TEST LOWERCASE'; - let result = pipe.transform(testString, '+'); + const result = pipe.transform(testString, '+'); expect(result).toBe('fake+test+lowercase'); }); it('should leave the string uppercase if explicitly set', () => { const testString = 'FAKE TEST LOWERCASE'; - let result = pipe.transform(testString, '-', false); + const result = pipe.transform(testString, '-', false); expect(result).toBe('FAKE-TEST-LOWERCASE'); }); it('should return an empty string when input is null', () => { - let result = pipe.transform(null); + const result = pipe.transform(null); expect(result).toBe(''); }); }); diff --git a/lib/core/pipes/node-name-tooltip.pipe.spec.ts b/lib/core/pipes/node-name-tooltip.pipe.spec.ts index 82f047f17e..32a5aa2f46 100644 --- a/lib/core/pipes/node-name-tooltip.pipe.spec.ts +++ b/lib/core/pipes/node-name-tooltip.pipe.spec.ts @@ -48,7 +48,7 @@ describe('NodeNameTooltipPipe', () => { } } }; - let tooltip = pipe.transform(node); + const tooltip = pipe.transform(node); expect(tooltip).toBe(`${nodeTitle}\n${nodeDescription}`); }); @@ -58,7 +58,7 @@ describe('NodeNameTooltipPipe', () => { name: nodeName } }; - let tooltip = pipe.transform(<NodeEntry> node); + const tooltip = pipe.transform(<NodeEntry> node); expect(tooltip).toBe(nodeName); }); @@ -69,7 +69,7 @@ describe('NodeNameTooltipPipe', () => { properties: {} } }; - let tooltip = pipe.transform(node); + const tooltip = pipe.transform(node); expect(tooltip).toBe(nodeName); }); @@ -83,7 +83,7 @@ describe('NodeNameTooltipPipe', () => { } } }; - let tooltip = pipe.transform(node); + const tooltip = pipe.transform(node); expect(tooltip).toBe(`${nodeName}\n${nodeDescription}`); }); @@ -97,7 +97,7 @@ describe('NodeNameTooltipPipe', () => { } } }; - let tooltip = pipe.transform(node); + const tooltip = pipe.transform(node); expect(tooltip).toBe(`${nodeName}\n${nodeTitle}`); }); @@ -111,7 +111,7 @@ describe('NodeNameTooltipPipe', () => { } } }; - let tooltip = pipe.transform(node); + const tooltip = pipe.transform(node); expect(tooltip).toBe(nodeName); }); @@ -125,7 +125,7 @@ describe('NodeNameTooltipPipe', () => { } } }; - let tooltip = pipe.transform(node); + const tooltip = pipe.transform(node); expect(tooltip).toBe(nodeName); }); @@ -139,7 +139,7 @@ describe('NodeNameTooltipPipe', () => { } } }; - let tooltip = pipe.transform(node); + const tooltip = pipe.transform(node); expect(tooltip).toBe(nodeName); }); }); diff --git a/lib/core/pipes/time-ago.pipe.spec.ts b/lib/core/pipes/time-ago.pipe.spec.ts index 936e68956a..0900f6a204 100644 --- a/lib/core/pipes/time-ago.pipe.spec.ts +++ b/lib/core/pipes/time-ago.pipe.spec.ts @@ -27,12 +27,12 @@ describe('TimeAgoPipe', () => { })); it('should return time difference for a given date', () => { - let date = new Date(); + const date = new Date(); expect(pipe.transform(date)).toBe('a few seconds ago'); }); it('should return exact date if given date is more than seven days ', () => { - let date = new Date('1990-11-03T15:25:42.749'); + const date = new Date('1990-11-03T15:25:42.749'); expect(pipe.transform(date)).toBe('03/11/1990 15:25'); }); @@ -44,7 +44,7 @@ describe('TimeAgoPipe', () => { describe('When a locale is given', () => { it('should return a localised message', async(() => { - let date = new Date(); + const date = new Date(); const transformedDate = pipe.transform(date, 'de'); /* cspell:disable-next-line */ expect(transformedDate).toBe('vor ein paar Sekunden'); diff --git a/lib/core/pipes/user-initial.pipe.spec.ts b/lib/core/pipes/user-initial.pipe.spec.ts index 0f2029ac1a..bccd134b05 100644 --- a/lib/core/pipes/user-initial.pipe.spec.ts +++ b/lib/core/pipes/user-initial.pipe.spec.ts @@ -63,33 +63,33 @@ describe('UserInitialPipe', () => { it('should return a div with the user initials', () => { fakeUser.firstName = 'FAKE-NAME'; fakeUser.lastName = 'FAKE-SURNAME'; - let result = pipe.transform(fakeUser); + const result = pipe.transform(fakeUser); expect(result).toBe('<div id="user-initials-image" class="">FF</div>'); }); it('should apply the style class passed in input', () => { fakeUser.firstName = 'FAKE-NAME'; fakeUser.lastName = 'FAKE-SURNAME'; - let result = pipe.transform(fakeUser, 'fake-class-to-check'); + const result = pipe.transform(fakeUser, 'fake-class-to-check'); expect(result).toBe('<div id="user-initials-image" class="fake-class-to-check">FF</div>'); }); it('should return a single letter into div when lastName is undefined', () => { fakeUser.firstName = 'FAKE-NAME'; fakeUser.lastName = undefined; - let result = pipe.transform(fakeUser); + const result = pipe.transform(fakeUser); expect(result).toBe('<div id="user-initials-image" class="">F</div>'); }); it('should return a single letter into div when firstname is null', () => { fakeUser.firstName = undefined; fakeUser.lastName = 'FAKE-SURNAME'; - let result = pipe.transform(fakeUser); + const result = pipe.transform(fakeUser); expect(result).toBe('<div id="user-initials-image" class="">F</div>'); }); it('should return an empty string when user is null', () => { - let result = pipe.transform(null); + const result = pipe.transform(null); expect(result).toBe(''); }); }); diff --git a/lib/core/pipes/user-initial.pipe.ts b/lib/core/pipes/user-initial.pipe.ts index 0ed9bc3eaf..3fb8c4fc45 100644 --- a/lib/core/pipes/user-initial.pipe.ts +++ b/lib/core/pipes/user-initial.pipe.ts @@ -31,7 +31,7 @@ export class InitialUsernamePipe implements PipeTransform { transform(user: UserProcessModel | EcmUserModel, className: string = '', delimiter: string = ''): SafeHtml { let safeHtml: SafeHtml = ''; if (user) { - let initialResult = this.getInitialUserName(user.firstName, user.lastName, delimiter); + const initialResult = this.getInitialUserName(user.firstName, user.lastName, delimiter); safeHtml = this.sanitized.bypassSecurityTrustHtml(`<div id="user-initials-image" class="${className}">${initialResult}</div>`); } return safeHtml; diff --git a/lib/core/services/alfresco-api.service.ts b/lib/core/services/alfresco-api.service.ts index 46d048c0be..5e0421685f 100644 --- a/lib/core/services/alfresco-api.service.ts +++ b/lib/core/services/alfresco-api.service.ts @@ -111,7 +111,7 @@ export class AlfrescoApiService { } protected initAlfrescoApi() { - let oauth: OauthConfigModel = Object.assign({}, this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null)); + const oauth: OauthConfigModel = Object.assign({}, this.appConfig.get<OauthConfigModel>(AppConfigValues.OAUTHCONFIG, null)); if (oauth) { oauth.redirectUri = window.location.origin + (oauth.redirectUri || '/'); oauth.redirectUriLogout = window.location.origin + (oauth.redirectUriLogout || '/'); diff --git a/lib/core/services/auth-guard-sso-role.service.ts b/lib/core/services/auth-guard-sso-role.service.ts index e1ec3c22cc..b9d0ec78be 100644 --- a/lib/core/services/auth-guard-sso-role.service.ts +++ b/lib/core/services/auth-guard-sso-role.service.ts @@ -29,7 +29,7 @@ export class AuthGuardSsoRoleService implements CanActivate { let hasRole = false; if (route.data) { - let rolesToCheck = route.data['roles']; + const rolesToCheck = route.data['roles']; hasRole = this.hasRoles(rolesToCheck); } diff --git a/lib/core/services/authentication.service.spec.ts b/lib/core/services/authentication.service.spec.ts index 1c3169b323..863c5adb80 100644 --- a/lib/core/services/authentication.service.spec.ts +++ b/lib/core/services/authentication.service.spec.ts @@ -85,7 +85,7 @@ describe('AuthenticationService', () => { }); it('[ECM] should return an ECM ticket after the login done', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { expect(authService.isLoggedIn()).toBe(true); expect(authService.getTicketEcm()).toEqual('fake-post-ticket'); expect(authService.isEcmLoggedIn()).toBe(true); @@ -101,7 +101,7 @@ describe('AuthenticationService', () => { }); it('[ECM] should login in the ECM if no provider are defined calling the login', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { disposableLogin.unsubscribe(); done(); }); @@ -114,8 +114,8 @@ describe('AuthenticationService', () => { }); it('[ECM] should return a ticket undefined after logout', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { - let disposableLogout = authService.logout().subscribe(() => { + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { + const disposableLogout = authService.logout().subscribe(() => { expect(authService.isLoggedIn()).toBe(false); expect(authService.getTicketEcm()).toBe(null); expect(authService.isEcmLoggedIn()).toBe(false); @@ -206,7 +206,7 @@ describe('AuthenticationService', () => { }); it('[BPM] should return an BPM ticket after the login done', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe((response) => { + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe((response) => { expect(authService.isLoggedIn()).toBe(true); // cspell: disable-next expect(authService.getTicketBpm()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk'); @@ -222,8 +222,8 @@ describe('AuthenticationService', () => { }); it('[BPM] should return a ticket undefined after logout', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { - let disposableLogout = authService.logout().subscribe(() => { + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { + const disposableLogout = authService.logout().subscribe(() => { expect(authService.isLoggedIn()).toBe(false); expect(authService.getTicketBpm()).toBe(null); expect(authService.isBpmLoggedIn()).toBe(false); @@ -309,7 +309,7 @@ describe('AuthenticationService', () => { }); it('[ECM] should save the remember me cookie as a session cookie after successful login', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password', false).subscribe(() => { + const disposableLogin = authService.login('fake-username', 'fake-password', false).subscribe(() => { expect(cookie['ALFRESCO_REMEMBER_ME']).not.toBeUndefined(); expect(cookie['ALFRESCO_REMEMBER_ME'].expiration).toBeNull(); disposableLogin.unsubscribe(); @@ -324,7 +324,7 @@ describe('AuthenticationService', () => { }); it('[ECM] should save the remember me cookie as a persistent cookie after successful login', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password', true).subscribe(() => { + const disposableLogin = authService.login('fake-username', 'fake-password', true).subscribe(() => { expect(cookie['ALFRESCO_REMEMBER_ME']).not.toBeUndefined(); expect(cookie['ALFRESCO_REMEMBER_ME'].expiration).not.toBeNull(); disposableLogin.unsubscribe(); @@ -340,7 +340,7 @@ describe('AuthenticationService', () => { }); it('[ECM] should not save the remember me cookie after failed login', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe( + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe( (res) => { }, (err: any) => { @@ -374,7 +374,7 @@ describe('AuthenticationService', () => { }); it('[ALL] should return both ECM and BPM tickets after the login done', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => { expect(authService.isLoggedIn()).toBe(true); expect(authService.getTicketEcm()).toEqual('fake-post-ticket'); // cspell: disable-next @@ -397,7 +397,7 @@ describe('AuthenticationService', () => { }); it('[ALL] should return login fail if only ECM call fail', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe( + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe( (res) => { }, (err: any) => { @@ -420,7 +420,7 @@ describe('AuthenticationService', () => { }); it('[ALL] should return login fail if only BPM call fail', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe( + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe( (res) => { }, (err: any) => { @@ -444,7 +444,7 @@ describe('AuthenticationService', () => { }); it('[ALL] should return ticket undefined when the credentials are wrong', (done) => { - let disposableLogin = authService.login('fake-username', 'fake-password').subscribe( + const disposableLogin = authService.login('fake-username', 'fake-password').subscribe( (res) => { }, (err: any) => { diff --git a/lib/core/services/authentication.service.ts b/lib/core/services/authentication.service.ts index ce2d96caa3..03ae5a885e 100644 --- a/lib/core/services/authentication.service.ts +++ b/lib/core/services/authentication.service.ts @@ -185,7 +185,7 @@ export class AuthenticationService { * @returns The ticket or `null` if none was found */ getTicketEcmBase64(): string | null { - let ticket = this.alfrescoApi.getInstance().getTicketEcm(); + const ticket = this.alfrescoApi.getInstance().getTicketEcm(); if (ticket) { return 'Basic ' + btoa(ticket); } @@ -247,7 +247,7 @@ export class AuthenticationService { * @returns The redirect URL */ getRedirect(): string { - let provider = <string> this.appConfig.get(AppConfigValues.PROVIDERS); + const provider = <string> this.appConfig.get(AppConfigValues.PROVIDERS); return this.hasValidRedirection(provider) ? this.redirectUrl.url : null; } diff --git a/lib/core/services/comment-process.service.spec.ts b/lib/core/services/comment-process.service.spec.ts index 25bb21d8ca..0fe68bc925 100644 --- a/lib/core/services/comment-process.service.spec.ts +++ b/lib/core/services/comment-process.service.spec.ts @@ -69,7 +69,7 @@ describe('Comment ProcessService Service', () => { it('should return the correct comment data', async(() => { service.getProcessInstanceComments(processId).subscribe((comments) => { - let comment: any = comments[0]; + const comment: any = comments[0]; expect(comment.id).toBe(fakeProcessComment.id); expect(comment.created).toBe(fakeProcessComment.created); expect(comment.message).toBe(fakeProcessComment.message); diff --git a/lib/core/services/comment-process.service.ts b/lib/core/services/comment-process.service.ts index 4ea7a8bf3f..7ee6287f6e 100644 --- a/lib/core/services/comment-process.service.ts +++ b/lib/core/services/comment-process.service.ts @@ -62,9 +62,9 @@ export class CommentProcessService { return from(this.apiService.getInstance().activiti.taskApi.getTaskComments(taskId)) .pipe( map((response: any) => { - let comments: CommentModel[] = []; + const comments: CommentModel[] = []; response.data.forEach((comment: CommentModel) => { - let user = new UserProcessModel(comment.createdBy); + const user = new UserProcessModel(comment.createdBy); comments.push(new CommentModel({ id: comment.id, message: comment.message, @@ -87,9 +87,9 @@ export class CommentProcessService { return from(this.apiService.getInstance().activiti.commentsApi.getProcessInstanceComments(processInstanceId)) .pipe( map((response: any) => { - let comments: CommentModel[] = []; + const comments: CommentModel[] = []; response.data.forEach((comment: CommentModel) => { - let user = new UserProcessModel(comment.createdBy); + const user = new UserProcessModel(comment.createdBy); comments.push(new CommentModel({ id: comment.id, message: comment.message, diff --git a/lib/core/services/content.service.spec.ts b/lib/core/services/content.service.spec.ts index a029426b08..526443331c 100644 --- a/lib/core/services/content.service.spec.ts +++ b/lib/core/services/content.service.spec.ts @@ -66,7 +66,7 @@ describe('ContentService', () => { jasmine.Ajax.install(); - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config = { ecmHost: 'http://localhost:9876/ecm', provider: 'ECM' @@ -109,33 +109,33 @@ describe('ContentService', () => { describe('AllowableOperations', () => { it('should hasAllowableOperations be false if allowableOperation is not present in the node', () => { - let permissionNode = new Node({}); + const permissionNode = new Node({}); expect(contentService.hasAllowableOperations(permissionNode, 'create')).toBeFalsy(); }); it('should hasAllowableOperations be true if allowableOperation is present and you have the permission for the request operation', () => { - let permissionNode = new Node({ allowableOperations: ['delete', 'update', 'create', 'updatePermissions'] }); + const permissionNode = new Node({ allowableOperations: ['delete', 'update', 'create', 'updatePermissions'] }); expect(contentService.hasAllowableOperations(permissionNode, 'create')).toBeTruthy(); }); it('should hasAllowableOperations be false if allowableOperation is present but you don\'t have the permission for the request operation', () => { - let permissionNode = new Node({ allowableOperations: ['delete', 'update', 'updatePermissions'] }); + const permissionNode = new Node({ allowableOperations: ['delete', 'update', 'updatePermissions'] }); expect(contentService.hasAllowableOperations(permissionNode, 'create')).toBeFalsy(); }); it('should hasAllowableOperations works in the opposite way with negate value', () => { - let permissionNode = new Node({ allowableOperations: ['delete', 'update', 'updatePermissions'] }); + const permissionNode = new Node({ allowableOperations: ['delete', 'update', 'updatePermissions'] }); expect(contentService.hasAllowableOperations(permissionNode, '!create')).toBeTruthy(); }); it('should hasAllowableOperations return false if no permission parameter are passed', () => { - let permissionNode = new Node({ allowableOperations: ['delete', 'update', 'updatePermissions'] }); + const permissionNode = new Node({ allowableOperations: ['delete', 'update', 'updatePermissions'] }); expect(contentService.hasAllowableOperations(permissionNode, null)).toBeFalsy(); }); it('should havePermission return true if permission parameter is copy', () => { - let permissionNode = null; + const permissionNode = null; expect(contentService.hasAllowableOperations(permissionNode, 'copy')).toBeTruthy(); }); }); @@ -143,38 +143,38 @@ describe('ContentService', () => { describe('Permissions', () => { it('should havePermission be false if allowableOperation is not present in the node', () => { - let permissionNode = new Node({}); + const permissionNode = new Node({}); expect(contentService.hasPermissions(permissionNode, 'manager')).toBeFalsy(); }); it('should havePermission be true if permissions is present and you have the permission for the request operation', () => { - let permissionNode = new Node({ permissions: { locallySet: [{ name: 'manager' }, { name: 'collaborator' }, { name: 'consumer' }] } }); + const permissionNode = new Node({ permissions: { locallySet: [{ name: 'manager' }, { name: 'collaborator' }, { name: 'consumer' }] } }); expect(contentService.hasPermissions(permissionNode, 'manager')).toBeTruthy(); }); it('should havePermission be false if permissions is present but you don\'t have the permission for the request operation', () => { - let permissionNode = new Node({ permissions: { locallySet: [{ name: 'collaborator' }, { name: 'consumer' }] } }); + const permissionNode = new Node({ permissions: { locallySet: [{ name: 'collaborator' }, { name: 'consumer' }] } }); expect(contentService.hasPermissions(permissionNode, 'manager')).toBeFalsy(); }); it('should havePermission works in the opposite way with negate value', () => { - let permissionNode = new Node({ permissions: { locallySet: [{ name: 'collaborator' }, { name: 'consumer' }] } }); + const permissionNode = new Node({ permissions: { locallySet: [{ name: 'collaborator' }, { name: 'consumer' }] } }); expect(contentService.hasPermissions(permissionNode, '!manager')).toBeTruthy(); }); it('should havePermission return false if no permission parameter are passed', () => { - let permissionNode = new Node({ permissions: { locallySet: [{ name: 'collaborator' }, { name: 'consumer' }] } }); + const permissionNode = new Node({ permissions: { locallySet: [{ name: 'collaborator' }, { name: 'consumer' }] } }); expect(contentService.hasPermissions(permissionNode, null)).toBeFalsy(); }); it('should havePermission return true if the permissions is empty and the permission to check is Consumer', () => { - let permissionNode = new Node({ permissions: [] }); + const permissionNode = new Node({ permissions: [] }); expect(contentService.hasPermissions(permissionNode, 'Consumer')).toBeTruthy(); }); it('should havePermission return false if the permissions is empty and the permission to check is not Consumer', () => { - let permissionNode = new Node({ permissions: [] }); + const permissionNode = new Node({ permissions: [] }); expect(contentService.hasPermissions(permissionNode, '!Consumer')).toBeFalsy(); }); }); @@ -183,13 +183,13 @@ describe('ContentService', () => { it('Should use native msSaveOrOpenBlob if the browser is IE', (done) => { - let navigatorAny: any = window.navigator; + const navigatorAny: any = window.navigator; navigatorAny.__defineGetter__('msSaveOrOpenBlob', () => { done(); }); - let blob = new Blob([''], { type: 'text/html' }); + const blob = new Blob([''], { type: 'text/html' }); contentService.downloadBlob(blob, 'test_ie'); }); }); diff --git a/lib/core/services/content.service.ts b/lib/core/services/content.service.ts index 342199b00a..38bec4f3c9 100644 --- a/lib/core/services/content.service.ts +++ b/lib/core/services/content.service.ts @@ -43,7 +43,7 @@ export class ContentService { private logService: LogService, private sanitizer: DomSanitizer) { this.saveData = (function () { - let a = document.createElement('a'); + const a = document.createElement('a'); document.body.appendChild(a); a.style.display = 'none'; @@ -55,7 +55,7 @@ export class ContentService { } if (format === 'object' || format === 'json') { - let json = JSON.stringify(fileData); + const json = JSON.stringify(fileData); blob = new Blob([json], { type: 'octet/stream' }); } @@ -64,7 +64,7 @@ export class ContentService { if (typeof window.navigator !== 'undefined' && window.navigator.msSaveOrOpenBlob) { navigator.msSaveOrOpenBlob(blob, fileName); } else { - let url = window.URL.createObjectURL(blob); + const url = window.URL.createObjectURL(blob); a.href = url; a.download = fileName; a.click(); @@ -110,7 +110,7 @@ export class ContentService { * @returns URL string */ createTrustedUrl(blob: Blob): string { - let url = window.URL.createObjectURL(blob); + const url = window.URL.createObjectURL(blob); return <string> this.sanitizer.bypassSecurityTrustUrl(url); } diff --git a/lib/core/services/discovery-api.service.spec.ts b/lib/core/services/discovery-api.service.spec.ts index cca8e4e34c..d97ae0d6bc 100644 --- a/lib/core/services/discovery-api.service.spec.ts +++ b/lib/core/services/discovery-api.service.spec.ts @@ -24,7 +24,7 @@ import { CoreTestingModule } from '../testing/core.testing.module'; declare let jasmine: any; -let fakeEcmDiscoveryResponse: any = { +const fakeEcmDiscoveryResponse: any = { 'entry': { 'repository': { 'edition': 'FAKE', @@ -79,7 +79,7 @@ let fakeEcmDiscoveryResponse: any = { } }; -let fakeBPMDiscoveryResponse: any = { +const fakeBPMDiscoveryResponse: any = { 'revisionVersion': '2', 'edition': 'SUPER FAKE EDITION', 'type': 'bpmSuite', @@ -96,7 +96,7 @@ describe('Discovery Api Service', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config = { ecmHost: 'http://localhost:9876/ecm' }; diff --git a/lib/core/services/dynamic-component-mapper.service.ts b/lib/core/services/dynamic-component-mapper.service.ts index 7391fdfedf..27914ddc2d 100644 --- a/lib/core/services/dynamic-component-mapper.service.ts +++ b/lib/core/services/dynamic-component-mapper.service.ts @@ -59,7 +59,7 @@ export abstract class DynamicComponentMapper { throw new Error(`resolver is null or not defined`); } - let existing = this.types[type]; + const existing = this.types[type]; if (existing && !override) { throw new Error(`already mapped, use override option if you intend replacing existing mapping.`); } @@ -75,7 +75,7 @@ export abstract class DynamicComponentMapper { */ resolveComponentType(model: DynamicComponentModel, defaultValue: Type<{}> = this.defaultValue): Type<{}> { if (model) { - let resolver = this.getComponentTypeResolver(model.type, defaultValue); + const resolver = this.getComponentTypeResolver(model.type, defaultValue); return resolver(model); } return defaultValue; diff --git a/lib/core/services/external-alfresco-api.service.ts b/lib/core/services/external-alfresco-api.service.ts index 108b4801fa..c6fee9cd2a 100644 --- a/lib/core/services/external-alfresco-api.service.ts +++ b/lib/core/services/external-alfresco-api.service.ts @@ -44,7 +44,7 @@ export class ExternalAlfrescoApiService { init(ecmHost: string, contextRoot: string) { - let domainPrefix = this.createPrefixFromHost(ecmHost); + const domainPrefix = this.createPrefixFromHost(ecmHost); const config = { provider: 'ECM', @@ -65,7 +65,7 @@ export class ExternalAlfrescoApiService { } private createPrefixFromHost(url: string): string { - let match = url.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i); + const match = url.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i); let result = null; if (match != null && match.length > 2 && typeof match[2] === 'string' && match[2].length > 0) { result = match[2]; diff --git a/lib/core/services/jwt-helper.service.ts b/lib/core/services/jwt-helper.service.ts index 6bb3304571..6fe6bece91 100644 --- a/lib/core/services/jwt-helper.service.ts +++ b/lib/core/services/jwt-helper.service.ts @@ -30,13 +30,13 @@ export class JwtHelperService { * @returns Decoded token data object */ decodeToken(token): Object { - let parts = token.split('.'); + const parts = token.split('.'); if (parts.length !== 3) { throw new Error('JWT must have 3 parts'); } - let decoded = this.urlBase64Decode(parts[1]); + const decoded = this.urlBase64Decode(parts[1]); if (!decoded) { throw new Error('Cannot decode the token'); } diff --git a/lib/core/services/log.service.ts b/lib/core/services/log.service.ts index 4fab3c00c8..79238611bd 100644 --- a/lib/core/services/log.service.ts +++ b/lib/core/services/log.service.ts @@ -28,7 +28,7 @@ import { Subject } from 'rxjs'; export class LogService { get currentLogLevel() { - let configLevel: string = this.appConfig.get<string>(AppConfigValues.LOG_LEVEL); + const configLevel: string = this.appConfig.get<string>(AppConfigValues.LOG_LEVEL); if (configLevel) { return this.getLogLevel(configLevel); @@ -168,7 +168,7 @@ export class LogService { * @returns Numeric log level */ getLogLevel(level: string): LogLevelsEnum { - let referencedLevel = logLevels.find((currentLevel: any) => { + const referencedLevel = logLevels.find((currentLevel: any) => { return currentLevel.name.toLocaleLowerCase() === level.toLocaleLowerCase(); }); diff --git a/lib/core/services/login-dialog.service.spec.ts b/lib/core/services/login-dialog.service.spec.ts index 88ed949a52..e111488baf 100644 --- a/lib/core/services/login-dialog.service.spec.ts +++ b/lib/core/services/login-dialog.service.spec.ts @@ -27,7 +27,6 @@ describe('LoginDialogService', () => { let service: LoginDialogService; let materialDialog: MatDialog; let spyOnDialogOpen: jasmine.Spy; - let afterOpenObservable: Subject<any>; setupTestBed({ imports: [CoreModule.forRoot()] @@ -37,7 +36,7 @@ describe('LoginDialogService', () => { service = TestBed.get(LoginDialogService); materialDialog = TestBed.get(MatDialog); spyOnDialogOpen = spyOn(materialDialog, 'open').and.returnValue({ - afterOpen: () => afterOpenObservable, + afterOpen: () => of({}), afterClosed: () => of({}), componentInstance: { error: new Subject<any>() diff --git a/lib/core/services/notification.service.spec.ts b/lib/core/services/notification.service.spec.ts index ef568a8482..7d2eb3f3b3 100644 --- a/lib/core/services/notification.service.spec.ts +++ b/lib/core/services/notification.service.spec.ts @@ -36,32 +36,32 @@ class ProvidesNotificationServiceComponent { } sendMessageWithoutConfig() { - let promise = this.notificationService.openSnackMessage('Test notification', 1000); + const promise = this.notificationService.openSnackMessage('Test notification', 1000); return promise; } sendMessage() { - let promise = this.notificationService.openSnackMessage('Test notification', 1000); + const promise = this.notificationService.openSnackMessage('Test notification', 1000); return promise; } sendCustomMessage() { - let promise = this.notificationService.openSnackMessage('Test notification', new MatSnackBarConfig()); + const promise = this.notificationService.openSnackMessage('Test notification', new MatSnackBarConfig()); return promise; } sendMessageActionWithoutConfig() { - let promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000); + const promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000); return promise; } sendMessageAction() { - let promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000); + const promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', 1000); return promise; } sendCustomMessageAction() { - let promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', new MatSnackBarConfig()); + const promise = this.notificationService.openSnackMessageAction('Test notification', 'TestWarn', new MatSnackBarConfig()); return promise; } @@ -99,7 +99,7 @@ describe('NotificationService', () => { it('should translate messages', (done) => { spyOn(translationService, 'instant').and.callThrough(); - let promise = fixture.componentInstance.sendMessage(); + const promise = fixture.componentInstance.sendMessage(); promise.afterDismissed().subscribe(() => { expect(translationService.instant).toHaveBeenCalled(); done(); @@ -109,7 +109,7 @@ describe('NotificationService', () => { }); it('should open a message notification bar', (done) => { - let promise = fixture.componentInstance.sendMessage(); + const promise = fixture.componentInstance.sendMessage(); promise.afterDismissed().subscribe(() => { done(); }); @@ -120,7 +120,7 @@ describe('NotificationService', () => { }); it('should open a message notification bar without custom configuration', (done) => { - let promise = fixture.componentInstance.sendMessageWithoutConfig(); + const promise = fixture.componentInstance.sendMessageWithoutConfig(); promise.afterDismissed().subscribe(() => { done(); }); @@ -131,7 +131,7 @@ describe('NotificationService', () => { }); it('should open a message notification bar with custom configuration', async((done) => { - let promise = fixture.componentInstance.sendCustomMessage(); + const promise = fixture.componentInstance.sendCustomMessage(); promise.afterDismissed().subscribe(() => { done(); }); @@ -142,7 +142,7 @@ describe('NotificationService', () => { })); it('should open a message notification bar with action', (done) => { - let promise = fixture.componentInstance.sendMessageAction(); + const promise = fixture.componentInstance.sendMessageAction(); promise.afterDismissed().subscribe(() => { done(); }); @@ -153,7 +153,7 @@ describe('NotificationService', () => { }); it('should open a message notification bar with action and custom configuration', async((done) => { - let promise = fixture.componentInstance.sendCustomMessageAction(); + const promise = fixture.componentInstance.sendCustomMessageAction(); promise.afterDismissed().subscribe(() => { done(); }); @@ -164,7 +164,7 @@ describe('NotificationService', () => { })); it('should open a message notification bar with action and no custom configuration', (done) => { - let promise = fixture.componentInstance.sendMessageActionWithoutConfig(); + const promise = fixture.componentInstance.sendMessageActionWithoutConfig(); promise.afterDismissed().subscribe(() => { done(); }); diff --git a/lib/core/services/people-process.service.spec.ts b/lib/core/services/people-process.service.spec.ts index 3c87c78259..a4df9151d2 100644 --- a/lib/core/services/people-process.service.spec.ts +++ b/lib/core/services/people-process.service.spec.ts @@ -96,7 +96,7 @@ describe('PeopleProcessService', () => { }); it('should return user image url', () => { - let url = service.getUserImage(firstInvolvedUser); + const url = service.getUserImage(firstInvolvedUser); expect(url).toContain('/users/' + firstInvolvedUser.id + '/picture'); }); diff --git a/lib/core/services/people-process.service.ts b/lib/core/services/people-process.service.ts index 5bcec3fc3f..e4c4856899 100644 --- a/lib/core/services/people-process.service.ts +++ b/lib/core/services/people-process.service.ts @@ -38,7 +38,7 @@ export class PeopleProcessService { * @returns Array of user information objects */ getWorkflowUsers(taskId?: string, searchWord?: string): Observable<UserProcessModel[]> { - let option = { excludeTaskId: taskId, filter: searchWord }; + const option = { excludeTaskId: taskId, filter: searchWord }; return from(this.getWorkflowUserApi(option)) .pipe( map((response: any) => <UserProcessModel[]> response.data || []), @@ -62,7 +62,7 @@ export class PeopleProcessService { * @returns Empty response when the update completes */ involveUserWithTask(taskId: string, idToInvolve: string): Observable<UserProcessModel[]> { - let node = {userId: idToInvolve}; + const node = {userId: idToInvolve}; return from(this.involveUserToTaskApi(taskId, node)) .pipe( catchError((err) => this.handleError(err)) @@ -76,7 +76,7 @@ export class PeopleProcessService { * @returns Empty response when the update completes */ removeInvolvedUser(taskId: string, idToRemove: string): Observable<UserProcessModel[]> { - let node = {userId: idToRemove}; + const node = {userId: idToRemove}; return from(this.removeInvolvedUserFromTaskApi(taskId, node)) .pipe( catchError((err) => this.handleError(err)) diff --git a/lib/core/services/renditions.service.ts b/lib/core/services/renditions.service.ts index e30a1a696b..3c67919054 100644 --- a/lib/core/services/renditions.service.ts +++ b/lib/core/services/renditions.service.ts @@ -37,9 +37,9 @@ export class RenditionsService { getAvailableRenditionForNode(nodeId: string): Observable<RenditionEntry> { return from(this.apiService.renditionsApi.getRenditions(nodeId)).pipe( map((availableRenditions: RenditionPaging) => { - let renditionsAvailable: RenditionEntry[] = availableRenditions.list.entries.filter( + const renditionsAvailable: RenditionEntry[] = availableRenditions.list.entries.filter( (rendition) => (rendition.entry.id === 'pdf' || rendition.entry.id === 'imgpreview')); - let existingRendition = renditionsAvailable.find((rend) => rend.entry.status === 'CREATED'); + const existingRendition = renditionsAvailable.find((rend) => rend.entry.status === 'CREATED'); return existingRendition ? existingRendition : renditionsAvailable[0]; })); } diff --git a/lib/core/services/search-configuration.service.ts b/lib/core/services/search-configuration.service.ts index 31f708a32a..114743d31c 100644 --- a/lib/core/services/search-configuration.service.ts +++ b/lib/core/services/search-configuration.service.ts @@ -35,7 +35,7 @@ export class SearchConfigurationService implements SearchConfigurationInterface * @returns Query body defined by the parameters */ public generateQueryBody(searchTerm: string, maxResults: number, skipCount: number): QueryBody { - let defaultQueryBody: QueryBody = { + const defaultQueryBody: QueryBody = { query: { query: searchTerm ? `'${searchTerm}*' OR name:'${searchTerm}*'` : searchTerm }, diff --git a/lib/core/services/search.service.spec.ts b/lib/core/services/search.service.spec.ts index 8f9a129995..17351e67e2 100644 --- a/lib/core/services/search.service.spec.ts +++ b/lib/core/services/search.service.spec.ts @@ -50,7 +50,7 @@ describe('SearchService', () => { }); it('should call search API with no additional options', (done) => { - let searchTerm = 'searchTerm63688'; + const searchTerm = 'searchTerm63688'; spyOn(searchMockApi.core.queriesApi, 'findNodes').and.returnValue(Promise.resolve(fakeSearch)); service.getNodeQueryResults(searchTerm).subscribe( () => { @@ -61,7 +61,7 @@ describe('SearchService', () => { }); it('should call search API with additional options', (done) => { - let searchTerm = 'searchTerm63688', options = { + const searchTerm = 'searchTerm63688', options = { include: [ 'path' ], rootNodeId: '-root-', nodeType: 'cm:content' diff --git a/lib/core/services/sites.service.spec.ts b/lib/core/services/sites.service.spec.ts index 4d8657719d..61c4ce2cf6 100644 --- a/lib/core/services/sites.service.spec.ts +++ b/lib/core/services/sites.service.spec.ts @@ -32,7 +32,7 @@ describe('Sites service', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config = { ecmHost: 'http://localhost:9876/ecm', files: { diff --git a/lib/core/services/sites.service.ts b/lib/core/services/sites.service.ts index 72a6a5d7b1..cf380ec9f4 100644 --- a/lib/core/services/sites.service.ts +++ b/lib/core/services/sites.service.ts @@ -67,7 +67,7 @@ export class SitesService { * @returns Null response notifying when the operation is complete */ deleteSite(siteId: string, permanentFlag: boolean = true): Observable<any> { - let options: any = {}; + const options: any = {}; options.permanent = permanentFlag; return from(this.apiService.getInstance().core.sitesApi.deleteSite(siteId, options)) .pipe( diff --git a/lib/core/services/storage.service.ts b/lib/core/services/storage.service.ts index fb5b40b637..35ace886f8 100644 --- a/lib/core/services/storage.service.ts +++ b/lib/core/services/storage.service.ts @@ -91,7 +91,7 @@ export class StorageService { private storageAvailable(type: string): boolean { try { - let storage = window[type]; + const storage = window[type]; const key = '__storage_test__'; storage.setItem(key, key); storage.removeItem(key, key); diff --git a/lib/core/services/thumbnail.service.ts b/lib/core/services/thumbnail.service.ts index 7a80e60c47..e211e1e163 100644 --- a/lib/core/services/thumbnail.service.ts +++ b/lib/core/services/thumbnail.service.ts @@ -170,7 +170,7 @@ export class ThumbnailService { * @returns URL string */ public getDocumentThumbnailUrl(node: any): string { - let thumbnail = this.contentService.getDocumentThumbnailUrl(node); + const thumbnail = this.contentService.getDocumentThumbnailUrl(node); return thumbnail || this.DEFAULT_ICON; } @@ -180,7 +180,7 @@ export class ThumbnailService { * @returns URL string */ public getMimeTypeIcon(mimeType: string): string { - let icon = this.mimeTypeIcons[mimeType]; + const icon = this.mimeTypeIcons[mimeType]; return (icon || this.DEFAULT_ICON); } diff --git a/lib/core/services/translate-loader.service.ts b/lib/core/services/translate-loader.service.ts index 3f68292069..4883ac89c1 100644 --- a/lib/core/services/translate-loader.service.ts +++ b/lib/core/services/translate-loader.service.ts @@ -43,7 +43,7 @@ export class TranslateLoaderService implements TranslateLoader { } registerProvider(name: string, path: string) { - let registered = this.providers.find((provider) => provider.name === name); + const registered = this.providers.find((provider) => provider.name === name); if (registered) { registered.path = path; } else { @@ -148,7 +148,7 @@ export class TranslateLoaderService implements TranslateLoader { if (batch.length > 0) { forkJoin(batch).subscribe( () => { - let fullTranslation = this.getFullTranslationJSON(lang); + const fullTranslation = this.getFullTranslationJSON(lang); if (fullTranslation) { observer.next(fullTranslation); } @@ -162,7 +162,7 @@ export class TranslateLoaderService implements TranslateLoader { observer.error('Failed to load some resources'); }); } else { - let fullTranslation = this.getFullTranslationJSON(lang); + const fullTranslation = this.getFullTranslationJSON(lang); if (fullTranslation) { observer.next(fullTranslation); observer.complete(); diff --git a/lib/core/services/translate-loader.spec.ts b/lib/core/services/translate-loader.spec.ts index 0320372215..f8208ea17c 100644 --- a/lib/core/services/translate-loader.spec.ts +++ b/lib/core/services/translate-loader.spec.ts @@ -21,7 +21,7 @@ import { TranslationService } from './translation.service'; import { setupTestBed } from '../testing/setupTestBed'; import { CoreModule } from '../core.module'; -let componentJson1 = ' {"TEST": "This is a test", "TEST2": "This is another test"} ' ; +const componentJson1 = ' {"TEST": "This is a test", "TEST2": "This is another test"} ' ; declare let jasmine: any; diff --git a/lib/core/services/translation.service.ts b/lib/core/services/translation.service.ts index 4c1d990b0a..44b33217db 100644 --- a/lib/core/services/translation.service.ts +++ b/lib/core/services/translation.service.ts @@ -46,7 +46,7 @@ export class TranslationService { this.customLoader.setDefaultLang(this.defaultLang); if (providers && providers.length > 0) { - for (let provider of providers) { + for (const provider of providers) { this.addTranslationFolder(provider.name, provider.source); } } diff --git a/lib/core/services/upload.service.spec.ts b/lib/core/services/upload.service.spec.ts index f6effee761..5e4ecaadf5 100644 --- a/lib/core/services/upload.service.spec.ts +++ b/lib/core/services/upload.service.spec.ts @@ -38,7 +38,7 @@ describe('UploadService', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config = { ecmHost: 'http://localhost:9876/ecm', files: { @@ -66,13 +66,13 @@ describe('UploadService', () => { }); it('should add an element in the queue and returns it', () => { - let filesFake = new FileModel(<File> { name: 'fake-name', size: 10 }); + const filesFake = new FileModel(<File> { name: 'fake-name', size: 10 }); service.addToQueue(filesFake); expect(service.getQueue().length).toEqual(1); }); it('should add two elements in the queue and returns them', () => { - let filesFake = [ + const filesFake = [ new FileModel(<File> { name: 'fake-name', size: 10 }), new FileModel(<File> { name: 'fake-name2', size: 20 }) ]; @@ -97,21 +97,21 @@ describe('UploadService', () => { }); it('should make XHR done request after the file is added in the queue', (done) => { - let emitter = new EventEmitter(); + const emitter = new EventEmitter(); - let emitterDisposable = emitter.subscribe((e) => { + const emitterDisposable = emitter.subscribe((e) => { expect(e.value).toBe('File uploaded'); emitterDisposable.unsubscribe(); done(); }); - let fileFake = new FileModel( + const fileFake = new FileModel( <File> { name: 'fake-name', size: 10 }, <FileUploadOptions> { parentId: '-root-', path: 'fake-dir' } ); service.addToQueue(fileFake); service.uploadFilesInTheQueue(emitter); - let request = jasmine.Ajax.requests.mostRecent(); + const request = jasmine.Ajax.requests.mostRecent(); expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/-root-/children?autoRename=true&include=allowableOperations'); expect(request.method).toBe('POST'); @@ -123,14 +123,14 @@ describe('UploadService', () => { }); it('should make XHR error request after an error occur', (done) => { - let emitter = new EventEmitter(); + const emitter = new EventEmitter(); - let emitterDisposable = emitter.subscribe((e) => { + const emitterDisposable = emitter.subscribe((e) => { expect(e.value).toBe('Error file uploaded'); emitterDisposable.unsubscribe(); done(); }); - let fileFake = new FileModel( + const fileFake = new FileModel( <File> { name: 'fake-name', size: 10 }, <FileUploadOptions> { parentId: '-root-' } ); @@ -147,26 +147,26 @@ describe('UploadService', () => { }); it('should make XHR abort request after the xhr abort is called', (done) => { - let emitter = new EventEmitter(); + const emitter = new EventEmitter(); - let emitterDisposable = emitter.subscribe((e) => { + const emitterDisposable = emitter.subscribe((e) => { expect(e.value).toEqual('File aborted'); emitterDisposable.unsubscribe(); done(); }); - let fileFake = new FileModel(<File> { name: 'fake-name', size: 10 }); + const fileFake = new FileModel(<File> { name: 'fake-name', size: 10 }); service.addToQueue(fileFake); service.uploadFilesInTheQueue(emitter); - let file = service.getQueue(); + const file = service.getQueue(); service.cancelUpload(...file); }); it('If newVersion is set, name should be a param', () => { - let uploadFileSpy = spyOn(alfrescoApiService.getInstance().upload, 'uploadFile').and.callThrough(); + const uploadFileSpy = spyOn(alfrescoApiService.getInstance().upload, 'uploadFile').and.callThrough(); - let emitter = new EventEmitter(); + const emitter = new EventEmitter(); const filesFake = new FileModel(<File> { name: 'fake-name', size: 10 }, { newVersion: true @@ -188,21 +188,21 @@ describe('UploadService', () => { }); it('should use custom root folder ID given to the service', (done) => { - let emitter = new EventEmitter(); + const emitter = new EventEmitter(); - let emitterDisposable = emitter.subscribe((e) => { + const emitterDisposable = emitter.subscribe((e) => { expect(e.value).toBe('File uploaded'); emitterDisposable.unsubscribe(); done(); }); - let filesFake = new FileModel( + const filesFake = new FileModel( <File> { name: 'fake-name', size: 10 }, <FileUploadOptions> { parentId: '123', path: 'fake-dir' } ); service.addToQueue(filesFake); service.uploadFilesInTheQueue(emitter); - let request = jasmine.Ajax.requests.mostRecent(); + const request = jasmine.Ajax.requests.mostRecent(); expect(request.url).toBe('http://localhost:9876/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/123/children?autoRename=true&include=allowableOperations'); expect(request.method).toBe('POST'); @@ -214,10 +214,10 @@ describe('UploadService', () => { }); it('should append to the request the extra upload options', () => { - let uploadFileSpy = spyOn(alfrescoApiService.getInstance().upload, 'uploadFile').and.callThrough(); - let emitter = new EventEmitter(); + const uploadFileSpy = spyOn(alfrescoApiService.getInstance().upload, 'uploadFile').and.callThrough(); + const emitter = new EventEmitter(); - let filesFake = new FileModel( + const filesFake = new FileModel( <File> { name: 'fake-name', size: 10 }, <FileUploadOptions> { parentId: '123', path: 'fake-dir', @@ -246,7 +246,7 @@ describe('UploadService', () => { }); it('should start downloading the next one if a file of the list is aborted', (done) => { - let emitter = new EventEmitter(); + const emitter = new EventEmitter(); service.fileUploadAborted.subscribe((e) => { expect(e).not.toBeNull(); @@ -257,13 +257,13 @@ describe('UploadService', () => { done(); }); - let fileFake1 = new FileModel(<File> { name: 'fake-name1', size: 10 }); - let fileFake2 = new FileModel(<File> { name: 'fake-name2', size: 10 }); - let fileList = [fileFake1, fileFake2]; + const fileFake1 = new FileModel(<File> { name: 'fake-name1', size: 10 }); + const fileFake2 = new FileModel(<File> { name: 'fake-name2', size: 10 }); + const fileList = [fileFake1, fileFake2]; service.addToQueue(...fileList); service.uploadFilesInTheQueue(emitter); - let file = service.getQueue(); + const file = service.getQueue(); service.cancelUpload(...file); }); diff --git a/lib/core/services/upload.service.ts b/lib/core/services/upload.service.ts index 575ce31ebc..dbe4333c44 100644 --- a/lib/core/services/upload.service.ts +++ b/lib/core/services/upload.service.ts @@ -94,7 +94,7 @@ export class UploadService { this.matchingOptions = this.appConfigService.get('files.match-options'); isAllowed = this.excludedFileList.filter((pattern) => { - let minimatch = new Minimatch(pattern, this.matchingOptions); + const minimatch = new Minimatch(pattern, this.matchingOptions); return minimatch.match(file.name); }).length === 0; } @@ -107,7 +107,7 @@ export class UploadService { */ uploadFilesInTheQueue(emitter?: EventEmitter<any>): void { if (!this.activeTask) { - let file = this.queue.find((currentFile) => currentFile.status === FileUploadStatus.Pending); + const file = this.queue.find((currentFile) => currentFile.status === FileUploadStatus.Pending); if (file) { this.onUploadStarting(file); @@ -115,7 +115,7 @@ export class UploadService { this.activeTask = promise; this.cache[file.id] = promise; - let next = () => { + const next = () => { this.activeTask = null; setTimeout(() => this.uploadFilesInTheQueue(emitter), 100); }; @@ -162,7 +162,7 @@ export class UploadService { * @returns Promise that is resolved if the upload is successful or error otherwise */ getUploadPromise(file: FileModel): any { - let opts: any = { + const opts: any = { renditions: 'doclib', include: ['allowableOperations'] }; @@ -199,7 +199,7 @@ export class UploadService { private beginUpload(file: FileModel, emitter: EventEmitter<any>): any { - let promise = this.getUploadPromise(file); + const promise = this.getUploadPromise(file); promise.on('progress', (progress: FileUploadProgress) => { this.onUploadProgress(file, progress); diff --git a/lib/core/services/user-preferences.service.ts b/lib/core/services/user-preferences.service.ts index 3602e8ae43..a3f178aa39 100644 --- a/lib/core/services/user-preferences.service.ts +++ b/lib/core/services/user-preferences.service.ts @@ -167,7 +167,7 @@ export class UserPreferencesService { * @returns Array of page size values */ get supportedPageSizes(): number[] { - let supportedPageSizes = this.get(UserPreferenceValues.SupportedPageSizes); + const supportedPageSizes = this.get(UserPreferenceValues.SupportedPageSizes); if (supportedPageSizes) { return JSON.parse(supportedPageSizes); @@ -186,7 +186,7 @@ export class UserPreferencesService { } get paginationSize(): number { - let paginationSize = this.get(UserPreferenceValues.PaginationSize); + const paginationSize = this.get(UserPreferenceValues.PaginationSize); if (paginationSize) { return Number(paginationSize); diff --git a/lib/core/settings/host-settings.component.ts b/lib/core/settings/host-settings.component.ts index ad10c69618..9b9d357b1b 100644 --- a/lib/core/settings/host-settings.component.ts +++ b/lib/core/settings/host-settings.component.ts @@ -69,7 +69,7 @@ export class HostSettingsComponent implements OnInit { this.showSelectProviders = false; } - let providerSelected = this.appConfig.get<string>(AppConfigValues.PROVIDERS); + const providerSelected = this.appConfig.get<string>(AppConfigValues.PROVIDERS); const authType = this.appConfig.get<string>(AppConfigValues.AUTHTYPE, 'BASIC'); @@ -136,7 +136,7 @@ export class HostSettingsComponent implements OnInit { } private createOAuthFormGroup(): AbstractControl { - let oauth = <OauthConfigModel> this.appConfig.get(AppConfigValues.OAUTHCONFIG, {}); + const oauth = <OauthConfigModel> this.appConfig.get(AppConfigValues.OAUTHCONFIG, {}); return this.formBuilder.group({ host: [oauth.host, [Validators.required, Validators.pattern(this.HOST_REGEX)]], diff --git a/lib/core/userinfo/components/user-info.component.spec.ts b/lib/core/userinfo/components/user-info.component.spec.ts index efbba1a055..cb57d9e206 100644 --- a/lib/core/userinfo/components/user-info.component.spec.ts +++ b/lib/core/userinfo/components/user-info.component.spec.ts @@ -74,13 +74,13 @@ describe('User info component', () => { let bpmUserService: BpmUserService; let identityUserService: IdentityUserService; - let identityUserMock = { firstName: 'fake-identity-first-name', lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' }; - let identityUserWithOutFirstNameMock = { firstName: null, lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' }; - let identityUserWithOutLastNameMock = { firstName: 'fake-identity-first-name', lastName: null, email: 'fakeIdentity@email.com' }; + const identityUserMock = { firstName: 'fake-identity-first-name', lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' }; + const identityUserWithOutFirstNameMock = { firstName: null, lastName: 'fake-identity-last-name', email: 'fakeIdentity@email.com' }; + const identityUserWithOutLastNameMock = { firstName: 'fake-identity-first-name', lastName: null, email: 'fakeIdentity@email.com' }; function openUserInfo() { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); imageButton.click(); fixture.detectChanges(); } @@ -146,11 +146,11 @@ describe('User info component', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); imageButton.click(); fixture.detectChanges(); expect(element.querySelector('#userinfo_container')).toBeDefined(); - let ecmUsername = fixture.debugElement.query(By.css('#ecm-username')); + const ecmUsername = fixture.debugElement.query(By.css('#ecm-username')); expect(ecmUsername).toBeDefined(); expect(ecmUsername).not.toBeNull(); expect(ecmUsername.nativeElement.textContent).not.toContain('fake-ecm-first-name'); @@ -210,10 +210,10 @@ describe('User info component', () => { it('should get the ecm current user image from the service', async(() => { fixture.whenStable().then(() => { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); imageButton.click(); fixture.detectChanges(); - let loggedImage = fixture.debugElement.query(By.css('#logged-user-img')); + const loggedImage = fixture.debugElement.query(By.css('#logged-user-img')); expect(element.querySelector('#userinfo_container')).not.toBeNull(); expect(loggedImage).not.toBeNull(); @@ -225,10 +225,10 @@ describe('User info component', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); imageButton.click(); fixture.detectChanges(); - let loggedImage = fixture.debugElement.query(By.css('#logged-user-img')); + const loggedImage = fixture.debugElement.query(By.css('#logged-user-img')); component.ecmUser$.subscribe((response: EcmUserModel) => { expect(response).toBeDefined(); expect(response.avatarId).toBe('fake-avatar-id'); @@ -243,12 +243,12 @@ describe('User info component', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); imageButton.click(); fixture.detectChanges(); - let ecmImage = fixture.debugElement.query(By.css('#ecm-user-detail-image')); - let ecmFullName = fixture.debugElement.query(By.css('#ecm-full-name')); - let ecmJobTitle = fixture.debugElement.query(By.css('#ecm-job-title-label')); + const ecmImage = fixture.debugElement.query(By.css('#ecm-user-detail-image')); + const ecmFullName = fixture.debugElement.query(By.css('#ecm-full-name')); + const ecmJobTitle = fixture.debugElement.query(By.css('#ecm-job-title-label')); expect(element.querySelector('#userinfo_container')).not.toBeNull(); expect(fixture.debugElement.query(By.css('#ecm-username'))).not.toBeNull(); @@ -272,28 +272,28 @@ describe('User info component', () => { })); it('should show N/A when the job title is null', async(() => { - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#user-initials-image'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#user-initials-image'); imageButton.click(); fixture.detectChanges(); expect(element.querySelector('#userinfo_container')).not.toBeNull(); - let ecmJobTitle = fixture.debugElement.query(By.css('#ecm-job-title')); + const ecmJobTitle = fixture.debugElement.query(By.css('#ecm-job-title')); expect(ecmJobTitle).not.toBeNull(); expect(ecmJobTitle).not.toBeNull(); expect(ecmJobTitle.nativeElement.textContent).toContain('N/A'); })); it('should not show the tabs', () => { - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#user-initials-image'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#user-initials-image'); imageButton.click(); fixture.detectChanges(); - let tabHeader = fixture.debugElement.query(By.css('#tab-group-env')); + const tabHeader = fixture.debugElement.query(By.css('#tab-group-env')); expect(tabHeader.classes['adf-hide-tab']).toBeTruthy(); }); it('should display the current user Initials if the user dose not have avatarId', async(() => { fixture.whenStable().then(() => { fixture.detectChanges(); - let pipe = new InitialUsernamePipe(new FakeSanitizer()); + const pipe = new InitialUsernamePipe(new FakeSanitizer()); component.ecmUser$.subscribe((response: EcmUserModel) => { expect(response).toBeDefined(); expect(response.avatarId).toBeNull(); @@ -339,10 +339,10 @@ describe('User info component', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); imageButton.click(); fixture.detectChanges(); - let bpmUserName = fixture.debugElement.query(By.css('#bpm-username')); + const bpmUserName = fixture.debugElement.query(By.css('#bpm-username')); expect(element.querySelector('#userinfo_container')).not.toBeNull(); expect(bpmUserName).toBeDefined(); expect(bpmUserName).not.toBeNull(); @@ -364,7 +364,7 @@ describe('User info component', () => { it('should show last name if first name is null', async(() => { fixture.detectChanges(); - let wrongBpmUser: BpmUserModel = new BpmUserModel({ + const wrongBpmUser: BpmUserModel = new BpmUserModel({ firstName: null, lastName: 'fake-last-name' }); @@ -382,7 +382,7 @@ describe('User info component', () => { })); it('should not show first name if it is null string', async(() => { - let wrongFirstNameBpmUser: BpmUserModel = new BpmUserModel({ + const wrongFirstNameBpmUser: BpmUserModel = new BpmUserModel({ firstName: 'null', lastName: 'fake-last-name' }); @@ -399,7 +399,7 @@ describe('User info component', () => { })); it('should not show last name if it is null string', async(() => { - let wrongLastNameBpmUser: BpmUserModel = new BpmUserModel({ + const wrongLastNameBpmUser: BpmUserModel = new BpmUserModel({ firstName: 'fake-first-name', lastName: 'null' }); @@ -417,7 +417,7 @@ describe('User info component', () => { it('should not show the tabs', async(() => { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#logged-user-img'); imageButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -470,12 +470,12 @@ describe('User info component', () => { it('should get the bpm user informations from the service', async(() => { openUserInfo(); - let bpmTab = fixture.debugElement.queryAll(By.css('#tab-group-env .mat-tab-labels .mat-tab-label'))[1]; + const bpmTab = fixture.debugElement.queryAll(By.css('#tab-group-env .mat-tab-labels .mat-tab-label'))[1]; bpmTab.triggerEventHandler('click', null); fixture.detectChanges(); fixture.whenStable().then(() => { - let bpmUsername = fixture.debugElement.query(By.css('#bpm-username')); - let bpmImage = fixture.debugElement.query(By.css('#bpm-user-detail-image')); + const bpmUsername = fixture.debugElement.query(By.css('#bpm-username')); + const bpmImage = fixture.debugElement.query(By.css('#bpm-user-detail-image')); expect(element.querySelector('#userinfo_container')).not.toBeNull(); expect(bpmUsername).not.toBeNull(); expect(bpmImage).not.toBeNull(); @@ -487,8 +487,8 @@ describe('User info component', () => { it('should get the ecm user informations from the service', async(() => { openUserInfo(); - let ecmUsername = fixture.debugElement.query(By.css('#ecm-username')); - let ecmImage = fixture.debugElement.query(By.css('#ecm-user-detail-image')); + const ecmUsername = fixture.debugElement.query(By.css('#ecm-username')); + const ecmImage = fixture.debugElement.query(By.css('#ecm-user-detail-image')); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -521,8 +521,8 @@ describe('User info component', () => { it('should show the tabs for the env', () => { openUserInfo(); - let tabGroup = fixture.debugElement.query(By.css('#tab-group-env')); - let tabs = fixture.debugElement.queryAll(By.css('#tab-group-env .mat-tab-labels .mat-tab-label')); + const tabGroup = fixture.debugElement.query(By.css('#tab-group-env')); + const tabs = fixture.debugElement.queryAll(By.css('#tab-group-env .mat-tab-labels .mat-tab-label')); expect(tabGroup).not.toBeNull(); expect(tabGroup.classes['adf-hide-tab']).toBeFalsy(); @@ -531,8 +531,8 @@ describe('User info component', () => { it('should not close the menu when a tab is clicked', () => { openUserInfo(); - let tabGroup = fixture.debugElement.query(By.css('#tab-group-env')); - let tabs = fixture.debugElement.queryAll(By.css('#tab-group-env .mat-tab-labels .mat-tab-label')); + const tabGroup = fixture.debugElement.query(By.css('#tab-group-env')); + const tabs = fixture.debugElement.queryAll(By.css('#tab-group-env .mat-tab-labels .mat-tab-label')); expect(tabGroup).not.toBeNull(); tabs[1].triggerEventHandler('click', null); @@ -568,10 +568,10 @@ describe('User info component', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#identity-user-image'); + const imageButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#identity-user-image'); imageButton.click(); fixture.detectChanges(); - let bpmUserName = element.querySelector('#identity-username'); + const bpmUserName = element.querySelector('#identity-username'); fixture.detectChanges(); expect(element.querySelector('#userinfo_container')).not.toBeNull(); expect(bpmUserName).toBeDefined(); @@ -582,7 +582,7 @@ describe('User info component', () => { it('should show last name if first name is null', async(() => { fixture.detectChanges(); - let fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutFirstNameMock); + const fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutFirstNameMock); getCurrentUserInfoStub.and.returnValue(fakeIdentityUser); fixture.detectChanges(); @@ -597,7 +597,7 @@ describe('User info component', () => { })); it('should not show first name if it is null string', async(() => { - let fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutFirstNameMock); + const fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutFirstNameMock); getCurrentUserInfoStub.and.returnValue(of(fakeIdentityUser)); fixture.detectChanges(); @@ -612,7 +612,7 @@ describe('User info component', () => { })); it('should not show last name if it is null string', async(() => { - let fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutLastNameMock); + const fakeIdentityUser: IdentityUserModel = new IdentityUserModel(identityUserWithOutLastNameMock); getCurrentUserInfoStub.and.returnValue(of(fakeIdentityUser)); fixture.detectChanges(); diff --git a/lib/core/userinfo/services/bpm-user.service.spec.ts b/lib/core/userinfo/services/bpm-user.service.spec.ts index 76629b6ebd..9a3c6c8cef 100644 --- a/lib/core/userinfo/services/bpm-user.service.spec.ts +++ b/lib/core/userinfo/services/bpm-user.service.spec.ts @@ -74,7 +74,7 @@ describe('Bpm user service', () => { }); it('should retrieve avatar url for current user', () => { - let path = service.getCurrentUserProfileImage(); + const path = service.getCurrentUserProfileImage(); expect(path).toBeDefined(); expect(path).toContain('/app/rest/admin/profile-picture'); }); diff --git a/lib/core/userinfo/services/ecm-user.service.spec.ts b/lib/core/userinfo/services/ecm-user.service.spec.ts index 76a7d85e0d..41160ecdc1 100644 --- a/lib/core/userinfo/services/ecm-user.service.spec.ts +++ b/lib/core/userinfo/services/ecm-user.service.spec.ts @@ -89,14 +89,14 @@ describe('EcmUserService', () => { it('should retrieve avatar url for current user', () => { spyOn(contentService, 'getContentUrl').and.returnValue('fake/url/image/for/ecm/user'); - let urlRs = service.getUserProfileImage('fake-avatar-id'); + const urlRs = service.getUserProfileImage('fake-avatar-id'); expect(urlRs).toEqual('fake/url/image/for/ecm/user'); }); it('should not call content service without avatar id', () => { spyOn(contentService, 'getContentUrl').and.callThrough(); - let urlRs = service.getUserProfileImage(undefined); + const urlRs = service.getUserProfileImage(undefined); expect(urlRs).toBeUndefined(); expect(contentService.getContentUrl).not.toHaveBeenCalled(); @@ -104,7 +104,7 @@ describe('EcmUserService', () => { it('should build the body for the content service', () => { spyOn(contentService, 'getContentUrl').and.callThrough(); - let urlRs = service.getUserProfileImage('fake-avatar-id'); + const urlRs = service.getUserProfileImage('fake-avatar-id'); expect(urlRs).toBeDefined(); expect(contentService.getContentUrl).toHaveBeenCalledWith({entry: {id: 'fake-avatar-id'}}); diff --git a/lib/core/userinfo/services/ecm-user.service.ts b/lib/core/userinfo/services/ecm-user.service.ts index bde9af5531..f51f1b0c3f 100644 --- a/lib/core/userinfo/services/ecm-user.service.ts +++ b/lib/core/userinfo/services/ecm-user.service.ts @@ -64,7 +64,7 @@ export class EcmUserService { */ getUserProfileImage(avatarId: string) { if (avatarId) { - let nodeObj = {entry: {id: avatarId}}; + const nodeObj = {entry: {id: avatarId}}; return this.contentService.getContentUrl(nodeObj); } } diff --git a/lib/core/userinfo/services/identity-user.service.spec.ts b/lib/core/userinfo/services/identity-user.service.spec.ts index 4c21a44230..545ac498b2 100644 --- a/lib/core/userinfo/services/identity-user.service.spec.ts +++ b/lib/core/userinfo/services/identity-user.service.spec.ts @@ -54,7 +54,7 @@ describe('IdentityUserService', () => { }); beforeEach(() => { - let store = {}; + const store = {}; spyOn(localStorage, 'getItem').and.callFake( (key: string): String => { return store[key] || null; diff --git a/lib/core/utils/file-utils.ts b/lib/core/utils/file-utils.ts index 45447ae518..420c8849f3 100644 --- a/lib/core/utils/file-utils.ts +++ b/lib/core/utils/file-utils.ts @@ -24,10 +24,10 @@ export interface FileInfo { export class FileUtils { static flatten(folder: any): Promise<FileInfo[]> { - let reader = folder.createReader(); - let files: FileInfo[] = []; + const reader = folder.createReader(); + const files: FileInfo[] = []; return new Promise((resolve) => { - let iterations = []; + const iterations = []; (function traverse() { reader.readEntries((entries) => { if (!entries.length) { @@ -60,7 +60,7 @@ export class FileUtils { } static toFileArray(fileList: FileList): File[] { - let result = []; + const result = []; if (fileList && fileList.length > 0) { for (let i = 0; i < fileList.length; i++) { diff --git a/lib/core/utils/momentDateAdapter.ts b/lib/core/utils/momentDateAdapter.ts index a51f818d83..a640ec593e 100644 --- a/lib/core/utils/momentDateAdapter.ts +++ b/lib/core/utils/momentDateAdapter.ts @@ -89,7 +89,7 @@ export class MomentDateAdapter extends DateAdapter<Moment> { } clone(date: Moment): Moment { - let locale = this.locale || 'en'; + const locale = this.locale || 'en'; return date.clone().locale(locale); } @@ -98,12 +98,12 @@ export class MomentDateAdapter extends DateAdapter<Moment> { } today(): Moment { - let locale = this.locale || 'en'; + const locale = this.locale || 'en'; return moment().locale(locale); } parse(value: any, parseFormat: any): Moment { - let locale = this.locale || 'en'; + const locale = this.locale || 'en'; if (value && typeof value === 'string') { let m = moment(value, parseFormat, locale, true); @@ -207,8 +207,8 @@ export class MomentDateAdapter extends DateAdapter<Moment> { } fromIso8601(iso8601String: string): Moment | null { - let locale = this.locale || 'en'; - let d = moment(iso8601String, moment.ISO_8601).locale(locale); + const locale = this.locale || 'en'; + const d = moment(iso8601String, moment.ISO_8601).locale(locale); return this.isValid(d) ? d : null; } diff --git a/lib/core/utils/object-utils.spec.ts b/lib/core/utils/object-utils.spec.ts index 77710600b8..ddd27d6d6b 100644 --- a/lib/core/utils/object-utils.spec.ts +++ b/lib/core/utils/object-utils.spec.ts @@ -20,19 +20,19 @@ import { ObjectUtils } from './object-utils'; describe('ObjectUtils', () => { it('should get top level property value', () => { - let obj = { + const obj = { id: 1 }; expect(ObjectUtils.getValue(obj, 'id')).toBe(1); }); it('should not get top level property value', () => { - let obj = {}; + const obj = {}; expect(ObjectUtils.getValue(obj, 'missing')).toBeUndefined(); }); it('should get nested property value', () => { - let obj = { + const obj = { name: { firstName: 'John', lastName: 'Doe' @@ -43,7 +43,7 @@ describe('ObjectUtils', () => { }); it('should not get nested property value', () => { - let obj = {}; + const obj = {}; expect(ObjectUtils.getValue(obj, 'some.missing.property')).toBeUndefined(); }); diff --git a/lib/core/utils/object-utils.ts b/lib/core/utils/object-utils.ts index 1e01ec4a55..81af91ed27 100644 --- a/lib/core/utils/object-utils.ts +++ b/lib/core/utils/object-utils.ts @@ -28,12 +28,12 @@ export class ObjectUtils { return undefined; } - let keys = key.split('.'); + const keys = key.split('.'); key = ''; do { key += keys.shift(); - let value = target[key]; + const value = target[key]; if (value !== undefined && (typeof value === 'object' || !keys.length)) { target = value; key = ''; @@ -48,7 +48,7 @@ export class ObjectUtils { } static merge(...objects): any { - let result = {}; + const result = {}; objects.forEach((source) => { Object.keys(source).forEach((prop) => { diff --git a/lib/core/viewer/components/imgViewer.component.spec.ts b/lib/core/viewer/components/imgViewer.component.spec.ts index fc0afe317a..d5cf5bac2d 100644 --- a/lib/core/viewer/components/imgViewer.component.spec.ts +++ b/lib/core/viewer/components/imgViewer.component.spec.ts @@ -31,7 +31,7 @@ describe('Test Img viewer component ', () => { let element: HTMLElement; function createFakeBlob() { - let data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='); + const data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='); return new Blob([data], {type: 'image/png'}); } @@ -221,7 +221,7 @@ describe('Test Img viewer component ', () => { }); it('If no url or blob are passed should thrown an error', () => { - let change = new SimpleChange(null, null, true); + const change = new SimpleChange(null, null, true); expect(() => { component.ngOnChanges({ 'blobFile': change }); }).toThrow(new Error('Attribute urlFile or blobFile is required')); @@ -241,10 +241,10 @@ describe('Test Img viewer component ', () => { }); it('If blob is passed should not thrown an error', () => { - let blob = createFakeBlob(); + const blob = createFakeBlob(); spyOn(service, 'createTrustedUrl').and.returnValue('fake-blob-url'); - let change = new SimpleChange(null, blob, true); + const change = new SimpleChange(null, blob, true); expect(() => { component.ngOnChanges({ 'blobFile': change }); }).not.toThrow(new Error('Attribute urlFile or blobFile is required')); diff --git a/lib/core/viewer/components/imgViewer.component.ts b/lib/core/viewer/components/imgViewer.component.ts index f389a8a761..e6c176cd76 100644 --- a/lib/core/viewer/components/imgViewer.component.ts +++ b/lib/core/viewer/components/imgViewer.component.ts @@ -132,7 +132,7 @@ export class ImgViewerComponent implements OnInit, OnChanges, OnDestroy { } ngOnChanges(changes: SimpleChanges) { - let blobFile = changes['blobFile']; + const blobFile = changes['blobFile']; if (blobFile && blobFile.currentValue) { this.urlFile = this.contentService.createTrustedUrl(this.blobFile); return; diff --git a/lib/core/viewer/components/mediaPlayer.component.spec.ts b/lib/core/viewer/components/mediaPlayer.component.spec.ts index 251e2a13c2..3998491d07 100644 --- a/lib/core/viewer/components/mediaPlayer.component.spec.ts +++ b/lib/core/viewer/components/mediaPlayer.component.spec.ts @@ -29,7 +29,7 @@ xdescribe('Test Media player component ', () => { let fixture: ComponentFixture<MediaPlayerComponent>; function createFakeBlob() { - let data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='); + const data = atob('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=='); return new Blob([data], {type: 'image/png'}); } @@ -73,10 +73,10 @@ xdescribe('Test Media player component ', () => { }); it('should not thrown an error If blob is passed', () => { - let blob = createFakeBlob(); + const blob = createFakeBlob(); spyOn(service, 'createTrustedUrl').and.returnValue('fake-blob-url'); - let change = new SimpleChange(null, blob, true); + const change = new SimpleChange(null, blob, true); expect(() => { component.ngOnChanges({ 'blobFile': change }); }).not.toThrow(new Error('Attribute urlFile or blobFile is required')); diff --git a/lib/core/viewer/components/mediaPlayer.component.ts b/lib/core/viewer/components/mediaPlayer.component.ts index e65461ddbb..64e4bbc58e 100644 --- a/lib/core/viewer/components/mediaPlayer.component.ts +++ b/lib/core/viewer/components/mediaPlayer.component.ts @@ -42,7 +42,7 @@ export class MediaPlayerComponent implements OnChanges { constructor(private contentService: ContentService ) {} ngOnChanges(changes: SimpleChanges) { - let blobFile = changes['blobFile']; + const blobFile = changes['blobFile']; if (blobFile && blobFile.currentValue) { this.urlFile = this.contentService.createTrustedUrl(this.blobFile); return; diff --git a/lib/core/viewer/components/pdfViewer.component.spec.ts b/lib/core/viewer/components/pdfViewer.component.spec.ts index 58ef24d538..4bea4af833 100644 --- a/lib/core/viewer/components/pdfViewer.component.spec.ts +++ b/lib/core/viewer/components/pdfViewer.component.spec.ts @@ -98,7 +98,7 @@ class BlobTestComponent { } createFakeBlob(): Blob { - let pdfData = atob( + const pdfData = atob( 'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwog' + 'IC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAv' + 'TWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0K' + @@ -350,7 +350,7 @@ describe('Test PdfViewer component', () => { }, 5000); it('should nextPage move to the next page', (done) => { - let nextPageButton: any = elementUrlTestComponent.querySelector('#viewer-next-page-button'); + const nextPageButton: any = elementUrlTestComponent.querySelector('#viewer-next-page-button'); nextPageButton.click(); fixtureUrlTestComponent.detectChanges(); @@ -391,8 +391,8 @@ describe('Test PdfViewer component', () => { }, 5000); it('should previous page move to the previous page', (done) => { - let previousPageButton: any = elementUrlTestComponent.querySelector('#viewer-previous-page-button'); - let nextPageButton: any = elementUrlTestComponent.querySelector('#viewer-next-page-button'); + const previousPageButton: any = elementUrlTestComponent.querySelector('#viewer-previous-page-button'); + const nextPageButton: any = elementUrlTestComponent.querySelector('#viewer-next-page-button'); nextPageButton.click(); nextPageButton.click(); @@ -428,27 +428,27 @@ describe('Test PdfViewer component', () => { describe('Zoom', () => { it('should zoom in increment the scale value', () => { - let zoomInButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-in-button'); + const zoomInButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-in-button'); - let zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale; + const zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale; zoomInButton.click(); expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto'); - let currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale; + const currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale; expect(zoomBefore < currentZoom).toBe(true); }, 5000); it('should zoom out decrement the scale value', () => { - let zoomOutButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-out-button'); + const zoomOutButton: any = elementUrlTestComponent.querySelector('#viewer-zoom-out-button'); - let zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale; + const zoomBefore = componentUrlTestComponent.pdfViewerComponent.currentScale; zoomOutButton.click(); expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto'); - let currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale; + const currentZoom = componentUrlTestComponent.pdfViewerComponent.currentScale; expect(zoomBefore > currentZoom).toBe(true); }, 5000); it('should it-in button toggle page-fit and auto scale mode', () => { - let itPage: any = elementUrlTestComponent.querySelector('#viewer-scale-page-button'); + const itPage: any = elementUrlTestComponent.querySelector('#viewer-scale-page-button'); expect(componentUrlTestComponent.pdfViewerComponent.currentScaleMode).toBe('auto'); itPage.click(); diff --git a/lib/core/viewer/components/pdfViewer.component.ts b/lib/core/viewer/components/pdfViewer.component.ts index 42fb582202..20896055ab 100644 --- a/lib/core/viewer/components/pdfViewer.component.ts +++ b/lib/core/viewer/components/pdfViewer.component.ts @@ -155,7 +155,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { }; this.loadingTask.onProgress = (progressData) => { - let level = progressData.loaded / progressData.total; + const level = progressData.loaded / progressData.total; this.loadingPercent = Math.round(level * 100); }; @@ -237,8 +237,8 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { if (this.pdfViewer) { - let viewerContainer = document.getElementById(`${this.randomPdfId}-viewer-main-container`); - let documentContainer = document.getElementById(`${this.randomPdfId}-viewer-pdf-viewer`); + const viewerContainer = document.getElementById(`${this.randomPdfId}-viewer-main-container`); + const documentContainer = document.getElementById(`${this.randomPdfId}-viewer-pdf-viewer`); let widthContainer; let heightContainer; @@ -251,11 +251,11 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { heightContainer = documentContainer.clientHeight; } - let currentPage = this.pdfViewer._pages[this.pdfViewer._currentPageNumber - 1]; + const currentPage = this.pdfViewer._pages[this.pdfViewer._currentPageNumber - 1]; - let padding = 20; - let pageWidthScale = (widthContainer - padding) / currentPage.width * currentPage.scale; - let pageHeightScale = (heightContainer - padding) / currentPage.width * currentPage.scale; + const padding = 20; + const pageWidthScale = (widthContainer - padding) / currentPage.width * currentPage.scale; + const pageHeightScale = (heightContainer - padding) / currentPage.width * currentPage.scale; let scale; @@ -409,7 +409,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { * @param page to load */ inputPage(page: string) { - let pageInput = parseInt(page, 10); + const pageInput = parseInt(page, 10); if (!isNaN(pageInput) && pageInput > 0 && pageInput <= this.totalPages) { this.page = pageInput; @@ -466,7 +466,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { */ @HostListener('document:keydown', ['$event']) handleKeyboardEvent(event: KeyboardEvent) { - let key = event.keyCode; + const key = event.keyCode; if (key === 39) { // right arrow this.nextPage(); } else if (key === 37) {// left arrow @@ -476,7 +476,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { private generateUuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - let r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); + const r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8); return v.toString(16); }); } diff --git a/lib/core/viewer/components/txtViewer.component.spec.ts b/lib/core/viewer/components/txtViewer.component.spec.ts index f30ea9a275..d502c02e26 100644 --- a/lib/core/viewer/components/txtViewer.component.spec.ts +++ b/lib/core/viewer/components/txtViewer.component.spec.ts @@ -44,8 +44,8 @@ describe('Text View component', () => { it('Should text container be present with urlFile', (done) => { fixture.detectChanges(); - let urlFile = './fake-test-file.txt'; - let change = new SimpleChange(null, urlFile, true); + const urlFile = './fake-test-file.txt'; + const change = new SimpleChange(null, urlFile, true); component.ngOnChanges({ 'urlFile': change }).then(() => { fixture.detectChanges(); @@ -57,9 +57,9 @@ describe('Text View component', () => { }); it('Should text container be present with Blob file', (done) => { - let blobFile = new Blob(['text example'], {type: 'text/txt'}); + const blobFile = new Blob(['text example'], {type: 'text/txt'}); - let change = new SimpleChange(null, blobFile, true); + const change = new SimpleChange(null, blobFile, true); component.ngOnChanges({ 'blobFile': change }).then(() => { fixture.detectChanges(); diff --git a/lib/core/viewer/components/txtViewer.component.ts b/lib/core/viewer/components/txtViewer.component.ts index 23f4331442..86e3be70e6 100644 --- a/lib/core/viewer/components/txtViewer.component.ts +++ b/lib/core/viewer/components/txtViewer.component.ts @@ -42,12 +42,12 @@ export class TxtViewerComponent implements OnChanges { ngOnChanges(changes: SimpleChanges): Promise<any> { - let blobFile = changes['blobFile']; + const blobFile = changes['blobFile']; if (blobFile && blobFile.currentValue) { return this.readBlob(blobFile.currentValue); } - let urlFile = changes['urlFile']; + const urlFile = changes['urlFile']; if (urlFile && urlFile.currentValue) { return this.getUrlContent(urlFile.currentValue); } @@ -58,7 +58,7 @@ export class TxtViewerComponent implements OnChanges { } private getUrlContent(url: string): Promise<any> { - let withCredentialsMode = this.appConfigService.get<boolean>('auth.withCredentials', false); + const withCredentialsMode = this.appConfigService.get<boolean>('auth.withCredentials', false); return new Promise((resolve, reject) => { this.http.get(url, { responseType: 'text', withCredentials: withCredentialsMode }).subscribe((res) => { @@ -72,7 +72,7 @@ export class TxtViewerComponent implements OnChanges { private readBlob(blob: Blob): Promise<any> { return new Promise((resolve, reject) => { - let reader = new FileReader(); + const reader = new FileReader(); reader.onload = () => { this.content = reader.result; diff --git a/lib/core/viewer/components/viewer.component.spec.ts b/lib/core/viewer/components/viewer.component.spec.ts index a1d4cd31e4..a9865e1b30 100644 --- a/lib/core/viewer/components/viewer.component.spec.ts +++ b/lib/core/viewer/components/viewer.component.spec.ts @@ -395,8 +395,8 @@ describe('ViewerComponent', () => { describe('Viewer Example Component Rendering', () => { it('should use custom toolbar', (done) => { - let customFixture = TestBed.createComponent(ViewerWithCustomToolbarComponent); - let customElement: HTMLElement = customFixture.nativeElement; + const customFixture = TestBed.createComponent(ViewerWithCustomToolbarComponent); + const customElement: HTMLElement = customFixture.nativeElement; customFixture.detectChanges(); fixture.whenStable().then(() => { @@ -406,8 +406,8 @@ describe('ViewerComponent', () => { }); it('should use custom toolbar actions', (done) => { - let customFixture = TestBed.createComponent(ViewerWithCustomToolbarActionsComponent); - let customElement: HTMLElement = customFixture.nativeElement; + const customFixture = TestBed.createComponent(ViewerWithCustomToolbarActionsComponent); + const customElement: HTMLElement = customFixture.nativeElement; customFixture.detectChanges(); fixture.whenStable().then(() => { @@ -417,8 +417,8 @@ describe('ViewerComponent', () => { }); it('should use custom info drawer', (done) => { - let customFixture = TestBed.createComponent(ViewerWithCustomSidebarComponent); - let customElement: HTMLElement = customFixture.nativeElement; + const customFixture = TestBed.createComponent(ViewerWithCustomSidebarComponent); + const customElement: HTMLElement = customFixture.nativeElement; customFixture.detectChanges(); @@ -429,8 +429,8 @@ describe('ViewerComponent', () => { }); it('should use custom open with menu', (done) => { - let customFixture = TestBed.createComponent(ViewerWithCustomOpenWithComponent); - let customElement: HTMLElement = customFixture.nativeElement; + const customFixture = TestBed.createComponent(ViewerWithCustomOpenWithComponent); + const customElement: HTMLElement = customFixture.nativeElement; customFixture.detectChanges(); @@ -441,8 +441,8 @@ describe('ViewerComponent', () => { }); it('should use custom more actions menu', (done) => { - let customFixture = TestBed.createComponent(ViewerWithCustomMoreActionsComponent); - let customElement: HTMLElement = customFixture.nativeElement; + const customFixture = TestBed.createComponent(ViewerWithCustomMoreActionsComponent); + const customElement: HTMLElement = customFixture.nativeElement; customFixture.detectChanges(); @@ -472,7 +472,7 @@ describe('ViewerComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let sidebar = element.querySelector('#adf-right-sidebar'); + const sidebar = element.querySelector('#adf-right-sidebar'); expect(sidebar).toBeNull(); done(); }); @@ -484,7 +484,7 @@ describe('ViewerComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let sidebar = element.querySelector('#adf-right-sidebar'); + const sidebar = element.querySelector('#adf-right-sidebar'); expect(getComputedStyle(sidebar).order).toEqual('4'); done(); }); @@ -496,7 +496,7 @@ describe('ViewerComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let sidebar = element.querySelector('#adf-left-sidebar'); + const sidebar = element.querySelector('#adf-left-sidebar'); expect(sidebar).toBeNull(); done(); }); @@ -509,7 +509,7 @@ describe('ViewerComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let sidebar = element.querySelector('#adf-left-sidebar'); + const sidebar = element.querySelector('#adf-left-sidebar'); expect(getComputedStyle(sidebar).order).toEqual('1'); done(); }); @@ -658,7 +658,7 @@ describe('ViewerComponent', () => { }); it('should Click on close button hide the viewer', (done) => { - let closebutton: any = element.querySelector('.adf-viewer-close-button'); + const closebutton: any = element.querySelector('.adf-viewer-close-button'); closebutton.click(); fixture.detectChanges(); diff --git a/lib/core/viewer/components/viewer.component.ts b/lib/core/viewer/components/viewer.component.ts index 9afd1ec919..30787a25a4 100644 --- a/lib/core/viewer/components/viewer.component.ts +++ b/lib/core/viewer/components/viewer.component.ts @@ -332,7 +332,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy { } private setUpUrlFile() { - let filenameFromUrl = this.getFilenameFromUrl(this.urlFile); + const filenameFromUrl = this.getFilenameFromUrl(this.urlFile); this.fileTitle = this.getDisplayName(filenameFromUrl); this.extension = this.getFileExtension(filenameFromUrl); this.urlFileContent = this.urlFile; @@ -434,7 +434,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy { mimeType = mimeType.toLowerCase(); const editorTypes = Object.keys(this.mimeTypes); - for (let type of editorTypes) { + for (const type of editorTypes) { if (this.mimeTypes[type].indexOf(mimeType) >= 0) { return type; } @@ -509,9 +509,9 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy { * @param url - url file */ getFilenameFromUrl(url: string): string { - let anchor = url.indexOf('#'); - let query = url.indexOf('?'); - let end = Math.min( + const anchor = url.indexOf('#'); + const query = url.indexOf('?'); + const end = Math.min( anchor > 0 ? anchor : url.length, query > 0 ? query : url.length); return url.substring(url.lastIndexOf('/', end) + 1, end); @@ -679,7 +679,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy { private async waitRendition(nodeId: string, renditionId: string): Promise<RenditionEntry> { let currentRetry: number = 0; return new Promise<RenditionEntry>((resolve, reject) => { - let intervalId = setInterval(() => { + const intervalId = setInterval(() => { currentRetry++; if (this.maxRetries >= currentRetry) { this.apiService.renditionsApi.getRendition(nodeId, renditionId).then((rendition: RenditionEntry) => { diff --git a/lib/core/viewer/services/rendering-queue.services.ts b/lib/core/viewer/services/rendering-queue.services.ts index c0e47b965c..61482cdb21 100644 --- a/lib/core/viewer/services/rendering-queue.services.ts +++ b/lib/core/viewer/services/rendering-queue.services.ts @@ -98,14 +98,14 @@ export class RenderingQueueServices { // 1 visible pages // 2 if last scrolled down page after the visible pages // 2 if last scrolled up page before the visible pages - let visibleViews = visible.views; + const visibleViews = visible.views; - let numVisible = visibleViews.length; + const numVisible = visibleViews.length; if (numVisible === 0) { return false; } for (let i = 0; i < numVisible; ++i) { - let view = visibleViews[i].view; + const view = visibleViews[i].view; if (!this.isViewFinished(view)) { return view; } @@ -113,13 +113,13 @@ export class RenderingQueueServices { // All the visible views have rendered, try to render next/previous pages. if (scrolledDown) { - let nextPageIndex = visible.last.id; + const nextPageIndex = visible.last.id; // ID's start at 1 so no need to add 1. if (views[nextPageIndex] && !this.isViewFinished(views[nextPageIndex])) { return views[nextPageIndex]; } } else { - let previousPageIndex = visible.first.id - 2; + const previousPageIndex = visible.first.id - 2; if (views[previousPageIndex] && !this.isViewFinished(views[previousPageIndex])) { return views[previousPageIndex]; } @@ -142,7 +142,7 @@ export class RenderingQueueServices { * @param view */ renderView(view: any) { - let state = view.renderingState; + const state = view.renderingState; switch (state) { case this.renderingStates.FINISHED: return false; @@ -155,7 +155,7 @@ export class RenderingQueueServices { break; case this.renderingStates.INITIAL: this.highestPriorityPage = view.renderingId; - let continueRendering = function () { + const continueRendering = function () { this.renderHighestPriority(); }.bind(this); view.draw().then(continueRendering, continueRendering); diff --git a/lib/extensions/src/lib/services/extension.service.ts b/lib/extensions/src/lib/services/extension.service.ts index 4e4d1b114c..c24b6ec20b 100644 --- a/lib/extensions/src/lib/services/extension.service.ts +++ b/lib/extensions/src/lib/services/extension.service.ts @@ -92,7 +92,7 @@ export class ExtensionService { * @returns Features array found by key */ getFeature(key: string): any[] { - let properties: string[] = Array.isArray(key) ? [key] : key.split('.'); + const properties: string[] = Array.isArray(key) ? [key] : key.split('.'); return properties.reduce((prev, curr) => prev && prev[curr], this.features) || []; } diff --git a/lib/insights/analytics-process/components/analytics-generator.component.ts b/lib/insights/analytics-process/components/analytics-generator.component.ts index 3658f25c2c..7a3bb1888e 100644 --- a/lib/insights/analytics-process/components/analytics-generator.component.ts +++ b/lib/insights/analytics-process/components/analytics-generator.component.ts @@ -104,7 +104,7 @@ export class AnalyticsGeneratorComponent implements OnChanges { * so one way around it, is to clone the data, change it and then * assign it; */ - let clone = JSON.parse(JSON.stringify(report)); + const clone = JSON.parse(JSON.stringify(report)); report.datasets = clone.datasets; } diff --git a/lib/insights/analytics-process/components/analytics-report-heat-map.component.spec.ts b/lib/insights/analytics-process/components/analytics-report-heat-map.component.spec.ts index 6f2a1a2101..1f01bdc5b0 100644 --- a/lib/insights/analytics-process/components/analytics-report-heat-map.component.spec.ts +++ b/lib/insights/analytics-process/components/analytics-report-heat-map.component.spec.ts @@ -28,13 +28,13 @@ describe('AnalyticsReportHeatMapComponent', () => { let fixture: ComponentFixture<AnalyticsReportHeatMapComponent>; let element: HTMLElement; - let totalCountPercent: any = { 'sid-fake-id': 0, 'fake-start-event': 100 }; - let totalTimePercent: any = { 'sid-fake-id': 10, 'fake-start-event': 30 }; - let avgTimePercentages: any = { 'sid-fake-id': 5, 'fake-start-event': 50 }; + const totalCountPercent: any = { 'sid-fake-id': 0, 'fake-start-event': 100 }; + const totalTimePercent: any = { 'sid-fake-id': 10, 'fake-start-event': 30 }; + const avgTimePercentages: any = { 'sid-fake-id': 5, 'fake-start-event': 50 }; - let totalCountValues: any = { 'sid-fake-id': 2, 'fake-start-event': 3 }; - let totalTimeValues: any = { 'sid-fake-id': 1, 'fake-start-event': 4 }; - let avgTimeValues: any = { 'sid-fake-id': 4, 'fake-start-event': 5 }; + const totalCountValues: any = { 'sid-fake-id': 2, 'fake-start-event': 3 }; + const totalTimeValues: any = { 'sid-fake-id': 1, 'fake-start-event': 4 }; + const avgTimeValues: any = { 'sid-fake-id': 4, 'fake-start-event': 5 }; setupTestBed({ imports: [InsightsTestingModule] @@ -70,7 +70,7 @@ describe('AnalyticsReportHeatMapComponent', () => { component.success.subscribe(() => { fixture.whenStable().then(() => { - let dropDown: any = element.querySelector('#select-metrics'); + const dropDown: any = element.querySelector('#select-metrics'); expect(dropDown).toBeDefined(); expect(dropDown.length).toEqual(3); expect(dropDown[0].innerHTML).toEqual('Number of times a step is executed'); @@ -91,21 +91,21 @@ describe('AnalyticsReportHeatMapComponent', () => { })); it('should change the currentMetric width totalCount', async(() => { - let field = { value: 'totalCount' }; + const field = { value: 'totalCount' }; component.onMetricChanges(field); expect(component.currentMetric).toEqual(totalCountValues); expect(component.currentMetricColors).toEqual(totalCountPercent); })); it('should change the currentMetric width totalTime', async(() => { - let field = { value: 'totalTime' }; + const field = { value: 'totalTime' }; component.onMetricChanges(field); expect(component.currentMetric).toEqual(totalTimeValues); expect(component.currentMetricColors).toEqual(totalTimePercent); })); it('should change the currentMetric width avgTime', async(() => { - let field = { value: 'avgTime' }; + const field = { value: 'avgTime' }; component.onMetricChanges(field); expect(component.currentMetric).toEqual(avgTimeValues); expect(component.currentMetricColors).toEqual(avgTimePercentages); diff --git a/lib/insights/analytics-process/components/analytics-report-list.component.spec.ts b/lib/insights/analytics-process/components/analytics-report-list.component.spec.ts index 88fc118d72..3244c9dd3f 100644 --- a/lib/insights/analytics-process/components/analytics-report-list.component.spec.ts +++ b/lib/insights/analytics-process/components/analytics-report-list.component.spec.ts @@ -25,7 +25,7 @@ declare let jasmine: any; describe('AnalyticsReportListComponent', () => { - let reportList = [ + const reportList = [ { 'id': 2002, 'name': 'Fake Test Process definition heat map' }, { 'id': 2003, 'name': 'Fake Test Process definition overview' }, { 'id': 2004, 'name': 'Fake Test Process instances overview' }, @@ -33,7 +33,7 @@ describe('AnalyticsReportListComponent', () => { { 'id': 2006, 'name': 'Fake Test Task service level agreement' } ]; - let reportSelected = { 'id': 2003, 'name': 'Fake Test Process definition overview' }; + const reportSelected = { 'id': 2003, 'name': 'Fake Test Process definition overview' }; let component: AnalyticsReportListComponent; let fixture: ComponentFixture<AnalyticsReportListComponent>; @@ -155,13 +155,13 @@ describe('AnalyticsReportListComponent', () => { it('Should return false if the current report is different', () => { component.selectReport(reportSelected); - let anotherReport = { 'id': 111, 'name': 'Another Fake Test Process definition overview' }; + const anotherReport = { 'id': 111, 'name': 'Another Fake Test Process definition overview' }; expect(component.isSelected(anotherReport)).toBe(false); }); it('Should reload the report list', (done) => { component.initObserver(); - let report = new ReportParametersModel({ 'id': 2002, 'name': 'Fake Test Process definition heat map' }); + const report = new ReportParametersModel({ 'id': 2002, 'name': 'Fake Test Process definition heat map' }); component.reports = [report]; expect(component.reports.length).toEqual(1); component.reload(); diff --git a/lib/insights/analytics-process/components/analytics-report-list.component.ts b/lib/insights/analytics-process/components/analytics-report-list.component.ts index aab26a7097..8b8bd91d52 100644 --- a/lib/insights/analytics-process/components/analytics-report-list.component.ts +++ b/lib/insights/analytics-process/components/analytics-report-list.component.ts @@ -153,7 +153,7 @@ export class AnalyticsReportListComponent implements OnInit { } public selectReportByReportId(reportId) { - let reportFound = this.reports.find((report) => report.id === reportId); + const reportFound = this.reports.find((report) => report.id === reportId); if (reportFound) { this.currentReport = reportFound; this.reportClick.emit(reportFound); diff --git a/lib/insights/analytics-process/components/analytics-report-parameters.component.spec.ts b/lib/insights/analytics-process/components/analytics-report-parameters.component.spec.ts index 8f9b1398b7..745ca13f64 100644 --- a/lib/insights/analytics-process/components/analytics-report-parameters.component.spec.ts +++ b/lib/insights/analytics-process/components/analytics-report-parameters.component.spec.ts @@ -60,7 +60,7 @@ describe('AnalyticsReportParametersComponent', () => { }); it('Should initialize the Report form with a Form Group ', (done) => { - let fakeReportParam = new ReportParametersModel(analyticParamsMock.reportDefParamTask); + const fakeReportParam = new ReportParametersModel(analyticParamsMock.reportDefParamTask); component.successReportParams.subscribe(() => { fixture.detectChanges(); expect(component.reportForm.get('taskGroup')).toBeDefined(); @@ -73,7 +73,7 @@ describe('AnalyticsReportParametersComponent', () => { it('Should render a dropdown with all the status when the definition parameter type is \'status\' ', (done) => { component.successReportParams.subscribe(() => { fixture.detectChanges(); - let dropDown: any = element.querySelector('#select-status'); + const dropDown: any = element.querySelector('#select-status'); expect(element.querySelector('h4').textContent.trim()).toEqual('Fake Task overview status'); expect(dropDown).toBeDefined(); expect(dropDown.length).toEqual(4); @@ -84,8 +84,8 @@ describe('AnalyticsReportParametersComponent', () => { done(); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -98,14 +98,14 @@ describe('AnalyticsReportParametersComponent', () => { it('Should render a number with the default value when the definition parameter type is \'integer\' ', (done) => { component.successReportParams.subscribe(() => { fixture.detectChanges(); - let numberElement: any = element.querySelector('#slowProcessInstanceInteger'); + const numberElement: any = element.querySelector('#slowProcessInstanceInteger'); expect(numberElement.value).toEqual('10'); done(); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -118,10 +118,10 @@ describe('AnalyticsReportParametersComponent', () => { it('Should render a duration component when the definition parameter type is \'duration\' ', (done) => { component.successReportParams.subscribe(() => { fixture.detectChanges(); - let numberElement: any = element.querySelector('#duration'); + const numberElement: any = element.querySelector('#duration'); expect(numberElement.value).toEqual('0'); - let dropDown: any = element.querySelector('#select-duration'); + const dropDown: any = element.querySelector('#select-duration'); expect(dropDown).toBeDefined(); expect(dropDown.length).toEqual(4); expect(dropDown[0].innerHTML).toEqual('Seconds'); @@ -131,8 +131,8 @@ describe('AnalyticsReportParametersComponent', () => { done(); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -155,7 +155,7 @@ describe('AnalyticsReportParametersComponent', () => { expect(res.typeFiltering).toEqual(true); }); - let values: any = { + const values: any = { dateRange: { startDate: '2016-09-01', endDate: '2016-10-05' }, @@ -188,13 +188,13 @@ describe('AnalyticsReportParametersComponent', () => { it('Should render a checkbox with the value true when the definition parameter type is \'boolean\' ', (done) => { component.successReportParams.subscribe(() => { fixture.detectChanges(); - let checkElement: any = element.querySelector('#typeFiltering-input'); + const checkElement: any = element.querySelector('#typeFiltering-input'); expect(checkElement.checked).toBeTruthy(); done(); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -206,13 +206,13 @@ describe('AnalyticsReportParametersComponent', () => { it('Should render a date range components when the definition parameter type is \'dateRange\' ', (done) => { component.successReportParams.subscribe(() => { - let dateElement: any = element.querySelector('adf-date-range-widget'); + const dateElement: any = element.querySelector('adf-date-range-widget'); expect(dateElement).toBeDefined(); done(); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.toggleParameters(); component.ngOnChanges({'reportId': change}); @@ -226,7 +226,7 @@ describe('AnalyticsReportParametersComponent', () => { it('Should render a dropdown with all the RangeInterval when the definition parameter type is \'dateRangeInterval\' ', (done) => { component.successReportParams.subscribe(() => { fixture.detectChanges(); - let dropDown: any = element.querySelector('#select-dateRangeInterval'); + const dropDown: any = element.querySelector('#select-dateRangeInterval'); expect(dropDown).toBeDefined(); expect(dropDown.length).toEqual(5); expect(dropDown[0].innerHTML).toEqual('By hour'); @@ -237,8 +237,8 @@ describe('AnalyticsReportParametersComponent', () => { done(); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -252,7 +252,7 @@ describe('AnalyticsReportParametersComponent', () => { ' reportId change', (done) => { component.successParamOpt.subscribe(() => { fixture.detectChanges(); - let dropDown: any = element.querySelector('#select-processDefinitionId'); + const dropDown: any = element.querySelector('#select-processDefinitionId'); expect(dropDown).toBeDefined(); expect(dropDown.length).toEqual(5); expect(dropDown[0].innerHTML).toEqual('Choose One'); @@ -275,8 +275,8 @@ describe('AnalyticsReportParametersComponent', () => { responseText: analyticParamsMock.reportDefParamProcessDefOptionsNoApp }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); }); @@ -285,7 +285,7 @@ describe('AnalyticsReportParametersComponent', () => { ' appId change', (done) => { component.successParamOpt.subscribe(() => { fixture.detectChanges(); - let dropDown: any = element.querySelector('#select-processDefinitionId'); + const dropDown: any = element.querySelector('#select-processDefinitionId'); expect(dropDown).toBeDefined(); expect(dropDown.length).toEqual(3); expect(dropDown[0].innerHTML).toEqual('Choose One'); @@ -300,7 +300,7 @@ describe('AnalyticsReportParametersComponent', () => { responseText: analyticParamsMock.reportDefParamProcessDef }); - let appId = 1; + const appId = 1; jasmine.Ajax.stubRequest('http://localhost:9876/bpm/activiti-app/api/enterprise/process-definitions?appDefinitionId=' + appId).andReturn({ status: 200, @@ -310,7 +310,7 @@ describe('AnalyticsReportParametersComponent', () => { component.appId = appId; component.reportId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); component.ngOnChanges({'appId': change}); }); @@ -322,8 +322,8 @@ describe('AnalyticsReportParametersComponent', () => { expect(component.reportForm.controls).toEqual({}); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -372,8 +372,8 @@ describe('AnalyticsReportParametersComponent', () => { responseText: [] }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); }); @@ -384,8 +384,8 @@ describe('AnalyticsReportParametersComponent', () => { done(); }); - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); jasmine.Ajax.requests.mostRecent().respondWith({ @@ -396,13 +396,13 @@ describe('AnalyticsReportParametersComponent', () => { }); it('Should convert a string in number', () => { - let numberConvert = component.convertNumber('2'); + const numberConvert = component.convertNumber('2'); expect(numberConvert).toEqual(2); }); describe('When the form is rendered correctly', () => { - let values: any = { + const values: any = { dateRange: { startDate: '2016-09-01', endDate: '2016-10-05' }, @@ -430,8 +430,8 @@ describe('AnalyticsReportParametersComponent', () => { }; beforeEach(async(() => { - let reportId = 1; - let change = new SimpleChange(null, reportId, true); + const reportId = 1; + const change = new SimpleChange(null, reportId, true); component.ngOnChanges({'reportId': change}); fixture.detectChanges(); @@ -450,11 +450,11 @@ describe('AnalyticsReportParametersComponent', () => { it('Should be able to change the report title', (done) => { spyOn(service, 'updateReport').and.returnValue(of(analyticParamsMock.reportDefParamStatus)); - let title: HTMLElement = element.querySelector('h4'); + const title: HTMLElement = element.querySelector('h4'); title.click(); fixture.detectChanges(); - let reportName: HTMLInputElement = <HTMLInputElement> element.querySelector('#reportName'); + const reportName: HTMLInputElement = <HTMLInputElement> element.querySelector('#reportName'); expect(reportName).not.toBeNull(); reportName.focus(); @@ -465,7 +465,7 @@ describe('AnalyticsReportParametersComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let titleChanged: HTMLElement = element.querySelector('h4'); + const titleChanged: HTMLElement = element.querySelector('h4'); expect(titleChanged.textContent.trim()).toEqual('FAKE_TEST_NAME'); done(); }); @@ -481,7 +481,7 @@ describe('AnalyticsReportParametersComponent', () => { component.submit(values); fixture.detectChanges(); - let saveButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#save-button'); + const saveButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#save-button'); expect(saveButton).toBeDefined(); expect(saveButton).not.toBeNull(); saveButton.click(); @@ -490,11 +490,11 @@ describe('AnalyticsReportParametersComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let reportDialogTitle: HTMLElement = <HTMLElement> window.document.querySelector('#report-dialog-title'); - let saveTitleSubMessage: HTMLElement = <HTMLElement> window.document.querySelector('#save-title-submessage'); - let inputSaveName: HTMLInputElement = <HTMLInputElement> window.document.querySelector('#repName'); - let performActionButton: HTMLButtonElement = <HTMLButtonElement> window.document.querySelector('#action-dialog-button'); - let todayDate = component.getTodayDate(); + const reportDialogTitle: HTMLElement = <HTMLElement> window.document.querySelector('#report-dialog-title'); + const saveTitleSubMessage: HTMLElement = <HTMLElement> window.document.querySelector('#save-title-submessage'); + const inputSaveName: HTMLInputElement = <HTMLInputElement> window.document.querySelector('#repName'); + const performActionButton: HTMLButtonElement = <HTMLButtonElement> window.document.querySelector('#action-dialog-button'); + const todayDate = component.getTodayDate(); expect(reportDialogTitle).not.toBeNull('Dialog title should not be null'); expect(saveTitleSubMessage).not.toBeNull('Dialog save title submessage should not be null'); @@ -513,7 +513,7 @@ describe('AnalyticsReportParametersComponent', () => { xit('Should show a dialog to allowing report export', async(() => { component.submit(values); fixture.detectChanges(); - let exportButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#export-button'); + const exportButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#export-button'); expect(exportButton).toBeDefined(); expect(exportButton).not.toBeNull(); @@ -523,10 +523,10 @@ describe('AnalyticsReportParametersComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let reportDialogTitle: HTMLElement = <HTMLElement> window.document.querySelector('#report-dialog-title'); - let inputSaveName: HTMLInputElement = <HTMLInputElement> window.document.querySelector('#repName'); - let performActionButton: HTMLButtonElement = <HTMLButtonElement> window.document.querySelector('#action-dialog-button'); - let todayDate = component.getTodayDate(); + const reportDialogTitle: HTMLElement = <HTMLElement> window.document.querySelector('#report-dialog-title'); + const inputSaveName: HTMLInputElement = <HTMLInputElement> window.document.querySelector('#repName'); + const performActionButton: HTMLButtonElement = <HTMLButtonElement> window.document.querySelector('#action-dialog-button'); + const todayDate = component.getTodayDate(); expect(reportDialogTitle).not.toBeNull(); expect(inputSaveName.value.trim()).toEqual(analyticParamsMock.reportDefParamStatus.name + ' ( ' + todayDate + ' )'); @@ -562,7 +562,7 @@ describe('AnalyticsReportParametersComponent', () => { it('Should raise an event for report deleted', async(() => { fixture.detectChanges(); spyOn(component, 'deleteReport'); - let deleteButton = fixture.debugElement.nativeElement.querySelector('#delete-button'); + const deleteButton = fixture.debugElement.nativeElement.querySelector('#delete-button'); expect(deleteButton).toBeDefined(); expect(deleteButton).not.toBeNull(); component.deleteReportSuccess.subscribe((reportId) => { diff --git a/lib/insights/analytics-process/components/analytics-report-parameters.component.ts b/lib/insights/analytics-process/components/analytics-report-parameters.component.ts index 23f50a8a0b..e4c3673baf 100644 --- a/lib/insights/analytics-process/components/analytics-report-parameters.component.ts +++ b/lib/insights/analytics-process/components/analytics-report-parameters.component.ts @@ -111,7 +111,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On ngOnInit() { this.dropDownSub = this.onDropdownChanged.subscribe((field) => { - let paramDependOn: ReportParameterDetailsModel = this.reportParameters.definition.parameters.find((p) => p.dependsOn === field.id); + const paramDependOn: ReportParameterDetailsModel = this.reportParameters.definition.parameters.find((p) => p.dependsOn === field.id); if (paramDependOn) { this.retrieveParameterOptions(this.reportParameters.definition.parameters, this.appId, this.reportId, field.value); } @@ -131,20 +131,20 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On this.reportForm.reset(); } - let reportId = changes['reportId']; + const reportId = changes['reportId']; if (reportId && reportId.currentValue) { this.reportId = reportId.currentValue; this.getReportParams(reportId.currentValue); } - let appId = changes['appId']; + const appId = changes['appId']; if (appId && (appId.currentValue || appId.currentValue === null)) { this.getReportParams(this.reportId); } } private generateFormGroupFromParameter(parameters: ReportParameterDetailsModel[]) { - let formBuilderGroup: any = {}; + const formBuilderGroup: any = {}; parameters.forEach((param: ReportParameterDetailsModel) => { switch (param.type) { case 'dateRange': @@ -263,7 +263,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On } convertFormValuesToReportParamQuery(values: any): ReportQuery { - let reportParamQuery: ReportQuery = new ReportQuery(); + const reportParamQuery: ReportQuery = new ReportQuery(); if (values.dateRange) { reportParamQuery.dateRange.startDate = this.convertMomentDate(values.dateRange.startDate); reportParamQuery.dateRange.endDate = this.convertMomentDate(values.dateRange.endDate); @@ -353,7 +353,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On doExport(paramQuery: ReportQuery) { this.analyticsService.exportReportToCsv(this.reportId, paramQuery).subscribe( (data: any) => { - let blob: Blob = new Blob([data], { type: 'text/csv' }); + const blob: Blob = new Blob([data], { type: 'text/csv' }); this.contentService.downloadBlob(blob, paramQuery.reportName + '.csv'); }); } diff --git a/lib/insights/analytics-process/components/widgets/date-range/date-range.widget.ts b/lib/insights/analytics-process/components/widgets/date-range/date-range.widget.ts index 0799bb0a7b..80e64b4633 100644 --- a/lib/insights/analytics-process/components/widgets/date-range/date-range.widget.ts +++ b/lib/insights/analytics-process/components/widgets/date-range/date-range.widget.ts @@ -62,7 +62,7 @@ export class DateRangeWidgetComponent implements OnInit { this.dateAdapter.setLocale(locale); }); - let momentDateAdapter = <MomentDateAdapter> this.dateAdapter; + const momentDateAdapter = <MomentDateAdapter> this.dateAdapter; momentDateAdapter.overrideDisplayFormat = this.SHOW_FORMAT; if (this.field) { @@ -75,11 +75,11 @@ export class DateRangeWidgetComponent implements OnInit { } } - let startDateControl = new FormControl(this.startDatePicker); + const startDateControl = new FormControl(this.startDatePicker); startDateControl.setValidators(Validators.required); this.dateRange.addControl('startDate', startDateControl); - let endDateControl = new FormControl(this.endDatePicker); + const endDateControl = new FormControl(this.endDatePicker); endDateControl.setValidators(Validators.required); this.dateRange.addControl('endDate', endDateControl); @@ -89,8 +89,8 @@ export class DateRangeWidgetComponent implements OnInit { onGroupValueChanged() { if (this.dateRange.valid) { - let dateStart = this.convertToMomentDateWithTime(this.dateRange.controls.startDate.value); - let endStart = this.convertToMomentDateWithTime(this.dateRange.controls.endDate.value); + const dateStart = this.convertToMomentDateWithTime(this.dateRange.controls.startDate.value); + const endStart = this.convertToMomentDateWithTime(this.dateRange.controls.endDate.value); this.dateRangeChanged.emit({startDate: dateStart, endDate: endStart}); } } @@ -100,9 +100,9 @@ export class DateRangeWidgetComponent implements OnInit { } dateCheck(formControl: AbstractControl) { - let startDate = moment(formControl.get('startDate').value); - let endDate = moment(formControl.get('endDate').value); - let isAfterCheck = startDate.isAfter(endDate); + const startDate = moment(formControl.get('startDate').value); + const endDate = moment(formControl.get('endDate').value); + const isAfterCheck = startDate.isAfter(endDate); return isAfterCheck ? {'greaterThan': true} : null; } diff --git a/lib/insights/analytics-process/components/widgets/dropdown/dropdown.widget.ts b/lib/insights/analytics-process/components/widgets/dropdown/dropdown.widget.ts index de6d79b155..4ccc18b77c 100644 --- a/lib/insights/analytics-process/components/widgets/dropdown/dropdown.widget.ts +++ b/lib/insights/analytics-process/components/widgets/dropdown/dropdown.widget.ts @@ -65,7 +65,7 @@ export class DropdownWidgetAnalyticsComponent extends WidgetComponent implements } buildValidatorList() { - let validatorList = []; + const validatorList = []; validatorList.push(Validators.required); if (this.showDefaultOption) { validatorList.push(this.validateDropDown); diff --git a/lib/insights/analytics-process/components/widgets/duration/duration.widget.ts b/lib/insights/analytics-process/components/widgets/duration/duration.widget.ts index 131d9d4798..38349200c5 100644 --- a/lib/insights/analytics-process/components/widgets/duration/duration.widget.ts +++ b/lib/insights/analytics-process/components/widgets/duration/duration.widget.ts @@ -53,7 +53,7 @@ export class DurationWidgetComponent extends NumberWidgetAnalyticsComponent impl } ngOnInit() { - let timeType = new FormControl(); + const timeType = new FormControl(); this.formGroup.addControl('timeType', timeType); if (this.required) { @@ -63,7 +63,7 @@ export class DurationWidgetComponent extends NumberWidgetAnalyticsComponent impl this.field.value = 0; } - let paramOptions: ParameterValueModel[] = []; + const paramOptions: ParameterValueModel[] = []; paramOptions.push(new ParameterValueModel({id: '1', name: 'Seconds'})); paramOptions.push(new ParameterValueModel({id: '60', name: 'Minutes'})); paramOptions.push(new ParameterValueModel({id: '3600', name: 'Hours'})); diff --git a/lib/insights/analytics-process/components/widgets/widget.component.ts b/lib/insights/analytics-process/components/widgets/widget.component.ts index f0a8581f9d..7ce468acc3 100644 --- a/lib/insights/analytics-process/components/widgets/widget.component.ts +++ b/lib/insights/analytics-process/components/widgets/widget.component.ts @@ -26,7 +26,7 @@ export class WidgetComponent implements OnChanges { fieldChanged: EventEmitter<any> = new EventEmitter<any>(); ngOnChanges(changes: SimpleChanges) { - let field = changes['field']; + const field = changes['field']; if (field && field.currentValue) { this.fieldChanged.emit(field.currentValue.value); return; diff --git a/lib/insights/analytics-process/services/analytics.service.ts b/lib/insights/analytics-process/services/analytics.service.ts index f57e603f80..c2e7fe747e 100644 --- a/lib/insights/analytics-process/services/analytics.service.ts +++ b/lib/insights/analytics-process/services/analytics.service.ts @@ -44,9 +44,9 @@ export class AnalyticsService { return from(this.apiService.getInstance().activiti.reportApi.getReportList()) .pipe( map((res: any) => { - let reports: ReportParametersModel[] = []; + const reports: ReportParametersModel[] = []; res.forEach((report: ReportParametersModel) => { - let reportModel = new ReportParametersModel(report); + const reportModel = new ReportParametersModel(report); if (this.isReportValid(appId, report)) { reports.push(reportModel); } @@ -111,7 +111,7 @@ export class AnalyticsService { } getProcessStatusValues(): Observable<any> { - let paramOptions: ParameterValueModel[] = []; + const paramOptions: ParameterValueModel[] = []; paramOptions.push(new ParameterValueModel({ id: 'All', name: 'All' })); paramOptions.push(new ParameterValueModel({ id: 'Active', name: 'Active' })); @@ -124,7 +124,7 @@ export class AnalyticsService { } getDateIntervalValues(): Observable<any> { - let paramOptions: ParameterValueModel[] = []; + const paramOptions: ParameterValueModel[] = []; paramOptions.push(new ParameterValueModel({ id: 'byHour', name: 'By hour' })); paramOptions.push(new ParameterValueModel({ id: 'byDay', name: 'By day' })); @@ -139,7 +139,7 @@ export class AnalyticsService { } getMetricValues(): Observable<any> { - let paramOptions: ParameterValueModel[] = []; + const paramOptions: ParameterValueModel[] = []; paramOptions.push(new ParameterValueModel({ id: 'totalCount', name: 'Number of times a step is executed' })); paramOptions.push(new ParameterValueModel({ id: 'totalTime', name: 'Total time spent in a process step' })); @@ -155,7 +155,7 @@ export class AnalyticsService { return from(this.apiService.getInstance().activiti.reportApi.getProcessDefinitions()) .pipe( map((res: any) => { - let paramOptions: ParameterValueModel[] = []; + const paramOptions: ParameterValueModel[] = []; res.forEach((opt) => { paramOptions.push(new ParameterValueModel(opt)); }); @@ -166,11 +166,11 @@ export class AnalyticsService { } getProcessDefinitionsValues(appId: number): Observable<any> { - let options = { 'appDefinitionId': appId }; + const options = { 'appDefinitionId': appId }; return from(this.apiService.getInstance().activiti.processDefinitionsApi.getProcessDefinitions(options)) .pipe( map((res: any) => { - let paramOptions: ParameterValueModel[] = []; + const paramOptions: ParameterValueModel[] = []; res.data.forEach((opt) => { paramOptions.push(new ParameterValueModel(opt)); }); @@ -184,7 +184,7 @@ export class AnalyticsService { return from(this.apiService.getInstance().activiti.reportApi.getTasksByProcessDefinitionId(reportId, processDefinitionId)) .pipe( map((res: any) => { - let paramOptions: ParameterValueModel[] = []; + const paramOptions: ParameterValueModel[] = []; res.forEach((opt) => { paramOptions.push(new ParameterValueModel({ id: opt, name: opt })); }); @@ -198,7 +198,7 @@ export class AnalyticsService { return from(this.apiService.getInstance().activiti.reportApi.getReportsByParams(reportId, paramsQuery)) .pipe( map((res: any) => { - let elements: Chart[] = []; + const elements: Chart[] = []; res.elements.forEach((chartData) => { if (chartData.type === 'pieChart') { elements.push(new PieChart(chartData)); diff --git a/lib/insights/diagram/components/diagram.component.activities.spec.ts b/lib/insights/diagram/components/diagram.component.activities.spec.ts index 34f3dda23a..bfd9e4b761 100644 --- a/lib/insights/diagram/components/diagram.component.activities.spec.ts +++ b/lib/insights/diagram/components/diagram.component.activities.spec.ts @@ -55,7 +55,7 @@ describe('Diagrams activities', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -70,23 +70,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake User task'); - let iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); + const iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.userTask] }; + const resp = { elements: [diagramsActivitiesMock.userTask] }; ajaxReply(resp); })); @@ -95,23 +95,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Manual task'); - let iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); + const iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.manualTask] }; + const resp = { elements: [diagramsActivitiesMock.manualTask] }; ajaxReply(resp); })); @@ -120,23 +120,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Service task'); - let iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); + const iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.serviceTask] }; + const resp = { elements: [diagramsActivitiesMock.serviceTask] }; ajaxReply(resp); })); @@ -145,23 +145,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Camel task'); - let iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); + const iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.camelTask] }; + const resp = { elements: [diagramsActivitiesMock.camelTask] }; ajaxReply(resp); })); @@ -170,19 +170,19 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Mule task'); - let iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); + const iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); expect(iconTask).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.muleTask] }; + const resp = { elements: [diagramsActivitiesMock.muleTask] }; ajaxReply(resp); })); @@ -191,24 +191,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Alfresco Publish task'); - let iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + + const iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + ' raphael-icon-alfresco-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.alfrescoPublishTask] }; + const resp = { elements: [diagramsActivitiesMock.alfrescoPublishTask] }; ajaxReply(resp); })); @@ -217,24 +217,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Google Drive Publish task'); - let iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + + const iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + ' diagram-icon-google-drive-publish-task > raphael-icon-google-drive-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.googleDrivePublishTask] }; + const resp = { elements: [diagramsActivitiesMock.googleDrivePublishTask] }; ajaxReply(resp); })); @@ -243,24 +243,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Rest Call task'); - let iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + + const iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + ' raphael-icon-rest-call'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.restCallTask] }; + const resp = { elements: [diagramsActivitiesMock.restCallTask] }; ajaxReply(resp); })); @@ -269,24 +269,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Box Publish task'); - let iconTask: any = element.querySelector('diagram-box-publish-task >' + + const iconTask: any = element.querySelector('diagram-box-publish-task >' + ' diagram-icon-box-publish-task > raphael-icon-box-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.boxPublishTask] }; + const resp = { elements: [diagramsActivitiesMock.boxPublishTask] }; ajaxReply(resp); })); @@ -295,23 +295,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Receive task'); - let iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); + const iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.receiveTask] }; + const resp = { elements: [diagramsActivitiesMock.receiveTask] }; ajaxReply(resp); })); @@ -320,23 +320,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Script task'); - let iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); + const iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.scriptTask] }; + const resp = { elements: [diagramsActivitiesMock.scriptTask] }; ajaxReply(resp); })); @@ -345,23 +345,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake BusinessRule task'); - let iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); + const iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.businessRuleTask] }; + const resp = { elements: [diagramsActivitiesMock.businessRuleTask] }; ajaxReply(resp); })); @@ -374,23 +374,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake User task'); - let iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); + const iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.userTask] }; + const resp = { elements: [diagramsActivitiesMock.userTask] }; ajaxReply(resp); })); @@ -399,23 +399,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake User task'); - let iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); + const iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.userTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.userTaskActive] }; ajaxReply(resp); })); @@ -424,23 +424,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-user-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-user-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake User task'); - let iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); + const iconTask: any = element.querySelector('diagram-user-task > diagram-icon-user-task > raphael-icon-user'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.userTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.userTaskCompleted] }; ajaxReply(resp); })); @@ -449,23 +449,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Manual task'); - let iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); + const iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.manualTask] }; + const resp = { elements: [diagramsActivitiesMock.manualTask] }; ajaxReply(resp); })); @@ -474,23 +474,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Manual task'); - let iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); + const iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.manualTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.manualTaskActive] }; ajaxReply(resp); })); @@ -499,23 +499,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-manual-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-manual-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Manual task'); - let iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); + const iconTask: any = element.querySelector('diagram-manual-task > diagram-icon-manual-task > raphael-icon-manual'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.manualTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.manualTaskCompleted] }; ajaxReply(resp); })); @@ -524,23 +524,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Service task'); - let iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); + const iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.serviceTask] }; + const resp = { elements: [diagramsActivitiesMock.serviceTask] }; ajaxReply(resp); })); @@ -549,23 +549,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Service task'); - let iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); + const iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.serviceTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.serviceTaskActive] }; ajaxReply(resp); })); @@ -574,23 +574,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-service-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-service-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Service task'); - let iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); + const iconTask: any = element.querySelector('diagram-service-task > diagram-icon-service-task > raphael-icon-service'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.serviceTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.serviceTaskCompleted] }; ajaxReply(resp); })); @@ -599,23 +599,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Camel task'); - let iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); + const iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.camelTask] }; + const resp = { elements: [diagramsActivitiesMock.camelTask] }; ajaxReply(resp); })); @@ -624,23 +624,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Camel task'); - let iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); + const iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.camelTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.camelTaskActive] }; ajaxReply(resp); })); @@ -649,23 +649,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-camel-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-camel-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Camel task'); - let iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); + const iconTask: any = element.querySelector('diagram-camel-task > diagram-icon-camel-task > raphael-icon-camel'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.camelTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.camelTaskCompleted] }; ajaxReply(resp); })); @@ -674,19 +674,19 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Mule task'); - let iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); + const iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); expect(iconTask).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.muleTask] }; + const resp = { elements: [diagramsActivitiesMock.muleTask] }; ajaxReply(resp); })); @@ -695,19 +695,19 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Mule task'); - let iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); + const iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); expect(iconTask).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.muleTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.muleTaskActive] }; ajaxReply(resp); })); @@ -716,19 +716,19 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-mule-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-mule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Mule task'); - let iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); + const iconTask: any = element.querySelector('diagram-mule-task > diagram-icon-mule-task > raphael-icon-mule'); expect(iconTask).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.muleTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.muleTaskCompleted] }; ajaxReply(resp); })); @@ -737,24 +737,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Alfresco Publish task'); - let iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + + const iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + ' raphael-icon-alfresco-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.alfrescoPublishTask] }; + const resp = { elements: [diagramsActivitiesMock.alfrescoPublishTask] }; ajaxReply(resp); })); @@ -763,24 +763,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Alfresco Publish task'); - let iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + + const iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + ' raphael-icon-alfresco-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.alfrescoPublishTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.alfrescoPublishTaskActive] }; ajaxReply(resp); })); @@ -789,24 +789,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('adf-diagram-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Alfresco Publish task'); - let iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + + const iconTask: any = element.querySelector('adf-diagram-publish-task > diagram-icon-alfresco-publish-task >' + ' raphael-icon-alfresco-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.alfrescoPublishTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.alfrescoPublishTaskCompleted] }; ajaxReply(resp); })); @@ -815,24 +815,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Google Drive Publish task'); - let iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + + const iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + ' diagram-icon-google-drive-publish-task > raphael-icon-google-drive-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.googleDrivePublishTask] }; + const resp = { elements: [diagramsActivitiesMock.googleDrivePublishTask] }; ajaxReply(resp); })); @@ -841,24 +841,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Google Drive Publish task'); - let iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + + const iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + ' diagram-icon-google-drive-publish-task > raphael-icon-google-drive-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.googleDrivePublishTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.googleDrivePublishTaskActive] }; ajaxReply(resp); })); @@ -867,24 +867,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-google-drive-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Google Drive Publish task'); - let iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + + const iconTask: any = element.querySelector('diagram-google-drive-publish-task >' + ' diagram-icon-google-drive-publish-task > raphael-icon-google-drive-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.googleDrivePublishTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.googleDrivePublishTaskCompleted] }; ajaxReply(resp); })); @@ -893,24 +893,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Rest Call task'); - let iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + + const iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + ' raphael-icon-rest-call'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.restCallTask] }; + const resp = { elements: [diagramsActivitiesMock.restCallTask] }; ajaxReply(resp); })); @@ -919,24 +919,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Rest Call task'); - let iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + + const iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + ' raphael-icon-rest-call'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.restCallTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.restCallTaskActive] }; ajaxReply(resp); })); @@ -945,24 +945,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-rest-call-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Rest Call task'); - let iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + + const iconTask: any = element.querySelector('diagram-rest-call-task > diagram-icon-rest-call-task >' + ' raphael-icon-rest-call'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.restCallTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.restCallTaskCompleted] }; ajaxReply(resp); })); @@ -971,24 +971,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Box Publish task'); - let iconTask: any = element.querySelector('diagram-box-publish-task >' + + const iconTask: any = element.querySelector('diagram-box-publish-task >' + ' diagram-icon-box-publish-task > raphael-icon-box-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.boxPublishTask] }; + const resp = { elements: [diagramsActivitiesMock.boxPublishTask] }; ajaxReply(resp); })); @@ -997,24 +997,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Box Publish task'); - let iconTask: any = element.querySelector('diagram-box-publish-task >' + + const iconTask: any = element.querySelector('diagram-box-publish-task >' + ' diagram-icon-box-publish-task > raphael-icon-box-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.boxPublishTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.boxPublishTaskActive] }; ajaxReply(resp); })); @@ -1023,24 +1023,24 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-box-publish-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Box Publish task'); - let iconTask: any = element.querySelector('diagram-box-publish-task >' + + const iconTask: any = element.querySelector('diagram-box-publish-task >' + ' diagram-icon-box-publish-task > raphael-icon-box-publish'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.boxPublishTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.boxPublishTaskCompleted] }; ajaxReply(resp); })); @@ -1049,23 +1049,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Receive task'); - let iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); + const iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.receiveTask] }; + const resp = { elements: [diagramsActivitiesMock.receiveTask] }; ajaxReply(resp); })); @@ -1074,23 +1074,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Receive task'); - let iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); + const iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.receiveTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.receiveTaskActive] }; ajaxReply(resp); })); @@ -1099,23 +1099,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-receive-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-receive-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Receive task'); - let iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); + const iconTask: any = element.querySelector('diagram-receive-task > diagram-icon-receive-task > raphael-icon-receive'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.receiveTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.receiveTaskCompleted] }; ajaxReply(resp); })); @@ -1124,23 +1124,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Script task'); - let iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); + const iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.scriptTask] }; + const resp = { elements: [diagramsActivitiesMock.scriptTask] }; ajaxReply(resp); })); @@ -1149,23 +1149,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Script task'); - let iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); + const iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.scriptTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.scriptTaskActive] }; ajaxReply(resp); })); @@ -1174,23 +1174,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-script-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-script-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake Script task'); - let iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); + const iconTask: any = element.querySelector('diagram-script-task > diagram-icon-script-task > raphael-icon-script'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.scriptTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.scriptTaskCompleted] }; ajaxReply(resp); })); @@ -1199,23 +1199,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect'); + const task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake BusinessRule task'); - let iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); + const iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.businessRuleTask] }; + const resp = { elements: [diagramsActivitiesMock.businessRuleTask] }; ajaxReply(resp); })); @@ -1224,23 +1224,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); + const task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect[ng-reflect-stroke="#017501"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake BusinessRule task'); - let iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); + const iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.businessRuleTaskActive] }; + const resp = { elements: [diagramsActivitiesMock.businessRuleTaskActive] }; ajaxReply(resp); })); @@ -1249,23 +1249,23 @@ describe('Diagrams activities', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const task: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(task).not.toBeNull(); - let taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); + const taskText: any = element.querySelector('diagram-business-rule-task > diagram-task > raphael-multiline-text'); expect(taskText).not.toBeNull(); expect(taskText.attributes[1].value).toEqual('Fake BusinessRule task'); - let iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); + const iconTask: any = element.querySelector('diagram-business-rule-task > diagram-icon-business-rule-task > raphael-icon-business-rule'); expect(iconTask).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].name); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsActivitiesMock.businessRuleTaskCompleted] }; + const resp = { elements: [diagramsActivitiesMock.businessRuleTaskCompleted] }; ajaxReply(resp); })); diff --git a/lib/insights/diagram/components/diagram.component.boundary.spec.ts b/lib/insights/diagram/components/diagram.component.boundary.spec.ts index e7d667bf48..91225ba821 100644 --- a/lib/insights/diagram/components/diagram.component.boundary.spec.ts +++ b/lib/insights/diagram/components/diagram.component.boundary.spec.ts @@ -54,7 +54,7 @@ describe('Diagrams boundary', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -69,27 +69,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryTimeEvent] }; + const resp = { elements: [boundaryEventMock.boundaryTimeEvent] }; ajaxReply(resp); })); @@ -99,30 +99,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryTimeEventActive] }; + const resp = { elements: [boundaryEventMock.boundaryTimeEventActive] }; ajaxReply(resp); })); @@ -132,30 +132,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryTimeEventCompleted] }; + const resp = { elements: [boundaryEventMock.boundaryTimeEventCompleted] }; ajaxReply(resp); })); @@ -164,27 +164,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryErrorEvent] }; + const resp = { elements: [boundaryEventMock.boundaryErrorEvent] }; ajaxReply(resp); })); @@ -194,30 +194,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryErrorEventActive] }; + const resp = { elements: [boundaryEventMock.boundaryErrorEventActive] }; ajaxReply(resp); })); @@ -227,30 +227,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryErrorEventCompleted] }; + const resp = { elements: [boundaryEventMock.boundaryErrorEventCompleted] }; ajaxReply(resp); })); @@ -259,27 +259,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundarySignalEvent] }; + const resp = { elements: [boundaryEventMock.boundarySignalEvent] }; ajaxReply(resp); })); @@ -289,30 +289,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundarySignalEventActive] }; + const resp = { elements: [boundaryEventMock.boundarySignalEventActive] }; ajaxReply(resp); })); @@ -322,30 +322,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundarySignalEventCompleted] }; + const resp = { elements: [boundaryEventMock.boundarySignalEventCompleted] }; ajaxReply(resp); })); @@ -354,27 +354,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; ajaxReply(resp); })); @@ -384,30 +384,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEventActive] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEventActive] }; ajaxReply(resp); })); @@ -417,30 +417,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEventCompleted] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEventCompleted] }; ajaxReply(resp); })); @@ -449,27 +449,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; ajaxReply(resp); })); @@ -479,30 +479,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEventActive] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEventActive] }; ajaxReply(resp); })); @@ -512,30 +512,30 @@ describe('Diagrams boundary', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-boundary-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEventCompleted] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEventCompleted] }; ajaxReply(resp); })); }); @@ -547,27 +547,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryTimeEvent] }; + const resp = { elements: [boundaryEventMock.boundaryTimeEvent] }; ajaxReply(resp); })); @@ -576,27 +576,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryErrorEvent] }; + const resp = { elements: [boundaryEventMock.boundaryErrorEvent] }; ajaxReply(resp); })); @@ -605,27 +605,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundarySignalEvent] }; + const resp = { elements: [boundaryEventMock.boundarySignalEvent] }; ajaxReply(resp); })); @@ -634,27 +634,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; ajaxReply(resp); })); @@ -663,27 +663,27 @@ describe('Diagrams boundary', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-boundary-event'); + const shape: any = element.querySelector('diagram-boundary-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-boundary-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; + const resp = { elements: [boundaryEventMock.boundaryMessageEvent] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.catching.events.spec.ts b/lib/insights/diagram/components/diagram.component.catching.events.spec.ts index fef4245471..02c892ee05 100644 --- a/lib/insights/diagram/components/diagram.component.catching.events.spec.ts +++ b/lib/insights/diagram/components/diagram.component.catching.events.spec.ts @@ -54,7 +54,7 @@ describe('Diagrams Catching', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -69,27 +69,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEvent] }; ajaxReply(resp); })); @@ -98,27 +98,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEvent] }; ajaxReply(resp); })); @@ -127,27 +127,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEvent] }; ajaxReply(resp); })); @@ -156,27 +156,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEvent] }; ajaxReply(resp); })); }); @@ -188,27 +188,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEvent] }; ajaxReply(resp); })); @@ -218,30 +218,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEventActive] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEventActive] }; ajaxReply(resp); })); @@ -251,30 +251,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEventCompleted] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingTimeEventCompleted] }; ajaxReply(resp); })); @@ -283,27 +283,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEvent] }; ajaxReply(resp); })); @@ -313,30 +313,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEventActive] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEventActive] }; ajaxReply(resp); })); @@ -346,30 +346,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEventCompleted] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingErrorEventCompleted] }; ajaxReply(resp); })); @@ -378,27 +378,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEvent] }; ajaxReply(resp); })); @@ -408,30 +408,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEventActive] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEventActive] }; ajaxReply(resp); })); @@ -441,30 +441,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEventCompleted] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingSignalEventCompleted] }; ajaxReply(resp); })); @@ -473,27 +473,27 @@ describe('Diagrams Catching', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEvent] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEvent] }; ajaxReply(resp); })); @@ -503,30 +503,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEventActive] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEventActive] }; ajaxReply(resp); })); @@ -536,30 +536,30 @@ describe('Diagrams Catching', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-intermediate-catching-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-intermediate-catching-event'); + const shape: any = element.querySelector('diagram-intermediate-catching-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-intermediate-catching-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEventCompleted] }; + const resp = { elements: [intermediateCatchingMock.intermediateCatchingMessageEventCompleted] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.events.spec.ts b/lib/insights/diagram/components/diagram.component.events.spec.ts index 08204c2f94..77207dd107 100644 --- a/lib/insights/diagram/components/diagram.component.events.spec.ts +++ b/lib/insights/diagram/components/diagram.component.events.spec.ts @@ -54,7 +54,7 @@ describe('Diagrams events', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -69,15 +69,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startEvent] }; + const resp = { elements: [diagramsEventsMock.startEvent] }; ajaxReply(resp); })); @@ -86,20 +86,20 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startTimeEvent] }; + const resp = { elements: [diagramsEventsMock.startTimeEvent] }; ajaxReply(resp); })); @@ -108,19 +108,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event'); + const event: any = element.querySelector('diagram-start-event'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startSignalEvent] }; + const resp = { elements: [diagramsEventsMock.startSignalEvent] }; ajaxReply(resp); })); @@ -129,19 +129,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startMessageEvent] }; + const resp = { elements: [diagramsEventsMock.startMessageEvent] }; ajaxReply(resp); })); @@ -150,19 +150,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startErrorEvent] }; + const resp = { elements: [diagramsEventsMock.startErrorEvent] }; ajaxReply(resp); })); @@ -171,15 +171,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endEvent] }; + const resp = { elements: [diagramsEventsMock.endEvent] }; ajaxReply(resp); })); @@ -188,19 +188,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endErrorEvent] }; + const resp = { elements: [diagramsEventsMock.endErrorEvent] }; ajaxReply(resp); })); }); @@ -212,15 +212,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startEvent] }; + const resp = { elements: [diagramsEventsMock.startEvent] }; ajaxReply(resp); })); @@ -229,15 +229,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startEventActive] }; + const resp = { elements: [diagramsEventsMock.startEventActive] }; ajaxReply(resp); })); @@ -246,15 +246,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startEventCompleted] }; + const resp = { elements: [diagramsEventsMock.startEventCompleted] }; ajaxReply(resp); })); @@ -263,19 +263,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startTimeEvent] }; + const resp = { elements: [diagramsEventsMock.startTimeEvent] }; ajaxReply(resp); })); @@ -285,19 +285,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startTimeEventActive] }; + const resp = { elements: [diagramsEventsMock.startTimeEventActive] }; ajaxReply(resp); })); @@ -307,19 +307,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-timer > raphael-icon-timer'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startTimeEventCompleted] }; + const resp = { elements: [diagramsEventsMock.startTimeEventCompleted] }; ajaxReply(resp); })); @@ -329,19 +329,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startSignalEvent] }; + const resp = { elements: [diagramsEventsMock.startSignalEvent] }; ajaxReply(resp); })); @@ -350,19 +350,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startSignalEventActive] }; + const resp = { elements: [diagramsEventsMock.startSignalEventActive] }; ajaxReply(resp); })); @@ -371,19 +371,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-signal > raphael-icon-signal'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startSignalEventCompleted] }; + const resp = { elements: [diagramsEventsMock.startSignalEventCompleted] }; ajaxReply(resp); })); @@ -392,19 +392,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startMessageEvent] }; + const resp = { elements: [diagramsEventsMock.startMessageEvent] }; ajaxReply(resp); })); @@ -413,19 +413,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startMessageEventActive] }; + const resp = { elements: [diagramsEventsMock.startMessageEventActive] }; ajaxReply(resp); })); @@ -434,19 +434,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-message > raphael-icon-message'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startMessageEventCompleted] }; + const resp = { elements: [diagramsEventsMock.startMessageEventCompleted] }; ajaxReply(resp); })); @@ -455,19 +455,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startErrorEvent] }; + const resp = { elements: [diagramsEventsMock.startErrorEvent] }; ajaxReply(resp); })); @@ -476,19 +476,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startErrorEventActive] }; + const resp = { elements: [diagramsEventsMock.startErrorEventActive] }; ajaxReply(resp); })); @@ -497,19 +497,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); + const event: any = element.querySelector('diagram-start-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-start-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.startErrorEventCompleted] }; + const resp = { elements: [diagramsEventsMock.startErrorEventCompleted] }; ajaxReply(resp); })); @@ -518,15 +518,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endEvent] }; + const resp = { elements: [diagramsEventsMock.endEvent] }; ajaxReply(resp); })); @@ -535,15 +535,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endEventActive] }; + const resp = { elements: [diagramsEventsMock.endEventActive] }; ajaxReply(resp); })); @@ -552,15 +552,15 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(event).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endEventCompleted] }; + const resp = { elements: [diagramsEventsMock.endEventCompleted] }; ajaxReply(resp); })); @@ -569,19 +569,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endErrorEvent] }; + const resp = { elements: [diagramsEventsMock.endErrorEvent] }; ajaxReply(resp); })); @@ -590,19 +590,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#017501"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endErrorEventActive] }; + const resp = { elements: [diagramsEventsMock.endErrorEventActive] }; ajaxReply(resp); })); @@ -611,19 +611,19 @@ describe('Diagrams events', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).toBeDefined(); - let event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); + const event: any = element.querySelector('diagram-end-event > diagram-event > raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(event).not.toBeNull(); - let iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + + const iconEvent: any = element.querySelector('diagram-end-event > diagram-event >' + ' diagram-container-icon-event > div > div > diagram-icon-error > raphael-icon-error'); expect(iconEvent).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsEventsMock.endErrorEventCompleted] }; + const resp = { elements: [diagramsEventsMock.endErrorEventCompleted] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.flows.spec.ts b/lib/insights/diagram/components/diagram.component.flows.spec.ts index c037cf4892..1a470c9d27 100644 --- a/lib/insights/diagram/components/diagram.component.flows.spec.ts +++ b/lib/insights/diagram/components/diagram.component.flows.spec.ts @@ -54,7 +54,7 @@ describe('Diagrams flows', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -69,16 +69,16 @@ describe('Diagrams flows', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('adf-diagram-sequence-flow > raphael-flow-arrow'); + const shape: any = element.querySelector('adf-diagram-sequence-flow > raphael-flow-arrow'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.flows[0].id); expect(tooltip.textContent).toContain(res.flows[0].type); }); }); component.ngOnChanges(); - let resp = { flows: [flowsMock.flow] }; + const resp = { flows: [flowsMock.flow] }; ajaxReply(resp); })); }); @@ -90,16 +90,16 @@ describe('Diagrams flows', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('adf-diagram-sequence-flow > raphael-flow-arrow'); + const shape: any = element.querySelector('adf-diagram-sequence-flow > raphael-flow-arrow'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.flows[0].id); expect(tooltip.textContent).toContain(res.flows[0].type); }); }); component.ngOnChanges(); - let resp = { flows: [flowsMock.flow] }; + const resp = { flows: [flowsMock.flow] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.gateways.spec.ts b/lib/insights/diagram/components/diagram.component.gateways.spec.ts index 9f9be0fa22..d72c798542 100644 --- a/lib/insights/diagram/components/diagram.component.gateways.spec.ts +++ b/lib/insights/diagram/components/diagram.component.gateways.spec.ts @@ -54,7 +54,7 @@ describe('Diagrams gateways', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -69,19 +69,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); + const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.exclusiveGateway] }; + const resp = { elements: [diagramsGatewaysMock.exclusiveGateway] }; ajaxReply(resp); })); @@ -90,19 +90,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); + const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.inclusiveGateway] }; + const resp = { elements: [diagramsGatewaysMock.inclusiveGateway] }; ajaxReply(resp); })); @@ -111,19 +111,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); + const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.parallelGateway] }; + const resp = { elements: [diagramsGatewaysMock.parallelGateway] }; ajaxReply(resp); })); @@ -132,29 +132,29 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-event-gateway'); + const shape1: any = element.querySelector('diagram-event-gateway'); expect(shape1).not.toBeNull(); expect(shape1.children.length).toBe(4); - let outerCircle = shape1.children[1]; + const outerCircle = shape1.children[1]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape1.children[2]; + const innerCircle = shape1.children[2]; expect(innerCircle.localName).toEqual('raphael-circle'); - let shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); + const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); expect(shape2).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.eventGateway] }; + const resp = { elements: [diagramsGatewaysMock.eventGateway] }; ajaxReply(resp); })); }); @@ -166,19 +166,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); + const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.exclusiveGateway] }; + const resp = { elements: [diagramsGatewaysMock.exclusiveGateway] }; ajaxReply(resp); })); @@ -187,19 +187,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); + const shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); + const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.exclusiveGatewayActive] }; + const resp = { elements: [diagramsGatewaysMock.exclusiveGatewayActive] }; ajaxReply(resp); })); @@ -208,19 +208,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); + const shape: any = element.querySelector('diagram-exclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); + const shape1: any = element.querySelector('diagram-exclusive-gateway > raphael-cross'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.exclusiveGatewayCompleted] }; + const resp = { elements: [diagramsGatewaysMock.exclusiveGatewayCompleted] }; ajaxReply(resp); })); @@ -229,19 +229,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); + const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.inclusiveGateway] }; + const resp = { elements: [diagramsGatewaysMock.inclusiveGateway] }; ajaxReply(resp); })); @@ -250,19 +250,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); + const shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); + const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.inclusiveGatewayActive] }; + const resp = { elements: [diagramsGatewaysMock.inclusiveGatewayActive] }; ajaxReply(resp); })); @@ -271,19 +271,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); + const shape: any = element.querySelector('diagram-inclusive-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); + const shape1: any = element.querySelector('diagram-inclusive-gateway > raphael-circle'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.inclusiveGatewayCompleted] }; + const resp = { elements: [diagramsGatewaysMock.inclusiveGatewayCompleted] }; ajaxReply(resp); })); @@ -292,19 +292,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); + const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.parallelGateway] }; + const resp = { elements: [diagramsGatewaysMock.parallelGateway] }; ajaxReply(resp); })); @@ -313,19 +313,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); + const shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); + const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.parallelGatewayActive] }; + const resp = { elements: [diagramsGatewaysMock.parallelGatewayActive] }; ajaxReply(resp); })); @@ -334,19 +334,19 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); + const shape: any = element.querySelector('diagram-parallel-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); + const shape1: any = element.querySelector('diagram-parallel-gateway > raphael-plus'); expect(shape1).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.parallelGatewayCompleted] }; + const resp = { elements: [diagramsGatewaysMock.parallelGatewayCompleted] }; ajaxReply(resp); })); @@ -355,29 +355,29 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus'); + const shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-event-gateway'); + const shape1: any = element.querySelector('diagram-event-gateway'); expect(shape1).not.toBeNull(); expect(shape1.children.length).toBe(4); - let outerCircle = shape1.children[1]; + const outerCircle = shape1.children[1]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape1.children[2]; + const innerCircle = shape1.children[2]; expect(innerCircle.localName).toEqual('raphael-circle'); - let shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); + const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); expect(shape2).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.eventGateway] }; + const resp = { elements: [diagramsGatewaysMock.eventGateway] }; ajaxReply(resp); })); @@ -386,29 +386,29 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); + const shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#017501"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-event-gateway'); + const shape1: any = element.querySelector('diagram-event-gateway'); expect(shape1).not.toBeNull(); expect(shape1.children.length).toBe(4); - let outerCircle = shape1.children[1]; + const outerCircle = shape1.children[1]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape1.children[2]; + const innerCircle = shape1.children[2]; expect(innerCircle.localName).toEqual('raphael-circle'); - let shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); + const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); expect(shape2).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.eventGatewayActive] }; + const resp = { elements: [diagramsGatewaysMock.eventGatewayActive] }; ajaxReply(resp); })); @@ -417,29 +417,29 @@ describe('Diagrams gateways', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); + const shape: any = element.querySelector('diagram-event-gateway > diagram-gateway > raphael-rhombus[ng-reflect-stroke="#2632aa"]'); expect(shape).not.toBeNull(); - let shape1: any = element.querySelector('diagram-event-gateway'); + const shape1: any = element.querySelector('diagram-event-gateway'); expect(shape1).not.toBeNull(); expect(shape1.children.length).toBe(4); - let outerCircle = shape1.children[1]; + const outerCircle = shape1.children[1]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape1.children[2]; + const innerCircle = shape1.children[2]; expect(innerCircle.localName).toEqual('raphael-circle'); - let shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); + const shape2: any = element.querySelector('diagram-event-gateway > raphael-pentagon'); expect(shape2).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [diagramsGatewaysMock.eventGatewayCompleted] }; + const resp = { elements: [diagramsGatewaysMock.eventGatewayCompleted] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.structural.spec.ts b/lib/insights/diagram/components/diagram.component.structural.spec.ts index 3c4b360b32..7fe85a6a15 100644 --- a/lib/insights/diagram/components/diagram.component.structural.spec.ts +++ b/lib/insights/diagram/components/diagram.component.structural.spec.ts @@ -54,7 +54,7 @@ describe('Diagrams structural', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -69,16 +69,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-subprocess > raphael-rect'); + const shape: any = element.querySelector('diagram-subprocess > raphael-rect'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.subProcess] }; + const resp = { elements: [structuralMock.subProcess] }; ajaxReply(resp); })); @@ -87,16 +87,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-subprocess > raphael-rect'); + const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.eventSubProcess] }; + const resp = { elements: [structuralMock.eventSubProcess] }; ajaxReply(resp); })); }); @@ -108,16 +108,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-subprocess > raphael-rect'); + const shape: any = element.querySelector('diagram-subprocess > raphael-rect'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.subProcess] }; + const resp = { elements: [structuralMock.subProcess] }; ajaxReply(resp); })); @@ -126,16 +126,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-subprocess > raphael-rect[ng-reflect-stroke="#017501"]'); + const shape: any = element.querySelector('diagram-subprocess > raphael-rect[ng-reflect-stroke="#017501"]'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.subProcessActive] }; + const resp = { elements: [structuralMock.subProcessActive] }; ajaxReply(resp); })); @@ -144,16 +144,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-subprocess > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const shape: any = element.querySelector('diagram-subprocess > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.subProcessCompleted] }; + const resp = { elements: [structuralMock.subProcessCompleted] }; ajaxReply(resp); })); @@ -162,16 +162,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-subprocess > raphael-rect'); + const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.eventSubProcess] }; + const resp = { elements: [structuralMock.eventSubProcess] }; ajaxReply(resp); })); @@ -180,16 +180,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-subprocess > raphael-rect[ng-reflect-stroke="#017501"]'); + const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect[ng-reflect-stroke="#017501"]'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.eventSubProcessActive] }; + const resp = { elements: [structuralMock.eventSubProcessActive] }; ajaxReply(resp); })); @@ -198,16 +198,16 @@ describe('Diagrams structural', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-event-subprocess > raphael-rect[ng-reflect-stroke="#2632aa"]'); + const shape: any = element.querySelector('diagram-event-subprocess > raphael-rect[ng-reflect-stroke="#2632aa"]'); expect(shape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [structuralMock.eventSubProcessCompleted] }; + const resp = { elements: [structuralMock.eventSubProcessCompleted] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.swim.spec.ts b/lib/insights/diagram/components/diagram.component.swim.spec.ts index f9a8d2b6b9..d339f0cc72 100644 --- a/lib/insights/diagram/components/diagram.component.swim.spec.ts +++ b/lib/insights/diagram/components/diagram.component.swim.spec.ts @@ -54,7 +54,7 @@ describe('Diagrams swim', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -69,16 +69,16 @@ describe('Diagrams swim', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-pool > raphael-rect'); + const shape: any = element.querySelector('diagram-pool > raphael-rect'); expect(shape).not.toBeNull(); - let shapeText: any = element.querySelector('diagram-pool > raphael-text'); + const shapeText: any = element.querySelector('diagram-pool > raphael-text'); expect(shapeText).not.toBeNull(); expect(shapeText.attributes[2].value).toEqual('Activiti'); }); }); component.ngOnChanges(); - let resp = { pools: [swimLanesMock.pool] }; + const resp = { pools: [swimLanesMock.pool] }; ajaxReply(resp); })); @@ -87,19 +87,19 @@ describe('Diagrams swim', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shapeLane: any = element.querySelector('diagram-lanes > div > div > diagram-lane'); + const shapeLane: any = element.querySelector('diagram-lanes > div > div > diagram-lane'); expect(shapeLane).not.toBeNull(); - let shapeRect: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-rect'); + const shapeRect: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-rect'); expect(shapeRect).not.toBeNull(); - let shapeText: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-text'); + const shapeText: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-text'); expect(shapeText).not.toBeNull(); expect(shapeText.attributes[2].value).toEqual('Backend'); }); }); component.ngOnChanges(); - let resp = { pools: [swimLanesMock.poolLanes] }; + const resp = { pools: [swimLanesMock.poolLanes] }; ajaxReply(resp); })); }); @@ -111,16 +111,16 @@ describe('Diagrams swim', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-pool > raphael-rect'); + const shape: any = element.querySelector('diagram-pool > raphael-rect'); expect(shape).not.toBeNull(); - let shapeText: any = element.querySelector('diagram-pool > raphael-text'); + const shapeText: any = element.querySelector('diagram-pool > raphael-text'); expect(shapeText).not.toBeNull(); expect(shapeText.attributes[2].value).toEqual('Activiti'); }); }); component.ngOnChanges(); - let resp = { pools: [swimLanesMock.pool] }; + const resp = { pools: [swimLanesMock.pool] }; ajaxReply(resp); })); @@ -129,19 +129,19 @@ describe('Diagrams swim', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shapeLane: any = element.querySelector('diagram-lanes > div > div > diagram-lane'); + const shapeLane: any = element.querySelector('diagram-lanes > div > div > diagram-lane'); expect(shapeLane).not.toBeNull(); - let shapeRect: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-rect'); + const shapeRect: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-rect'); expect(shapeRect).not.toBeNull(); - let shapeText: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-text'); + const shapeText: any = element.querySelector('diagram-lanes > div > div > diagram-lane > raphael-text'); expect(shapeText).not.toBeNull(); expect(shapeText.attributes[2].value).toEqual('Backend'); }); }); component.ngOnChanges(); - let resp = { pools: [swimLanesMock.poolLanes] }; + const resp = { pools: [swimLanesMock.poolLanes] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.throw.spec.ts b/lib/insights/diagram/components/diagram.component.throw.spec.ts index a56c59cd41..9fb3d54ae8 100644 --- a/lib/insights/diagram/components/diagram.component.throw.spec.ts +++ b/lib/insights/diagram/components/diagram.component.throw.spec.ts @@ -53,7 +53,7 @@ describe('Diagrams throw', () => { jasmine.Ajax.uninstall(); }); - let ajaxReply = (resp: any) => { + const ajaxReply = (resp: any) => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'json', @@ -68,23 +68,23 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwTimeEvent] }; + const resp = { elements: [throwEventMock.throwTimeEvent] }; ajaxReply(resp); })); @@ -94,26 +94,26 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwTimeEventActive] }; + const resp = { elements: [throwEventMock.throwTimeEventActive] }; ajaxReply(resp); })); @@ -123,26 +123,26 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwTimeEventCompleted] }; + const resp = { elements: [throwEventMock.throwTimeEventCompleted] }; ajaxReply(resp); })); @@ -151,27 +151,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwErrorEvent] }; + const resp = { elements: [throwEventMock.throwErrorEvent] }; ajaxReply(resp); })); @@ -181,30 +181,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwErrorEventActive] }; + const resp = { elements: [throwEventMock.throwErrorEventActive] }; ajaxReply(resp); })); @@ -214,30 +214,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwErrorEventCompleted] }; + const resp = { elements: [throwEventMock.throwErrorEventCompleted] }; ajaxReply(resp); })); @@ -246,27 +246,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwSignalEvent] }; + const resp = { elements: [throwEventMock.throwSignalEvent] }; ajaxReply(resp); })); @@ -276,30 +276,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwSignalEventActive] }; + const resp = { elements: [throwEventMock.throwSignalEventActive] }; ajaxReply(resp); })); @@ -309,30 +309,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwSignalEventCompleted] }; + const resp = { elements: [throwEventMock.throwSignalEventCompleted] }; ajaxReply(resp); })); @@ -341,27 +341,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEvent] }; + const resp = { elements: [throwEventMock.throwMessageEvent] }; ajaxReply(resp); })); @@ -371,30 +371,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEventActive] }; + const resp = { elements: [throwEventMock.throwMessageEventActive] }; ajaxReply(resp); })); @@ -404,30 +404,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEventCompleted] }; + const resp = { elements: [throwEventMock.throwMessageEventCompleted] }; ajaxReply(resp); })); @@ -436,27 +436,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEvent] }; + const resp = { elements: [throwEventMock.throwMessageEvent] }; ajaxReply(resp); })); @@ -466,30 +466,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#017501"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEventActive] }; + const resp = { elements: [throwEventMock.throwMessageEventActive] }; ajaxReply(resp); })); @@ -499,30 +499,30 @@ describe('Diagrams throw', () => { fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); + const coloredShape: any = element.querySelector('diagram-throw-event>raphael-circle[ng-reflect-stroke="#2632aa"]'); expect(coloredShape).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEventCompleted] }; + const resp = { elements: [throwEventMock.throwMessageEventCompleted] }; ajaxReply(resp); })); }); @@ -534,23 +534,23 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-timer'); expect(iconShape).not.toBeNull(); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwTimeEvent] }; + const resp = { elements: [throwEventMock.throwTimeEvent] }; ajaxReply(resp); })); @@ -559,27 +559,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-error'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwErrorEvent] }; + const resp = { elements: [throwEventMock.throwErrorEvent] }; ajaxReply(resp); })); @@ -588,27 +588,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-signal'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwSignalEvent] }; + const resp = { elements: [throwEventMock.throwSignalEvent] }; ajaxReply(resp); })); @@ -617,27 +617,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEvent] }; + const resp = { elements: [throwEventMock.throwMessageEvent] }; ajaxReply(resp); })); @@ -646,27 +646,27 @@ describe('Diagrams throw', () => { fixture.detectChanges(); fixture.whenStable().then(() => { expect(res).not.toBeNull(); - let shape: any = element.querySelector('diagram-throw-event'); + const shape: any = element.querySelector('diagram-throw-event'); expect(shape).not.toBeNull(); expect(shape.children.length).toBe(4); - let outerCircle = shape.children[0]; + const outerCircle = shape.children[0]; expect(outerCircle.localName).toEqual('raphael-circle'); - let innerCircle = shape.children[1]; + const innerCircle = shape.children[1]; expect(innerCircle.localName).toEqual('raphael-circle'); - let iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + + const iconShape: any = element.querySelector('diagram-throw-event > diagram-container-icon-event >' + ' div > div > diagram-icon-message'); expect(iconShape).not.toBeNull(); - let tooltip: any = element.querySelector('diagram-tooltip > div'); + const tooltip: any = element.querySelector('diagram-tooltip > div'); expect(tooltip.textContent).toContain(res.elements[0].id); expect(tooltip.textContent).toContain(res.elements[0].type); }); }); component.ngOnChanges(); - let resp = { elements: [throwEventMock.throwMessageEvent] }; + const resp = { elements: [throwEventMock.throwMessageEvent] }; ajaxReply(resp); })); }); diff --git a/lib/insights/diagram/components/diagram.component.ts b/lib/insights/diagram/components/diagram.component.ts index d16781f112..95522c939f 100644 --- a/lib/insights/diagram/components/diagram.component.ts +++ b/lib/insights/diagram/components/diagram.component.ts @@ -106,9 +106,9 @@ export class DiagramComponent implements OnChanges { } setMetricValueToDiagramElement(diagram: DiagramModel, metrics: any, metricType: string) { - for (let key in metrics) { + for (const key in metrics) { if (metrics.hasOwnProperty(key)) { - let foundElement: DiagramElementModel = diagram.elements.find( + const foundElement: DiagramElementModel = diagram.elements.find( (element: DiagramElementModel) => element.id === key); if (foundElement) { foundElement.value = metrics[key]; diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts index 7e8f925c1a..a8f2166ee4 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-alfresco-publish.component.ts @@ -61,8 +61,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements public draw(position: Point) { - let startX = position.x + 2; - let startY = position.y + 2; + const startX = position.x + 2; + const startY = position.y + 2; let path1 = this.paper.path(`M4.11870968,2.12890323 L6.12954839,0.117935484 L3.10993548,0.118064516 L3.10270968,0.118064516 C1.42941935,0.118064516 0.0729032258,1.47458065 0.0729032258,3.14774194 C0.0729032258,4.82116129 1.42929032,6.17754839 @@ -76,8 +76,8 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements 'stroke-width': this.strokeWidth }); - let startX1 = startX + 1.419355; - let startY1 = startY + 8.387097; + const startX1 = startX + 1.419355; + const startY1 = startY + 8.387097; path1.transform('T' + startX1 + ',' + startY1); path1 = this.paper.path(`M10.4411613,10.5153548 L8.43032258,8.50451613 L8.43032258,11.5313548 C8.43032258,13.2047742 9.78683871, @@ -101,7 +101,7 @@ export class RaphaelIconAlfrescoPublishDirective extends RaphaelBase implements 'stroke-width': this.strokeWidth }); - let startX2 = startX + 5.548387; + const startX2 = startX + 5.548387; path1.transform('T' + startX2 + ',' + startY); path1 = this.paper.path(`M4.58090323,1.0156129 C3.39767742,-0.167483871 1.47935484,-0.167483871 0.296129032,1.01574194 diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts index d6ad2d59d2..067bcdd14d 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-box-publish.component.ts @@ -61,7 +61,7 @@ export class RaphaelIconBoxPublishDirective extends RaphaelBase implements OnIni public draw(position: Point) { - let image = this.paper.image(); + const image = this.paper.image(); image.attr({'x': position.x}); image.attr({'y': position.y}); diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts index 3b45d4765f..615969c2d0 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-business-rule.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconBusinessRuleDirective extends RaphaelBase implements OnI } public draw(position: Point) { - let path1 = this.paper.path(`m 1,2 0,14 16,0 0,-14 z m 1.45458,5.6000386 2.90906,0 0,2.7999224 -2.90906,0 z m 4.36364,0 8.72718,0 + const path1 = this.paper.path(`m 1,2 0,14 16,0 0,-14 z m 1.45458,5.6000386 2.90906,0 0,2.7999224 -2.90906,0 z m 4.36364,0 8.72718,0 0,2.7999224 -8.72718,0 z m -4.36364,4.1998844 2.90906,0 0,2.800116 -2.90906,0 z m 4.36364,0 8.72718,0 0,2.800116 -8.72718,0 z`).attr({ 'stroke': this.stroke, diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-camel.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-camel.component.ts index 56d6e0caa3..793bb80cca 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-camel.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-camel.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconCamelDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`m 8.1878027,15.383782 c -0.824818,-0.3427 0.375093,-1.1925 0.404055,-1.7743 0.230509,-0.8159 + const path1 = this.paper.path(`m 8.1878027,15.383782 c -0.824818,-0.3427 0.375093,-1.1925 0.404055,-1.7743 0.230509,-0.8159 -0.217173,-1.5329 -0.550642,-2.2283 -0.106244,-0.5273 -0.03299,-1.8886005 -0.747194,-1.7818005 -0.712355,0.3776 -0.9225,1.2309005 -1.253911,1.9055005 -0.175574,1.0874 -0.630353,2.114 -0.775834,3.2123 -0.244009,0.4224 -1.741203,0.3888 -1.554386,-0.1397 0.651324,-0.3302 1.13227,-0.9222 1.180246,-1.6705 0.0082,-0.7042 -0.133578,-1.3681 0.302178,-2.0083 0.08617,-0.3202 diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-error.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-error.component.ts index 784a169b39..8f15b21dbd 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-error.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-error.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconErrorDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`M 22.820839,11.171502 L 19.36734,24.58992 L 13.54138,14.281819 L 9.3386512,20.071607 + const path1 = this.paper.path(`M 22.820839,11.171502 L 19.36734,24.58992 L 13.54138,14.281819 L 9.3386512,20.071607 L 13.048949,6.8323057 L 18.996148,16.132659 L 22.820839,11.171502 z`).attr({ 'opacity': 1, 'stroke': this.stroke, diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts index 31c6c64be5..33293b28e4 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-google-drive-publish.component.ts @@ -61,7 +61,7 @@ export class RaphaelIconGoogleDrivePublishDirective extends RaphaelBase implemen public draw(position: Point) { - let image = this.paper.image(); + const image = this.paper.image(); image.attr({'x': position.x}); image.attr({'y': position.y}); diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-manual.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-manual.component.ts index 7fa2c3770e..e16627afdd 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-manual.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-manual.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconManualDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`m 17,9.3290326 c -0.0069,0.5512461 -0.455166,1.0455894 -0.940778,1.0376604 l -5.792746,0 c + const path1 = this.paper.path(`m 17,9.3290326 c -0.0069,0.5512461 -0.455166,1.0455894 -0.940778,1.0376604 l -5.792746,0 c 0.0053,0.119381 0.0026,0.237107 0.0061,0.355965 l 5.154918,0 c 0.482032,-0.0096 0.925529,0.49051 0.919525,1.037574 -0.0078,0.537128 -0.446283,1.017531 -0.919521,1.007683 l -5.245273,0 c -0.01507,0.104484 -0.03389,0.204081 -0.05316,0.301591 l 2.630175,0 c 0.454137,-0.0096 0.872112,0.461754 0.866386,0.977186 C 13.619526,14.554106 13.206293,15.009498 12.75924,15 L 3.7753054,15 diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-message.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-message.component.ts index 082d005108..0f74a9325d 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-message.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-message.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconMessageDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`M 1 3 L 9 11 L 17 3 L 1 3 z M 1 5 L 1 13 L 5 9 L 1 5 z M 17 5 L 13 9 L 17 13 L 17 5 z M 6 10 L 1 15 + const path1 = this.paper.path(`M 1 3 L 9 11 L 17 3 L 1 3 z M 1 5 L 1 13 L 5 9 L 1 5 z M 17 5 L 13 9 L 17 13 L 17 5 z M 6 10 L 1 15 L 17 15 L 12 10 L 9 13 L 6 10 z`).attr({ 'opacity': this.fillOpacity, 'stroke': this.stroke, diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-mule.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-mule.component.ts index a5835340e8..1a9f166605 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-mule.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-mule.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconMuleDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`M 8,0 C 3.581722,0 0,3.5817 0,8 c 0,4.4183 3.581722,8 8,8 4.418278,0 8,-3.5817 8,-8 L 16,7.6562 + const path1 = this.paper.path(`M 8,0 C 3.581722,0 0,3.5817 0,8 c 0,4.4183 3.581722,8 8,8 4.418278,0 8,-3.5817 8,-8 L 16,7.6562 C 15.813571,3.3775 12.282847,0 8,0 z M 5.1875,2.7812 8,7.3437 10.8125,2.7812 c 1.323522,0.4299 2.329453,1.5645 2.8125,2.8438 1.136151,2.8609 -0.380702,6.4569 -3.25,7.5937 -0.217837,-0.6102 -0.438416,-1.2022 -0.65625,-1.8125 0.701032,-0.2274 1.313373,-0.6949 1.71875,-1.3125 0.73624,-1.2317 0.939877,-2.6305 -0.03125,-4.3125 l -2.75,4.0625 -0.65625,0 -0.65625,0 -2.75,-4 diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-receive.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-receive.component.ts index 09dde5d19b..4dab2e1151 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-receive.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-receive.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconReceiveDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`m 0.5,2.5 0,13 17,0 0,-13 z M 2,4 6.5,8.5 2,13 z M 4,4 14,4 9,9 z m 12,0 0,9 -4.5,-4.5 z + const path1 = this.paper.path(`m 0.5,2.5 0,13 17,0 0,-13 z M 2,4 6.5,8.5 2,13 z M 4,4 14,4 9,9 z m 12,0 0,9 -4.5,-4.5 z M 7.5,9.5 9,11 10.5,9.5 15,14 3,14 z`).attr({ 'stroke': this.stroke, 'fill': this.fillColors diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts index 61c8d6b45f..ee36b6129f 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-rest-call.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconRestCallDirective extends RaphaelBase implements OnInit } public draw(position: Point) { - let path1 = this.paper.path(`m 16.704699,5.9229055 q 0.358098,0 0.608767,0.2506681 0.250669,0.250668 0.250669,0.6087677 0,0.3580997 + const path1 = this.paper.path(`m 16.704699,5.9229055 q 0.358098,0 0.608767,0.2506681 0.250669,0.250668 0.250669,0.6087677 0,0.3580997 -0.250669,0.6087677 -0.250669,0.2506679 -0.608767,0.2506679 -0.358098,0 -0.608767,-0.2506679 -0.250669,-0.250668 -0.250669,-0.6087677 0,-0.3580997 0.250669,-0.6087677 0.250669,-0.2506681 0.608767,-0.2506681 z m 2.578308,-2.0053502 q -2.229162,0 -3.854034,0.6759125 -1.624871,0.6759067 -3.227361,2.2694472 -0.716197,0.725146 -1.575633,1.7457293 L diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-script.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-script.component.ts index c32cd9926d..66af5f8f02 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-script.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-script.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconScriptDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`m 5,2 0,0.094 c 0.23706,0.064 0.53189,0.1645 0.8125,0.375 0.5582,0.4186 1.05109,1.228 1.15625,2.5312 + const path1 = this.paper.path(`m 5,2 0,0.094 c 0.23706,0.064 0.53189,0.1645 0.8125,0.375 0.5582,0.4186 1.05109,1.228 1.15625,2.5312 l 8.03125,0 1,0 1,0 c 0,-3 -2,-3 -2,-3 l -10,0 z M 4,3 4,13 2,13 c 0,3 2,3 2,3 l 9,0 c 0,0 2,0 2,-3 L 15,6 6,6 6,5.5 C 6,4.1111 5.5595,3.529 5.1875,3.25 4.8155,2.971 4.5,3 4.5,3 L 4,3 z`).attr({ 'stroke': this.stroke, diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-send.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-send.component.ts index 864e1ebe38..2ab0dea316 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-send.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-send.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconSendDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`M 1 3 L 9 11 L 17 3 L 1 3 z M 1 5 L 1 13 L 5 9 L 1 5 z M 17 5 L 13 9 L 17 13 L 17 5 z M 6 10 L 1 15 + const path1 = this.paper.path(`M 1 3 L 9 11 L 17 3 L 1 3 z M 1 5 L 1 13 L 5 9 L 1 5 z M 17 5 L 13 9 L 17 13 L 17 5 z M 6 10 L 1 15 L 17 15 L 12 10 L 9 13 L 6 10 z`).attr({ 'stroke': this.stroke, 'fill': this.fillColors diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-service.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-service.component.ts index b40765ac42..1e1097ed03 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-service.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-service.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconServiceDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path('M 8,1 7.5,2.875 c 0,0 -0.02438,0.250763 -0.40625,0.4375 C 7.05724,3.330353 7.04387,3.358818 7,3.375' + + const path1 = this.paper.path('M 8,1 7.5,2.875 c 0,0 -0.02438,0.250763 -0.40625,0.4375 C 7.05724,3.330353 7.04387,3.358818 7,3.375' + ' 6.6676654,3.4929791 6.3336971,3.6092802 6.03125,3.78125 6.02349,3.78566 6.007733,3.77681 6,3.78125 5.8811373,3.761018' + ' 5.8125,3.71875 5.8125,3.71875 l -1.6875,-1 -1.40625,1.4375 0.96875,1.65625 c 0,0 0.065705,0.068637 0.09375,0.1875' + ' 0.002,0.00849 -0.00169,0.022138 0,0.03125 C 3.6092802,6.3336971 3.4929791,6.6676654 3.375,7 3.3629836,7.0338489' + diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-signal.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-signal.component.ts index e0e00ed9d6..0867ccaaf4 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-signal.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-signal.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconSignalDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`M 8.7124971,21.247342 L 23.333334,21.247342 L 16.022915,8.5759512 L 8.7124971,21.247342 z`).attr({ + const path1 = this.paper.path(`M 8.7124971,21.247342 L 23.333334,21.247342 L 16.022915,8.5759512 L 8.7124971,21.247342 z`).attr({ 'opacity': this.fillOpacity, 'stroke': this.stroke, 'strokeWidth': this.strokeWidth, diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-timer.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-timer.component.ts index 1833041dfa..f9294721f4 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-timer.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-timer.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconTimerDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`M 10 0 C 4.4771525 0 0 4.4771525 0 10 C 0 15.522847 4.4771525 20 10 20 C 15.522847 20 20 15.522847 20 + const path1 = this.paper.path(`M 10 0 C 4.4771525 0 0 4.4771525 0 10 C 0 15.522847 4.4771525 20 10 20 C 15.522847 20 20 15.522847 20 10 C 20 4.4771525 15.522847 1.1842379e-15 10 0 z M 9.09375 1.03125 C 9.2292164 1.0174926 9.362825 1.0389311 9.5 1.03125 L 9.5 3.5 L 10.5 3.5 L 10.5 1.03125 C 15.063526 1.2867831 18.713217 4.9364738 18.96875 9.5 L 16.5 9.5 L 16.5 10.5 L 18.96875 10.5 C 18.713217 15.063526 15.063526 18.713217 10.5 18.96875 L 10.5 16.5 L 9.5 16.5 L 9.5 18.96875 C 4.9364738 18.713217 1.2867831 15.063526 1.03125 diff --git a/lib/insights/diagram/components/raphael/icons/raphael-icon-user.component.ts b/lib/insights/diagram/components/raphael/icons/raphael-icon-user.component.ts index a5de18e85a..99e62c26ca 100644 --- a/lib/insights/diagram/components/raphael/icons/raphael-icon-user.component.ts +++ b/lib/insights/diagram/components/raphael/icons/raphael-icon-user.component.ts @@ -60,7 +60,7 @@ export class RaphaelIconUserDirective extends RaphaelBase implements OnInit { } public draw(position: Point) { - let path1 = this.paper.path(`m 1,17 16,0 0,-1.7778 -5.333332,-3.5555 0,-1.7778 c 1.244444,0 1.244444,-2.3111 1.244444,-2.3111 + const path1 = this.paper.path(`m 1,17 16,0 0,-1.7778 -5.333332,-3.5555 0,-1.7778 c 1.244444,0 1.244444,-2.3111 1.244444,-2.3111 l 0,-3.0222 C 12.555557,0.8221 9.0000001,1.0001 9.0000001,1.0001 c 0,0 -3.5555556,-0.178 -3.9111111,3.5555 l 0,3.0222 c 0,0 0,2.3111 1.2444443,2.3111 l 0,1.7778 L 1,15.2222 1,17 17,17`).attr({ 'opacity': 1, diff --git a/lib/insights/diagram/components/raphael/raphael-circle.component.ts b/lib/insights/diagram/components/raphael/raphael-circle.component.ts index b2e745eb7e..9b0949f539 100644 --- a/lib/insights/diagram/components/raphael/raphael-circle.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-circle.component.ts @@ -59,13 +59,13 @@ export class RaphaelCircleDirective extends RaphaelBase implements OnInit { ngOnInit() { - let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; - let drawElement = this.draw(this.center, this.radius, opts); + const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const drawElement = this.draw(this.center, this.radius, opts); drawElement.node.id = this.elementId; } public draw(center: Point, radius: number, opts: any) { - let circle = this.paper.circle(center.x, center.y, radius).attr(opts); + const circle = this.paper.circle(center.x, center.y, radius).attr(opts); return circle; } } diff --git a/lib/insights/diagram/components/raphael/raphael-cross.component.ts b/lib/insights/diagram/components/raphael/raphael-cross.component.ts index 8a7f17a1c9..83b70c2b84 100644 --- a/lib/insights/diagram/components/raphael/raphael-cross.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-cross.component.ts @@ -56,13 +56,13 @@ export class RaphaelCrossDirective extends RaphaelBase implements OnInit { ngOnInit() { - let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; this.draw(this.center, this.width, this.height, opts); } public draw(center: Point, width: number, height: number, opts?: any) { - let quarterWidth = width / 4; - let quarterHeight = height / 4; + const quarterWidth = width / 4; + const quarterHeight = height / 4; return this.paper.path( 'M' + (center.x + quarterWidth + 3) + ' ' + (center.y + quarterHeight + 3) + diff --git a/lib/insights/diagram/components/raphael/raphael-flow-arrow.component.ts b/lib/insights/diagram/components/raphael/raphael-flow-arrow.component.ts index 0d51aebdfa..2f45942a61 100644 --- a/lib/insights/diagram/components/raphael/raphael-flow-arrow.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-flow-arrow.component.ts @@ -50,30 +50,30 @@ export class RaphaelFlowArrowDirective extends RaphaelBase implements OnInit { } public draw(flow: any) { - let line = this.drawLine(flow); + const line = this.drawLine(flow); this.drawArrow(line); } public drawLine(flow: any) { - let polyline = new Polyline(flow.id, flow.waypoints, this.SEQUENCE_FLOW_STROKE, this.paper); + const polyline = new Polyline(flow.id, flow.waypoints, this.SEQUENCE_FLOW_STROKE, this.paper); polyline.element = this.paper.path(polyline.path); polyline.element.attr({'stroke-width': this.SEQUENCE_FLOW_STROKE}); polyline.element.attr({'stroke': '#585858'}); polyline.element.node.id = this.flow.id; - let lastLineIndex = polyline.getLinesCount() - 1; - let line = polyline.getLine(lastLineIndex); + const lastLineIndex = polyline.getLinesCount() - 1; + const line = polyline.getLine(lastLineIndex); return line; } public drawArrow(line: any) { - let doubleArrowWidth = 2 * this.ARROW_WIDTH; - let width = this.ARROW_WIDTH / 2 + .5; - let arrowHead: any = this.paper.path('M0 0L-' + width + '-' + doubleArrowWidth + 'L' + width + ' -' + doubleArrowWidth + 'z'); + const doubleArrowWidth = 2 * this.ARROW_WIDTH; + const width = this.ARROW_WIDTH / 2 + .5; + const arrowHead: any = this.paper.path('M0 0L-' + width + '-' + doubleArrowWidth + 'L' + width + ' -' + doubleArrowWidth + 'z'); arrowHead.transform('t' + line.x2 + ',' + line.y2); - let angle = Raphael.deg(line.angle - Math.PI / 2); + const angle = Raphael.deg(line.angle - Math.PI / 2); arrowHead.transform('...r' + angle + ' 0 0'); arrowHead.attr('fill', '#585858'); diff --git a/lib/insights/diagram/components/raphael/raphael-multiline-text.component.ts b/lib/insights/diagram/components/raphael/raphael-multiline-text.component.ts index a460e5b4e2..bc7adf08f5 100644 --- a/lib/insights/diagram/components/raphael/raphael-multiline-text.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-multiline-text.component.ts @@ -58,14 +58,14 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit } draw(position: Point, text: string) { - let textPaper = this.paper.text(position.x + this.TEXT_PADDING, position.y + this.TEXT_PADDING, text).attr({ + const textPaper = this.paper.text(position.x + this.TEXT_PADDING, position.y + this.TEXT_PADDING, text).attr({ 'text-anchor': 'middle', 'font-family': 'Arial', 'font-size': '11', 'fill': '#373e48' }); - let formattedText = this.formatText(textPaper, text, this.elementWidth); + const formattedText = this.formatText(textPaper, text, this.elementWidth); textPaper.attr({ 'text': formattedText }); @@ -74,17 +74,18 @@ export class RaphaelMultilineTextDirective extends RaphaelBase implements OnInit } private formatText(textPaper, text, elementWidth) { - let pText = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; + const pText = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; textPaper.attr({ 'text': pText }); - let letterWidth = textPaper.getBBox().width / text.length; - let removedLineBreaks = text.split('\n'); - let actualRowLength = 0, formattedText = []; + const letterWidth = textPaper.getBBox().width / text.length; + const removedLineBreaks = text.split('\n'); + let actualRowLength = 0; + const formattedText = []; removedLineBreaks.forEach((sentence) => { - let words = sentence.split(' '); + const words = sentence.split(' '); words.forEach((word) => { - let length = word.length; + const length = word.length; if (actualRowLength + (length * letterWidth) > elementWidth) { formattedText.push('\n'); actualRowLength = 0; diff --git a/lib/insights/diagram/components/raphael/raphael-pentagon.component.ts b/lib/insights/diagram/components/raphael/raphael-pentagon.component.ts index a05fb0ba64..4a2ce95f16 100644 --- a/lib/insights/diagram/components/raphael/raphael-pentagon.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-pentagon.component.ts @@ -53,7 +53,7 @@ export class RaphaelPentagonDirective extends RaphaelBase implements OnInit { ngOnInit() { - let opts = { + const opts = { 'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, diff --git a/lib/insights/diagram/components/raphael/raphael-plus.component.ts b/lib/insights/diagram/components/raphael/raphael-plus.component.ts index b1f4ff93fd..8569f3a49c 100644 --- a/lib/insights/diagram/components/raphael/raphael-plus.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-plus.component.ts @@ -49,12 +49,12 @@ export class RaphaelPlusDirective extends RaphaelBase implements OnInit { } ngOnInit() { - let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; this.draw(this.center, opts); } public draw(center: Point, opts?: any) { - let path = this.paper.path('M 6.75,16 L 25.75,16 M 16,6.75 L 16,25.75').attr(opts); + const path = this.paper.path('M 6.75,16 L 25.75,16 M 16,6.75 L 16,25.75').attr(opts); return path.transform('T' + (center.x + 4) + ',' + (center.y + 4)); } } diff --git a/lib/insights/diagram/components/raphael/raphael-rect.component.ts b/lib/insights/diagram/components/raphael/raphael-rect.component.ts index c32ebc81a6..f49676bfb0 100644 --- a/lib/insights/diagram/components/raphael/raphael-rect.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-rect.component.ts @@ -65,13 +65,13 @@ export class RaphaelRectDirective extends RaphaelBase implements OnInit { ngOnInit() { - let opts = { + const opts = { 'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity }; - let elementDraw = this.draw(this.leftCorner, this.width, this.height, this.radius, opts); + const elementDraw = this.draw(this.leftCorner, this.width, this.height, this.radius, opts); elementDraw.node.id = this.elementId; } diff --git a/lib/insights/diagram/components/raphael/raphael-rhombus.component.ts b/lib/insights/diagram/components/raphael/raphael-rhombus.component.ts index c2a790362a..51582e9208 100644 --- a/lib/insights/diagram/components/raphael/raphael-rhombus.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-rhombus.component.ts @@ -59,8 +59,8 @@ export class RaphaelRhombusDirective extends RaphaelBase implements OnInit { ngOnInit() { - let opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; - let elementDraw = this.draw(this.center, this.width, this.height, opts); + const opts = {'stroke-width': this.strokeWidth, 'fill': this.fillColors, 'stroke': this.stroke, 'fill-opacity': this.fillOpacity}; + const elementDraw = this.draw(this.center, this.width, this.height, opts); elementDraw.node.id = this.elementId; } diff --git a/lib/insights/diagram/components/raphael/raphael-text.component.ts b/lib/insights/diagram/components/raphael/raphael-text.component.ts index 01de6e6bc1..ef707480cb 100644 --- a/lib/insights/diagram/components/raphael/raphael-text.component.ts +++ b/lib/insights/diagram/components/raphael/raphael-text.component.ts @@ -54,7 +54,7 @@ export class RaphaelTextDirective extends RaphaelBase implements OnInit { } public draw(position: Point, text: string) { - let textPaper = this.paper.text(position.x, position.y, text).attr({ + const textPaper = this.paper.text(position.x, position.y, text).attr({ 'text-anchor' : 'middle', 'font-family' : 'Arial', 'font-size' : '11', diff --git a/lib/insights/diagram/components/raphael/raphael.service.ts b/lib/insights/diagram/components/raphael/raphael.service.ts index a37a8aae13..6c0fb9ab03 100644 --- a/lib/insights/diagram/components/raphael/raphael.service.ts +++ b/lib/insights/diagram/components/raphael/raphael.service.ts @@ -47,7 +47,7 @@ export class RaphaelService implements OnDestroy { if (typeof Raphael === 'undefined') { throw new Error('insights configuration issue: Embedding Chart.js lib is mandatory'); } - let paper = new Raphael(ctx, this.width, this.height); + const paper = new Raphael(ctx, this.width, this.height); return paper; } diff --git a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts index 0f45628d80..7a18134ff4 100644 --- a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts +++ b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.spec.ts @@ -59,7 +59,7 @@ describe('DiagramTooltipComponent', () => { }); it('should render with type and name if name is defined', () => { - let tooltipHeader = fixture.debugElement.query(By.css('.adf-diagram-tooltip-header')); + const tooltipHeader = fixture.debugElement.query(By.css('.adf-diagram-tooltip-header')); expect(tooltipHeader.nativeElement.innerText).toBe('awesome-diagram-element diagram-element-name'); }); @@ -68,13 +68,13 @@ describe('DiagramTooltipComponent', () => { data.name = ''; fixture.detectChanges(); - let tooltipHeader = fixture.debugElement.query(By.css('.adf-diagram-tooltip-header')); + const tooltipHeader = fixture.debugElement.query(By.css('.adf-diagram-tooltip-header')); expect(tooltipHeader.nativeElement.innerText).toBe('awesome-diagram-element diagram-element-id'); }); it('should render the name if name is defined in the tooltip body', () => { - let nameProperty = fixture.debugElement.query(By.css('.adf-diagram-name-property')); + const nameProperty = fixture.debugElement.query(By.css('.adf-diagram-name-property')); expect(nameProperty).not.toBeNull(); expect(nameProperty.nativeElement.innerText).toBe('Name:diagram-element-name'); @@ -84,7 +84,7 @@ describe('DiagramTooltipComponent', () => { data.name = ''; fixture.detectChanges(); - let nameProperty = fixture.debugElement.query(By.css('.adf-diagram-name-property')); + const nameProperty = fixture.debugElement.query(By.css('.adf-diagram-name-property')); expect(nameProperty).toBeNull(); }); @@ -96,7 +96,7 @@ describe('DiagramTooltipComponent', () => { ]; fixture.detectChanges(); - let propertyNames = fixture.debugElement.queryAll(By.css('.adf-diagram-general-property > .adf-diagram-propertyName')), + const propertyNames = fixture.debugElement.queryAll(By.css('.adf-diagram-general-property > .adf-diagram-propertyName')), propertyValues = fixture.debugElement.queryAll(By.css('.adf-diagram-general-property > .adf-diagram-propertyValue')); expect(propertyNames.length).toBe(2); @@ -113,7 +113,7 @@ describe('DiagramTooltipComponent', () => { fixture.detectChanges(); - let propertyValue = fixture.debugElement.queryAll(By.css('.adf-diagram-heat-value > .adf-diagram-value')), + const propertyValue = fixture.debugElement.queryAll(By.css('.adf-diagram-heat-value > .adf-diagram-value')), propertyValueType = fixture.debugElement.queryAll(By.css('.adf-diagram-heat-value > .adf-diagram-valuetype')); expect(propertyValue.length).toBe(1); @@ -150,7 +150,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseenter')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); + const tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).not.toBeNull(); }); @@ -159,7 +159,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('touchend')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); + const tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).not.toBeNull(); }); @@ -169,7 +169,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseenter')); tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseleave')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); + const tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).toBeNull(); }); @@ -179,7 +179,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('mouseenter')); window.dispatchEvent(new CustomEvent('scroll')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); + const tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).toBeNull(); }); @@ -189,7 +189,7 @@ describe('DiagramTooltipComponent', () => { tooltipTarget.nativeElement.dispatchEvent(new MouseEvent('touchend')); window.dispatchEvent(new CustomEvent('touchstart')); - let tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); + const tooltip = fixture.debugElement.query(By.css('.adf-diagram-tooltip.adf-is-active')); expect(tooltip).toBeNull(); }); }); diff --git a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts index c616ce05f1..a8d0ac3d7d 100644 --- a/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts +++ b/lib/insights/diagram/components/tooltip/diagram-tooltip.component.ts @@ -106,9 +106,9 @@ export class DiagramTooltipComponent implements AfterViewInit, OnDestroy { props = { top: (event.pageY - 150), left: event.pageX, width: event.layerX, height: 50 }; } - let top = props.top + (props.height / 2); - let marginLeft = -1 * (this.tooltipElement.offsetWidth / 2); - let marginTop = -1 * (this.tooltipElement.offsetHeight / 2); + const top = props.top + (props.height / 2); + const marginLeft = -1 * (this.tooltipElement.offsetWidth / 2); + const marginTop = -1 * (this.tooltipElement.offsetHeight / 2); let left = props.left + (props.width / 2); if (this.position === POSITION.LEFT || this.position === POSITION.RIGHT) { diff --git a/lib/insights/diagram/models/chart/barChart.model.ts b/lib/insights/diagram/models/chart/barChart.model.ts index 7e39d43d30..f239a82821 100644 --- a/lib/insights/diagram/models/chart/barChart.model.ts +++ b/lib/insights/diagram/models/chart/barChart.model.ts @@ -53,7 +53,7 @@ export class BarChart extends Chart { this.options.scales.yAxes[0].ticks.callback = this.yAxisTickFormatFunction(this.yAxisType); if (obj.values) { obj.values.forEach((params: any) => { - let dataValue = []; + const dataValue = []; params.values.forEach((info: any) => { info.forEach((value: any, index: any) => { if (index % 2 === 0) { @@ -91,7 +91,7 @@ export class BarChart extends Chart { return function (value) { if (yAxisType !== null && yAxisType !== undefined) { if ('count' === yAxisType) { - let label = '' + value; + const label = '' + value; if (label.indexOf('.') !== -1) { return ''; } diff --git a/lib/insights/diagram/models/report/reportDefinition.model.ts b/lib/insights/diagram/models/report/reportDefinition.model.ts index c9c5e3321e..982f788eab 100644 --- a/lib/insights/diagram/models/report/reportDefinition.model.ts +++ b/lib/insights/diagram/models/report/reportDefinition.model.ts @@ -22,7 +22,7 @@ export class ReportDefinitionModel { constructor(obj?: any) { obj.parameters.forEach((params: any) => { - let reportParamsModel = new ReportParameterDetailsModel(params); + const reportParamsModel = new ReportParameterDetailsModel(params); this.parameters.push(reportParamsModel); }); } diff --git a/lib/insights/diagram/services/diagram-color.service.ts b/lib/insights/diagram/services/diagram-color.service.ts index 329301ec6e..ea25f4171c 100644 --- a/lib/insights/diagram/services/diagram-color.service.ts +++ b/lib/insights/diagram/services/diagram-color.service.ts @@ -46,7 +46,7 @@ export class DiagramColorService { getFillColour(key: string) { if (this.totalColors && this.totalColors.hasOwnProperty(key)) { - let colorPercentage = this.totalColors[key]; + const colorPercentage = this.totalColors[key]; return this.convertColorToHsb(colorPercentage); } else { return DiagramColorService.ACTIVITY_FILL_COLOR; @@ -72,7 +72,7 @@ export class DiagramColorService { } convertColorToHsb(colorPercentage: number): string { - let hue = (120.0 - (colorPercentage * 1.2)) / 360.0; + const hue = (120.0 - (colorPercentage * 1.2)) / 360.0; return 'hsb(' + hue + ', 1, 1)'; } } diff --git a/lib/insights/diagram/services/diagrams.service.spec.ts b/lib/insights/diagram/services/diagrams.service.spec.ts index abac5cda72..6520b89695 100644 --- a/lib/insights/diagram/services/diagrams.service.spec.ts +++ b/lib/insights/diagram/services/diagrams.service.spec.ts @@ -31,7 +31,7 @@ describe('DiagramsService', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.ecmHost = 'http://localhost:9876/ecm'; service = TestBed.get(DiagramsService); diff --git a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts index d6a2cf18a0..eccbf58420 100644 --- a/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/group/components/group-cloud.component.spec.ts @@ -73,7 +73,7 @@ describe('GroupCloudComponent', () => { it('should show the groups if the typed result match', async(() => { fixture.detectChanges(); component.searchGroups$ = of(<GroupModel[]> mockGroups); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.dispatchEvent(new Event('input')); inputHTMLElement.dispatchEvent(new Event('keyup')); @@ -88,7 +88,7 @@ describe('GroupCloudComponent', () => { it('should hide result list if input is empty', async(() => { fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = ''; inputHTMLElement.dispatchEvent(new Event('keyup')); @@ -102,7 +102,7 @@ describe('GroupCloudComponent', () => { it('should emit selectedGroup if option is valid', async(() => { fixture.detectChanges(); - let selectEmitSpy = spyOn(component.selectGroup, 'emit'); + const selectEmitSpy = spyOn(component.selectGroup, 'emit'); component.onSelect(new GroupModel({ name: 'group name'})); fixture.whenStable().then(() => { expect(selectEmitSpy).toHaveBeenCalled(); @@ -186,7 +186,7 @@ describe('GroupCloudComponent', () => { })); it('should emit removeGroup when a selected group is removed if mode=multiple', async(() => { - let removeGroupSpy = spyOn(component.removeGroup, 'emit'); + const removeGroupSpy = spyOn(component.removeGroup, 'emit'); component.mode = 'multiple'; component.preSelectGroups = <any> [{id: mockGroups[1].id}, {id: mockGroups[2].id}]; @@ -205,7 +205,7 @@ describe('GroupCloudComponent', () => { it('should list groups who have access to the app when appName is specified', async(() => { component.appName = 'sample-app'; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -222,7 +222,7 @@ describe('GroupCloudComponent', () => { component.appName = 'sample-app'; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('[data-automation-id="adf-cloud-group-search-input"]'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('[data-automation-id="adf-cloud-group-search-input"]'); inputHTMLElement.focus(); inputHTMLElement.value = 'Mock'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -238,7 +238,7 @@ describe('GroupCloudComponent', () => { checkGroupHasGivenRoleSpy.and.returnValue(of(true)); component.roles = ['mock-role-1', 'mock-role-2']; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -255,7 +255,7 @@ describe('GroupCloudComponent', () => { checkGroupHasGivenRoleSpy.and.returnValue(of(false)); component.roles = []; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -272,7 +272,7 @@ describe('GroupCloudComponent', () => { findGroupsByNameSpy.and.returnValue(of(mockGroups)); checkGroupHasAccessSpy.and.returnValue(of(true)); fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'Mock'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -285,7 +285,7 @@ describe('GroupCloudComponent', () => { it('should not validate access to the app when appName is not specified', async(() => { fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); diff --git a/lib/process-services-cloud/src/lib/group/pipe/group-initial.pipe.spec.ts b/lib/process-services-cloud/src/lib/group/pipe/group-initial.pipe.spec.ts index 601a2a2552..b33b1de4a4 100644 --- a/lib/process-services-cloud/src/lib/group/pipe/group-initial.pipe.spec.ts +++ b/lib/process-services-cloud/src/lib/group/pipe/group-initial.pipe.spec.ts @@ -30,12 +30,12 @@ describe('InitialGroupNamePipe', () => { it('should return with the group initial', () => { fakeGroup.name = 'FAKE-GROUP-NAME'; - let result = pipe.transform(fakeGroup); + const result = pipe.transform(fakeGroup); expect(result).toBe('F'); }); it('should return an empty string when group is null', () => { - let result = pipe.transform(null); + const result = pipe.transform(null); expect(result).toBe(''); }); }); diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts index 1d6a247a3f..3bfb964261 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/edit-process-filter-cloud.component.ts @@ -258,7 +258,7 @@ export class EditProcessFilterCloudComponent implements OnInit, OnChanges { onDateChanged(newDateValue: any, dateProperty: ProcessFilterProperties) { if (newDateValue) { - let momentDate = moment(newDateValue, this.DATE_FORMAT, true); + const momentDate = moment(newDateValue, this.DATE_FORMAT, true); if (momentDate.isValid()) { this.getPropertyController(dateProperty).setValue(momentDate.toDate()); diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.spec.ts index 89e03e933d..e3a52898fb 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filter-dialog-cloud.component.spec.ts @@ -63,7 +63,7 @@ describe('ProcessFilterDialogCloudComponent', () => { it('should display title', () => { fixture.detectChanges(); - let titleElement = fixture.debugElement.nativeElement.querySelector( + const titleElement = fixture.debugElement.nativeElement.querySelector( '#adf-process-filter-dialog-title' ); expect(titleElement.textContent).toEqual(' ADF_CLOUD_EDIT_PROCESS_FILTER.DIALOG.TITLE '); @@ -71,7 +71,7 @@ describe('ProcessFilterDialogCloudComponent', () => { it('should enable save button if form is valid', async(() => { fixture.detectChanges(); - let saveButton = fixture.debugElement.nativeElement.querySelector( + const saveButton = fixture.debugElement.nativeElement.querySelector( '#adf-save-button-id' ); const inputElement = fixture.debugElement.nativeElement.querySelector( @@ -94,7 +94,7 @@ describe('ProcessFilterDialogCloudComponent', () => { inputElement.value = ''; inputElement.dispatchEvent(new Event('input')); fixture.whenStable().then(() => { - let saveButton = fixture.debugElement.nativeElement.querySelector( + const saveButton = fixture.debugElement.nativeElement.querySelector( '#adf-save-button-id' ); fixture.detectChanges(); @@ -111,7 +111,7 @@ describe('ProcessFilterDialogCloudComponent', () => { inputElement.value = 'My custom Name'; inputElement.dispatchEvent(new Event('input')); fixture.whenStable().then(() => { - let saveButton = fixture.debugElement.nativeElement.querySelector( + const saveButton = fixture.debugElement.nativeElement.querySelector( '#adf-save-button-id' ); fixture.detectChanges(); @@ -124,7 +124,7 @@ describe('ProcessFilterDialogCloudComponent', () => { it('should able close dialog on click of cancel button', () => { component.data = { data: { name: '' } }; - let cancelButton = fixture.debugElement.nativeElement.querySelector( + const cancelButton = fixture.debugElement.nativeElement.querySelector( '#adf-cancel-button-id' ); fixture.detectChanges(); diff --git a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.spec.ts index 596be8c1a9..249f2dff48 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/components/process-filters-cloud.component.spec.ts @@ -31,7 +31,7 @@ describe('ProcessFiltersCloudComponent', () => { let processFilterService: ProcessFilterCloudService; - let fakeGlobalFilter = [ + const fakeGlobalFilter = [ new ProcessFilterCloudModel({ name: 'FakeAllProcesses', icon: 'adjust', @@ -54,21 +54,21 @@ describe('ProcessFiltersCloudComponent', () => { }) ]; - let fakeGlobalFilterObservable = + const fakeGlobalFilterObservable = new Observable(function(observer) { observer.next(fakeGlobalFilter); observer.complete(); }); - let fakeGlobalFilterPromise = new Promise(function (resolve, reject) { + const fakeGlobalFilterPromise = new Promise(function (resolve, reject) { resolve(fakeGlobalFilter); }); - let mockErrorFilterList = { + const mockErrorFilterList = { error: 'wrong request' }; - let mockErrorFilterPromise = Promise.reject(mockErrorFilterList); + const mockErrorFilterPromise = Promise.reject(mockErrorFilterList); let component: ProcessFiltersCloudComponent; let fixture: ComponentFixture<ProcessFiltersCloudComponent>; @@ -87,14 +87,14 @@ describe('ProcessFiltersCloudComponent', () => { it('should attach specific icon for each filter if hasIcon is true', async(() => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(fakeGlobalFilterObservable); - let change = new SimpleChange(undefined, 'my-app-1', true); + const change = new SimpleChange(undefined, 'my-app-1', true); component.ngOnChanges({'appName': change}); fixture.detectChanges(); component.showIcons = true; fixture.whenStable().then(() => { fixture.detectChanges(); expect(component.filters.length).toBe(3); - let filters = fixture.nativeElement.querySelectorAll('.adf-filters__entry-icon'); + const filters = fixture.nativeElement.querySelectorAll('.adf-filters__entry-icon'); expect(filters.length).toBe(3); expect(filters[0].innerText).toContain('adjust'); expect(filters[1].innerText).toContain('inbox'); @@ -106,13 +106,13 @@ describe('ProcessFiltersCloudComponent', () => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); component.showIcons = false; - let change = new SimpleChange(undefined, 'my-app-1', true); + const change = new SimpleChange(undefined, 'my-app-1', true); component.ngOnChanges({'appName': change}); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); + const filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); expect(filters.length).toBe(0); done(); }); @@ -120,13 +120,13 @@ describe('ProcessFiltersCloudComponent', () => { it('should display the filters', async(() => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(fakeGlobalFilterObservable); - let change = new SimpleChange(undefined, 'my-app-1', true); + const change = new SimpleChange(undefined, 'my-app-1', true); component.ngOnChanges({'appName': change}); fixture.detectChanges(); component.showIcons = true; fixture.whenStable().then(() => { fixture.detectChanges(); - let filters = fixture.debugElement.queryAll(By.css('mat-list-item[class*="adf-filters__entry"]')); + const filters = fixture.debugElement.queryAll(By.css('mat-list-item[class*="adf-filters__entry"]')); expect(component.filters.length).toBe(3); expect(filters.length).toBe(3); expect(filters[0].nativeElement.innerText).toContain('FakeAllProcesses'); @@ -139,7 +139,7 @@ describe('ProcessFiltersCloudComponent', () => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(mockErrorFilterPromise)); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({'appName': change}); component.error.subscribe((err) => { @@ -151,7 +151,7 @@ describe('ProcessFiltersCloudComponent', () => { it('should emit success with the filters when filters are loaded', (done) => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); component.success.subscribe((res) => { @@ -168,7 +168,7 @@ describe('ProcessFiltersCloudComponent', () => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(fakeGlobalFilterObservable); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.ngOnChanges({ 'appName': change }); @@ -186,7 +186,7 @@ describe('ProcessFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ name: 'FakeRunningProcesses' }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.filterClick.subscribe((res) => { expect(res).toBeDefined(); @@ -205,7 +205,7 @@ describe('ProcessFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ key: 'completed-processes' }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); @@ -226,7 +226,7 @@ describe('ProcessFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ name: 'UnexistableFilter' }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); @@ -247,7 +247,7 @@ describe('ProcessFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ index: 2 }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.filterClick.subscribe((res) => { @@ -267,7 +267,7 @@ describe('ProcessFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ id: '12' }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.filterClick.subscribe((res) => { @@ -286,7 +286,7 @@ describe('ProcessFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ id: '10' }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); fixture.detectChanges(); @@ -297,7 +297,7 @@ describe('ProcessFiltersCloudComponent', () => { done(); }); - let filterButton = fixture.debugElement.nativeElement.querySelector('span[data-automation-id="FakeRunningProcesses_filter"]'); + const filterButton = fixture.debugElement.nativeElement.querySelector('span[data-automation-id="FakeRunningProcesses_filter"]'); filterButton.click(); }); @@ -305,7 +305,7 @@ describe('ProcessFiltersCloudComponent', () => { spyOn(component, 'getFilters').and.stub(); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); expect(component.getFilters).toHaveBeenCalledWith(appName); @@ -315,7 +315,7 @@ describe('ProcessFiltersCloudComponent', () => { spyOn(component, 'getFilters').and.stub(); const appName = null; - let change = new SimpleChange(undefined, appName, true); + const change = new SimpleChange(undefined, appName, true); component.ngOnChanges({ 'appName': change }); expect(component.getFilters).not.toHaveBeenCalledWith(appName); @@ -337,14 +337,14 @@ describe('ProcessFiltersCloudComponent', () => { spyOn(component, 'getFilters').and.stub(); const appName = 'fake-app-name'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); expect(component.getFilters).toHaveBeenCalledWith(appName); }); it('should return the current filter after one is selected', () => { - let filter = fakeGlobalFilter[1]; + const filter = fakeGlobalFilter[1]; component.filters = fakeGlobalFilter; expect(component.currentFilter).toBeUndefined(); diff --git a/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts index 6d4894fa1e..c74d578214 100644 --- a/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-filters/services/process-filter-cloud.service.ts @@ -103,8 +103,8 @@ export class ProcessFilterCloudService { const user: IdentityUserModel = this.identityUserService.getCurrentUserInfo(); const key = `process-filters-${filter.appName}-${user.username}`; if (key) { - let filters = JSON.parse(this.storage.getItem(key) || '[]'); - let itemIndex = filters.findIndex((flt: ProcessFilterCloudModel) => flt.id === filter.id); + const filters = JSON.parse(this.storage.getItem(key) || '[]'); + const itemIndex = filters.findIndex((flt: ProcessFilterCloudModel) => flt.id === filter.id); filters[itemIndex] = filter; this.storage.setItem(key, JSON.stringify(filters)); this.addFiltersToStream(filters); diff --git a/lib/process-services-cloud/src/lib/process/process-header/services/process-header-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-header/services/process-header-cloud.service.ts index 3e5551ee2e..92c58f4c18 100644 --- a/lib/process-services-cloud/src/lib/process/process-header/services/process-header-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-header/services/process-header-cloud.service.ts @@ -45,7 +45,7 @@ export class ProcessHeaderCloudService { getProcessInstanceById(appName: string, processInstanceId: string): Observable<ProcessInstanceCloud> { if (appName && processInstanceId) { - let queryUrl = `${this.contextRoot}/${appName}-query/v1/process-instances/${processInstanceId}`; + const queryUrl = `${this.contextRoot}/${appName}-query/v1/process-instances/${processInstanceId}`; return from(this.alfrescoApiService.getInstance() .oauth2Auth.callCustomApi(queryUrl, 'GET', null, null, null, diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts index d3ee8c3b38..095538c05f 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.spec.ts @@ -124,7 +124,7 @@ describe('ProcessListCloudComponent', () => { it('should return the results if an application name is given', (done) => { spyOn(processListCloudService, 'getProcessByRequest').and.returnValue(of(fakeProcessCloudList)); - let appName = new SimpleChange(null, 'FAKE-APP-NAME', true); + const appName = new SimpleChange(null, 'FAKE-APP-NAME', true); component.success.subscribe((res) => { expect(res).toBeDefined(); expect(component.rows).toBeDefined(); @@ -164,12 +164,12 @@ describe('ProcessListCloudComponent', () => { }); it('should emit row click event', (done) => { - let row = new ObjectDataRow({ + const row = new ObjectDataRow({ entry: { id: '999' } }); - let rowEvent = new DataRowEvent(row, null); + const rowEvent = new DataRowEvent(row, null); component.rowClick.subscribe((taskId) => { expect(taskId).toEqual('999'); expect(component.getCurrentId()).toEqual('999'); diff --git a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts index 7ac2a3c7c6..84139f196e 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/components/process-list-cloud.component.ts @@ -178,7 +178,7 @@ export class ProcessListCloudComponent extends DataTableSchema implements OnChan } private isPropertyChanged(changes: SimpleChanges): boolean { - for (let property in changes) { + for (const property in changes) { if (changes.hasOwnProperty(property)) { if (changes[property] && (changes[property].currentValue !== changes[property].previousValue)) { @@ -224,7 +224,7 @@ export class ProcessListCloudComponent extends DataTableSchema implements OnChan } private createRequestNode(): ProcessQueryCloudRequestModel { - let requestNode = { + const requestNode = { appName: this.appName, maxItems: this.size, skipCount: this.skipCount, diff --git a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts index f36d921db0..44ea2629ee 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.spec.ts @@ -69,7 +69,7 @@ describe('Activiti ProcessList Cloud Service', () => { })); it('should return the processes', (done) => { - let processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: 'fakeName' }; + const processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: 'fakeName' }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returFakeProcessListResults); service.getProcessByRequest(processRequest).subscribe((res) => { expect(res).toBeDefined(); @@ -83,7 +83,7 @@ describe('Activiti ProcessList Cloud Service', () => { }); it('should append to the call all the parameters', (done) => { - let processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; + const processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnCallQueryParameters); service.getProcessByRequest(processRequest).subscribe((res) => { expect(res).toBeDefined(); @@ -96,7 +96,7 @@ describe('Activiti ProcessList Cloud Service', () => { }); it('should concat the app name to the request url', (done) => { - let processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; + const processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnCallUrl); service.getProcessByRequest(processRequest).subscribe((requestUrl) => { expect(requestUrl).toBeDefined(); @@ -107,7 +107,7 @@ describe('Activiti ProcessList Cloud Service', () => { }); it('should concat the sorting to append as parameters', (done) => { - let processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { + const processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service', sorting: [{ orderBy: 'NAME', direction: 'DESC' }, { orderBy: 'TITLE', direction: 'ASC' }] }; @@ -121,7 +121,7 @@ describe('Activiti ProcessList Cloud Service', () => { }); it('should return an error when app name is not specified', (done) => { - let processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: null }; + const processRequest: ProcessQueryCloudRequestModel = <ProcessQueryCloudRequestModel> { appName: null }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnCallUrl); service.getProcessByRequest(processRequest).subscribe( () => { }, diff --git a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts index 18df369fb3..ff4ccdda26 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts @@ -37,9 +37,9 @@ export class ProcessListCloudService { */ getProcessByRequest(requestNode: ProcessQueryCloudRequestModel): Observable<any> { if (requestNode.appName) { - let queryUrl = this.buildQueryUrl(requestNode); - let queryParams = this.buildQueryParams(requestNode); - let sortingParams = this.buildSortingParam(requestNode.sorting); + const queryUrl = this.buildQueryUrl(requestNode); + const queryParams = this.buildQueryParams(requestNode); + const sortingParams = this.buildSortingParam(requestNode.sorting); if (sortingParams) { queryParams['sort'] = sortingParams; } @@ -63,8 +63,8 @@ export class ProcessListCloudService { } private buildQueryParams(requestNode: ProcessQueryCloudRequestModel) { - let queryParam = {}; - for (let property in requestNode) { + const queryParam = {}; + for (const property in requestNode) { if (requestNode.hasOwnProperty(property) && !this.isExcludedField(property) && this.isPropertyValueValid(requestNode, property)) { @@ -81,7 +81,7 @@ export class ProcessListCloudService { private buildSortingParam(sortings: ProcessListCloudSortingModel[]): string { let finalSorting: string = ''; if (sortings) { - for (let sort of sortings) { + for (const sort of sortings) { if (!finalSorting) { finalSorting = `${sort.orderBy},${sort.direction}`; } else { diff --git a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts index f3bea343a8..af61c75319 100755 --- a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.spec.ts @@ -80,7 +80,7 @@ describe('StartProcessCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let startBtn = fixture.nativeElement.querySelector('#button-start'); + const startBtn = fixture.nativeElement.querySelector('#button-start'); expect(startBtn.disabled).toBe(false); }); })); @@ -91,7 +91,7 @@ describe('StartProcessCloudComponent', () => { component.processForm.controls['processDefinition'].setValue(fakeProcessInstance.name); fixture.detectChanges(); fixture.whenStable().then(() => { - let startBtn = fixture.nativeElement.querySelector('#button-start'); + const startBtn = fixture.nativeElement.querySelector('#button-start'); expect(startBtn.disabled).toBe(true); }); })); @@ -100,7 +100,7 @@ describe('StartProcessCloudComponent', () => { component.processPayloadCloud.processDefinitionKey = null; fixture.detectChanges(); fixture.whenStable().then(() => { - let startBtn = fixture.nativeElement.querySelector('#button-start'); + const startBtn = fixture.nativeElement.querySelector('#button-start'); expect(startBtn.disabled).toBe(true); }); })); @@ -113,7 +113,7 @@ describe('StartProcessCloudComponent', () => { component.name = 'My new process'; component.appName = 'myApp'; fixture.detectChanges(); - let change = new SimpleChange(null, 'MyApp', true); + const change = new SimpleChange(null, 'MyApp', true); component.ngOnChanges({ 'appName': change }); fixture.detectChanges(); }); @@ -126,7 +126,7 @@ describe('StartProcessCloudComponent', () => { it('should display the correct number of processes in the select list', () => { fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('mat-select'); + const selectElement = fixture.nativeElement.querySelector('mat-select'); expect(selectElement.children.length).toBe(1); }); }); @@ -135,8 +135,8 @@ describe('StartProcessCloudComponent', () => { component.processDefinitionList = fakeProcessDefinitions; fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger'); - let optionElement = fixture.nativeElement.querySelectorAll('mat-option'); + const selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger'); + const optionElement = fixture.nativeElement.querySelectorAll('mat-option'); selectElement.click(); expect(selectElement).not.toBeNull(); expect(selectElement).toBeDefined(); @@ -147,19 +147,19 @@ describe('StartProcessCloudComponent', () => { it('should indicate an error to the user if process defs cannot be loaded', async(() => { getDefinitionsSpy = getDefinitionsSpy.and.returnValue(throwError({})); - let change = new SimpleChange('myApp', 'myApp1', true); + const change = new SimpleChange('myApp', 'myApp1', true); component.ngOnChanges({ appName: change }); fixture.detectChanges(); fixture.whenStable().then(() => { - let errorEl = fixture.nativeElement.querySelector('#error-message'); + const errorEl = fixture.nativeElement.querySelector('#error-message'); expect(errorEl.innerText.trim()).toBe('ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.LOAD_PROCESS_DEFS'); }); })); it('should show no process available message when no process definition is loaded', async(() => { getDefinitionsSpy = getDefinitionsSpy.and.returnValue(of([])); - let change = new SimpleChange('myApp', 'myApp1', true); + const change = new SimpleChange('myApp', 'myApp1', true); component.ngOnChanges({ appName: change }); fixture.detectChanges(); @@ -182,7 +182,7 @@ describe('StartProcessCloudComponent', () => { it('should select automatically the processDefinition if the app contain only one', async(() => { getDefinitionsSpy = getDefinitionsSpy.and.returnValue(of([fakeProcessDefinitions[0]])); - let change = new SimpleChange('myApp', 'myApp1', true); + const change = new SimpleChange('myApp', 'myApp1', true); component.ngOnChanges({ appName: change }); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -210,7 +210,7 @@ describe('StartProcessCloudComponent', () => { component.ngOnChanges({}); fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); + const selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); expect(selectElement).toBeNull(); }); })); @@ -224,7 +224,7 @@ describe('StartProcessCloudComponent', () => { component.ngOnChanges({}); fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); + const selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); expect(selectElement).not.toBeNull(); }); })); @@ -237,7 +237,7 @@ describe('StartProcessCloudComponent', () => { component.ngOnChanges({}); fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); + const selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); expect(selectElement).not.toBeNull(); }); })); @@ -246,7 +246,7 @@ describe('StartProcessCloudComponent', () => { describe('input changes', () => { - let change = new SimpleChange('myApp', 'myApp1', true); + const change = new SimpleChange('myApp', 'myApp1', true); beforeEach(async(() => { component.appName = 'myApp'; @@ -294,7 +294,7 @@ describe('StartProcessCloudComponent', () => { component.processForm.controls['processInstanceName'].setValue(''); component.processForm.controls['processDefinition'].setValue(''); fixture.whenStable().then(() => { - let startProcessButton = fixture.debugElement.query(By.css('[data-automation-id="btn-start"]')); + const startProcessButton = fixture.debugElement.query(By.css('[data-automation-id="btn-start"]')); expect(startProcessButton.nativeElement.disabled).toBeTruthy(); }); })); @@ -308,7 +308,7 @@ describe('StartProcessCloudComponent', () => { })); it('should call service to start process with the variables setted', async(() => { - let inputProcessVariable: Map<string, object>[] = []; + const inputProcessVariable: Map<string, object>[] = []; inputProcessVariable['name'] = {value: 'Josh'}; component.variables = inputProcessVariable; @@ -321,7 +321,7 @@ describe('StartProcessCloudComponent', () => { })); it('should output start event when process started successfully', async(() => { - let emitSpy = spyOn(component.success, 'emit'); + const emitSpy = spyOn(component.success, 'emit'); component.processPayloadCloud = fakeProcessPayload; component.startProcess(); fixture.whenStable().then(() => { @@ -330,8 +330,8 @@ describe('StartProcessCloudComponent', () => { })); it('should throw error event when process cannot be started', async(() => { - let errorSpy = spyOn(component.error, 'emit'); - let error = { message: 'My error' }; + const errorSpy = spyOn(component.error, 'emit'); + const error = { message: 'My error' }; startProcessSpy = startProcessSpy.and.returnValue(throwError(error)); component.processPayloadCloud = fakeProcessPayload; component.startProcess(); @@ -342,19 +342,19 @@ describe('StartProcessCloudComponent', () => { it('should indicate an error to the user if process cannot be started', async(() => { getDefinitionsSpy.and.returnValue(of(fakeProcessDefinitions)); - let change = new SimpleChange('myApp', 'myApp1', true); + const change = new SimpleChange('myApp', 'myApp1', true); component.ngOnChanges({ appName: change }); startProcessSpy = startProcessSpy.and.returnValue(throwError({})); component.startProcess(); fixture.detectChanges(); fixture.whenStable().then(() => { - let errorEl = fixture.nativeElement.querySelector('#error-message'); + const errorEl = fixture.nativeElement.querySelector('#error-message'); expect(errorEl.innerText.trim()).toBe('ADF_CLOUD_PROCESS_LIST.ADF_CLOUD_START_PROCESS.ERROR.START'); }); })); it('should emit start event when start select a process and add a name', (done) => { - let disposableStart = component.success.subscribe(() => { + const disposableStart = component.success.subscribe(() => { disposableStart.unsubscribe(); done(); }); @@ -369,7 +369,7 @@ describe('StartProcessCloudComponent', () => { component.processForm.controls['processInstanceName'].setValue('My Process 1'); component.processForm.controls['processDefinition'].setValue('NewProcess 1'); - let disposableStart = component.success.subscribe(() => { + const disposableStart = component.success.subscribe(() => { disposableStart.unsubscribe(); done(); }); @@ -381,7 +381,7 @@ describe('StartProcessCloudComponent', () => { component.maxNameLength = 2; component.ngOnInit(); fixture.detectChanges(); - let processInstanceName = component.processForm.controls['processInstanceName']; + const processInstanceName = component.processForm.controls['processInstanceName']; processInstanceName.setValue('task'); fixture.detectChanges(); expect(processInstanceName.valid).toBeFalsy(); @@ -392,7 +392,7 @@ describe('StartProcessCloudComponent', () => { it('should emit error when process name field is empty', () => { fixture.detectChanges(); - let processInstanceName = component.processForm.controls['processInstanceName']; + const processInstanceName = component.processForm.controls['processInstanceName']; processInstanceName.setValue(''); fixture.detectChanges(); expect(processInstanceName.valid).toBeFalsy(); diff --git a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts index c00726ecce..9814ad4f66 100755 --- a/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/start-process/components/start-process-cloud.component.ts @@ -140,7 +140,7 @@ export class StartProcessCloudComponent implements OnChanges, OnInit { } private selectDefaultProcessDefinition() { - let selectedProcess = this.getProcessDefinitionByName(this.processDefinitionName); + const selectedProcess = this.getProcessDefinitionByName(this.processDefinitionName); if (selectedProcess) { this.processForm.controls['processDefinition'].setValue(selectedProcess.name); this.processPayloadCloud.processDefinitionKey = selectedProcess.key; diff --git a/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts b/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts index f58ed199f4..9a664b5307 100755 --- a/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/start-process/services/start-process-cloud.service.ts @@ -47,7 +47,7 @@ export class StartProcessCloudService { getProcessDefinitions(appName: string): Observable<ProcessDefinitionCloud[]> { if (appName) { - let queryUrl = `${this.contextRoot}/${appName}-rb/v1/process-definitions`; + const queryUrl = `${this.contextRoot}/${appName}-rb/v1/process-definitions`; return from(this.alfrescoApiService.getInstance() .oauth2Auth.callCustomApi(queryUrl, 'GET', @@ -75,7 +75,7 @@ export class StartProcessCloudService { */ startProcess(appName: string, requestPayload: ProcessPayloadCloud): Observable<ProcessInstanceCloud> { - let queryUrl = `${this.contextRoot}/${appName}-rb/v1/process-instances`; + const queryUrl = `${this.contextRoot}/${appName}-rb/v1/process-instances`; return from(this.alfrescoApiService.getInstance() .oauth2Auth.callCustomApi(queryUrl, 'POST', diff --git a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts index c353cb0d3f..42af23d8ce 100644 --- a/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/services/task-cloud.service.ts @@ -103,7 +103,7 @@ export class TaskCloudService { claimTask(appName: string, taskId: string, assignee: string): Observable<TaskDetailsCloudModel> { if (appName && taskId) { - let queryUrl = `${this.contextRoot}/${appName}-rb/v1/tasks/${taskId}/claim?assignee=${assignee}`; + const queryUrl = `${this.contextRoot}/${appName}-rb/v1/tasks/${taskId}/claim?assignee=${assignee}`; return from(this.apiService.getInstance() .oauth2Auth.callCustomApi(queryUrl, 'POST', null, null, null, @@ -131,7 +131,7 @@ export class TaskCloudService { unclaimTask(appName: string, taskId: string): Observable<TaskDetailsCloudModel> { if (appName && taskId) { - let queryUrl = `${this.contextRoot}/${appName}-rb/v1/tasks/${taskId}/release`; + const queryUrl = `${this.contextRoot}/${appName}-rb/v1/tasks/${taskId}/release`; return from(this.apiService.getInstance() .oauth2Auth.callCustomApi(queryUrl, 'POST', null, null, null, @@ -159,7 +159,7 @@ export class TaskCloudService { getTaskById(appName: string, taskId: string): Observable<TaskDetailsCloudModel> { if (appName && taskId) { - let queryUrl = `${this.contextRoot}/${appName}-query/v1/tasks/${taskId}`; + const queryUrl = `${this.contextRoot}/${appName}-query/v1/tasks/${taskId}`; return from(this.apiService.getInstance() .oauth2Auth.callCustomApi(queryUrl, 'GET', null, null, null, @@ -190,7 +190,7 @@ export class TaskCloudService { updatePayload.payloadType = 'UpdateTaskPayload'; - let queryUrl = `${this.contextRoot}/${appName}-rb/v1/tasks/${taskId}`; + const queryUrl = `${this.contextRoot}/${appName}-rb/v1/tasks/${taskId}`; return from(this.apiService.getInstance() .oauth2Auth.callCustomApi(queryUrl, 'PUT', null, null, null, diff --git a/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.spec.ts index 836678ba92..5b188b5c87 100644 --- a/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.spec.ts @@ -56,7 +56,7 @@ describe('PeopleCloudComponent', () => { it('should show the users if the typed result match', async(() => { component.searchUsers$ = of(<IdentityUserModel[]> mockUsers); fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.dispatchEvent(new Event('input')); inputHTMLElement.dispatchEvent(new Event('keyup')); @@ -71,7 +71,7 @@ describe('PeopleCloudComponent', () => { it('should hide result list if input is empty', async(() => { fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = ''; inputHTMLElement.dispatchEvent(new Event('keyup')); @@ -85,7 +85,7 @@ describe('PeopleCloudComponent', () => { it('should emit selectedUser if option is valid', async(() => { fixture.detectChanges(); - let selectEmitSpy = spyOn(component.selectUser, 'emit'); + const selectEmitSpy = spyOn(component.selectUser, 'emit'); component.onSelect(new IdentityUserModel({ username: 'username' })); fixture.whenStable().then(() => { expect(selectEmitSpy).toHaveBeenCalled(); @@ -174,7 +174,7 @@ describe('PeopleCloudComponent', () => { it('should emit removeUser when a selected user is removed if mode=multiple', async(() => { spyOn(identityService, 'getUsersByRolesWithCurrentUser').and.returnValue(Promise.resolve(mockUsers)); - let removeUserSpy = spyOn(component.removeUser, 'emit'); + const removeUserSpy = spyOn(component.removeUser, 'emit'); component.mode = 'multiple'; component.preSelectUsers = <any> [{ id: mockUsers[1].id }, { id: mockUsers[2].id }]; @@ -193,7 +193,7 @@ describe('PeopleCloudComponent', () => { it('should list users who have access to the app when appName is specified', async(() => { component.appName = 'sample-app'; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -210,7 +210,7 @@ describe('PeopleCloudComponent', () => { component.appName = 'sample-app'; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -226,7 +226,7 @@ describe('PeopleCloudComponent', () => { component.appName = 'sample-app'; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -239,7 +239,7 @@ describe('PeopleCloudComponent', () => { it('should not validate access to the app when appName is not specified', async(() => { fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -254,7 +254,7 @@ describe('PeopleCloudComponent', () => { const checkUserHasRoleSpy = spyOn(identityService, 'checkUserHasRole').and.returnValue(of(true)); component.roles = ['mock-role-1']; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -270,7 +270,7 @@ describe('PeopleCloudComponent', () => { component.appName = ''; component.roles = ['mock-role-10']; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -286,7 +286,7 @@ describe('PeopleCloudComponent', () => { component.appName = ''; component.roles = []; fixture.detectChanges(); - let inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); + const inputHTMLElement: HTMLInputElement = <HTMLInputElement> element.querySelector('input'); inputHTMLElement.focus(); inputHTMLElement.value = 'M'; inputHTMLElement.dispatchEvent(new Event('input')); @@ -320,7 +320,7 @@ describe('PeopleCloudComponent', () => { it('should not validate preselect values if preselectValidation flag is set to false', () => { component.mode = 'multiple'; component.preSelectUsers = <any> [{ id: mockUsers[1].id }, { id: mockUsers[2].id }]; - let change = new SimpleChange(null, 'validate', false); + const change = new SimpleChange(null, 'validate', false); component.ngOnChanges({'validate': change}); fixture.whenStable().then(() => { fixture.detectChanges(); diff --git a/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.ts b/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.ts index 5fc1b99349..8319a5e89c 100644 --- a/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/start-task/components/people-cloud/people-cloud.component.ts @@ -314,7 +314,7 @@ export class PeopleCloudComponent implements OnInit, OnChanges { } public async loadMultiplePreselectUsers() { - let users = await this.validatePreselectUsers(); + const users = await this.validatePreselectUsers(); this.checkPreselectValidationErrors(); this.preSelectUsers = [...users]; this.selectedUsersSubject.next(users); diff --git a/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.spec.ts index e033b20fb0..2c929d9c73 100644 --- a/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.spec.ts @@ -68,10 +68,10 @@ describe('StartTaskCloudComponent', () => { describe('create task', () => { it('should create new task when start button is clicked', async(() => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -81,11 +81,11 @@ describe('StartTaskCloudComponent', () => { })); it('should send on success event when the task is started', async(() => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('fakeName'); component.assigneeName = 'fake-assignee'; fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -94,10 +94,10 @@ describe('StartTaskCloudComponent', () => { })); it('should send on success event when only name is given', async(() => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -106,10 +106,10 @@ describe('StartTaskCloudComponent', () => { })); it('should not emit success event when data not present', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue(''); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(createNewTaskSpy).not.toHaveBeenCalled(); expect(successSpy).not.toHaveBeenCalled(); @@ -133,7 +133,7 @@ describe('StartTaskCloudComponent', () => { it('should assign task to the logged in user when assignee is not selected', async(() => { component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -160,14 +160,14 @@ describe('StartTaskCloudComponent', () => { it('should disable start button if name is empty', () => { component.taskForm.controls['name'].setValue(''); fixture.detectChanges(); - let createTaskButton = fixture.nativeElement.querySelector('#button-start'); + const createTaskButton = fixture.nativeElement.querySelector('#button-start'); expect(createTaskButton.disabled).toBeTruthy(); }); it('should cancel start task on cancel button click', () => { fixture.detectChanges(); - let emitSpy = spyOn(component.cancel, 'emit'); - let cancelTaskButton = fixture.nativeElement.querySelector('#button-cancel'); + const emitSpy = spyOn(component.cancel, 'emit'); + const cancelTaskButton = fixture.nativeElement.querySelector('#button-cancel'); cancelTaskButton.click(); expect(emitSpy).not.toBeNull(); expect(emitSpy).toHaveBeenCalled(); @@ -176,15 +176,15 @@ describe('StartTaskCloudComponent', () => { it('should enable start button if name is filled out', () => { component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = fixture.nativeElement.querySelector('#button-start'); + const createTaskButton = fixture.nativeElement.querySelector('#button-start'); expect(createTaskButton.disabled).toBeFalsy(); }); it('should emit error when there is an error while creating task', () => { component.taskForm.controls['name'].setValue('fakeName'); - let errorSpy = spyOn(component.error, 'emit'); + const errorSpy = spyOn(component.error, 'emit'); createNewTaskSpy.and.returnValue(throwError({})); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); fixture.detectChanges(); createTaskButton.click(); expect(errorSpy).toHaveBeenCalled(); @@ -194,7 +194,7 @@ describe('StartTaskCloudComponent', () => { component.maxNameLength = 2; component.ngOnInit(); fixture.detectChanges(); - let name = component.taskForm.controls['name']; + const name = component.taskForm.controls['name']; name.setValue('task'); fixture.detectChanges(); expect(name.valid).toBeFalsy(); @@ -205,7 +205,7 @@ describe('StartTaskCloudComponent', () => { it('should emit error when task name field is empty', () => { fixture.detectChanges(); - let name = component.taskForm.controls['name']; + const name = component.taskForm.controls['name']; name.setValue(''); fixture.detectChanges(); expect(name.valid).toBeFalsy(); @@ -215,7 +215,7 @@ describe('StartTaskCloudComponent', () => { }); it('should emit error when description have only white spaces', () => { fixture.detectChanges(); - let description = component.taskForm.controls['description']; + const description = component.taskForm.controls['description']; description.setValue(' '); fixture.detectChanges(); expect(description.valid).toBeFalsy(); diff --git a/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.ts b/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.ts index 53087ac2b3..dc16962fa0 100644 --- a/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/start-task/components/start-task-cloud.component.ts @@ -177,7 +177,7 @@ export class StartTaskCloudComponent implements OnInit, OnDestroy { this.dateError = false; if (newDateValue) { - let momentDate = moment(newDateValue, this.DATE_FORMAT, true); + const momentDate = moment(newDateValue, this.DATE_FORMAT, true); if (!momentDate.isValid()) { this.dateError = true; } diff --git a/lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.ts b/lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.ts index 7468ea239b..c265ab998d 100644 --- a/lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/start-task/services/start-task-cloud.service.ts @@ -41,7 +41,7 @@ export class StartTaskCloudService { * @returns Details of the newly created task */ createNewTask(taskDetails: TaskDetailsCloudModel): Observable<TaskDetailsCloudModel> { - let queryUrl = this.buildCreateTaskUrl(taskDetails.appName); + const queryUrl = this.buildCreateTaskUrl(taskDetails.appName); const bodyParam = JSON.stringify(this.buildRequestBody(taskDetails)); const pathParams = {}, queryParams = {}, headerParams = {}, formParams = {}, contentTypes = ['application/json'], accepts = ['application/json']; diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts index c7c1afe197..bb5c1fb0c1 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.spec.ts @@ -67,7 +67,7 @@ describe('EditTaskFilterCloudComponent', () => { }); it('should fetch task filter by taskId', async(() => { - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -81,7 +81,7 @@ describe('EditTaskFilterCloudComponent', () => { })); it('should display filter name as title', () => { - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); const title = fixture.debugElement.nativeElement.querySelector('#adf-edit-task-filter-title-id'); @@ -95,7 +95,7 @@ describe('EditTaskFilterCloudComponent', () => { describe('EditTaskFilter form', () => { beforeEach(() => { - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({'id': taskFilterIDchange}); fixture.detectChanges(); }); @@ -126,22 +126,22 @@ describe('EditTaskFilterCloudComponent', () => { it('should disable save button if the task filter is not changed', async(() => { component.toggleFilterActions = true; - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); fixture.whenStable().then(() => { - let saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-save"]'); + const saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-save"]'); expect(saveButton.disabled).toBe(true); }); })); it('should disable saveAs button if the task filter is not changed', async(() => { component.toggleFilterActions = true; - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); fixture.whenStable().then(() => { - let saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-saveAs"]'); + const saveButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-saveAs"]'); expect(saveButton.disabled).toBe(true); }); })); @@ -149,11 +149,11 @@ describe('EditTaskFilterCloudComponent', () => { it('should enable delete button by default', async(() => { component.toggleFilterActions = true; fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); fixture.whenStable().then(() => { - let deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]'); + const deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]'); expect(deleteButton.disabled).toBe(false); }); })); @@ -161,13 +161,13 @@ describe('EditTaskFilterCloudComponent', () => { it('should display current task filter details', async(() => { fixture.detectChanges(); fixture.whenStable().then(() => { - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"]'); - let assigneeElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-assignee"]'); - let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); - let orderElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-order"]'); + const stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"]'); + const assigneeElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-assignee"]'); + const sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); + const orderElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-order"]'); expect(stateElement).toBeDefined(); expect(assigneeElement).toBeDefined(); expect(sortElement).toBeDefined(); @@ -180,10 +180,10 @@ describe('EditTaskFilterCloudComponent', () => { it('should display status drop down', async(() => { fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"] .mat-select-trigger'); + const stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-status"] .mat-select-trigger'); stateElement.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -194,10 +194,10 @@ describe('EditTaskFilterCloudComponent', () => { it('should display sort drop down', async(() => { fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); + const sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); sortElement.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -208,10 +208,10 @@ describe('EditTaskFilterCloudComponent', () => { it('should display order drop down', async(() => { fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let orderElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-order"]'); + const orderElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-order"]'); orderElement.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -221,7 +221,7 @@ describe('EditTaskFilterCloudComponent', () => { })); it('should able to build a editTaskFilter form with default properties if input is empty', async(() => { - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); component.filterProperties = []; fixture.detectChanges(); @@ -245,7 +245,7 @@ describe('EditTaskFilterCloudComponent', () => { it('should able to fetch running applications when appName property defined in the input', async(() => { component.filterProperties = ['appName', 'processInstanceId', 'priority']; fixture.detectChanges(); - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); const appController = component.editTaskFilterForm.get('appName'); fixture.detectChanges(); @@ -260,13 +260,13 @@ describe('EditTaskFilterCloudComponent', () => { describe('sort properties', () => { it('should display default sort properties', async(() => { - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); + const sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); sortElement.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -282,13 +282,13 @@ describe('EditTaskFilterCloudComponent', () => { component.sortProperties = ['id', 'name', 'processInstanceId']; getTaskFilterSpy.and.returnValue({ sort: 'my-custom-sort', processInstanceId: 'process-instance-id', priority: '12' }); fixture.detectChanges(); - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); + const sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); sortElement.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -303,15 +303,15 @@ describe('EditTaskFilterCloudComponent', () => { })); it('should display default sort properties if input is empty', async(() => { - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); component.sortProperties = []; fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); + const sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"]'); sortElement.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -328,10 +328,10 @@ describe('EditTaskFilterCloudComponent', () => { it('should display default filter actions', async(() => { component.toggleFilterActions = true; - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -352,12 +352,12 @@ describe('EditTaskFilterCloudComponent', () => { it('should display filter actions when input actions are specified', async(() => { component.actions = ['save']; fixture.detectChanges(); - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); component.toggleFilterActions = true; fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -372,10 +372,10 @@ describe('EditTaskFilterCloudComponent', () => { it('should display default filter actions if input is empty', async(() => { component.toggleFilterActions = true; component.actions = []; - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -397,7 +397,7 @@ describe('EditTaskFilterCloudComponent', () => { describe('edit filter actions', () => { beforeEach(() => { - let taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); + const taskFilterIDchange = new SimpleChange(undefined, 'mock-task-filter-id', true); component.ngOnChanges({ 'id': taskFilterIDchange}); fixture.detectChanges(); @@ -406,12 +406,12 @@ describe('EditTaskFilterCloudComponent', () => { it('should emit save event and save the filter on click save button', async(() => { component.toggleFilterActions = true; const saveFilterSpy = spyOn(service, 'updateFilter').and.returnValue(fakeFilter); - let saveSpy: jasmine.Spy = spyOn(component.action, 'emit'); + const saveSpy: jasmine.Spy = spyOn(component.action, 'emit'); fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger'); + const stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger'); stateElement.click(); fixture.detectChanges(); const sortOptions = fixture.debugElement.queryAll(By.css('.mat-option-text')); @@ -429,15 +429,15 @@ describe('EditTaskFilterCloudComponent', () => { it('should emit delete event and delete the filter on click of delete button', async(() => { component.toggleFilterActions = true; const deleteFilterSpy = spyOn(service, 'deleteFilter').and.callThrough(); - let deleteSpy: jasmine.Spy = spyOn(component.action, 'emit'); + const deleteSpy: jasmine.Spy = spyOn(component.action, 'emit'); fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger'); + const stateElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger'); stateElement.click(); fixture.detectChanges(); - let deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]'); + const deleteButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-delete"]'); deleteButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -449,12 +449,12 @@ describe('EditTaskFilterCloudComponent', () => { it('should emit saveAs event and add filter on click saveAs button', async(() => { component.toggleFilterActions = true; const saveAsFilterSpy = spyOn(service, 'addFilter').and.callThrough(); - let saveAsSpy: jasmine.Spy = spyOn(component.action, 'emit'); + const saveAsSpy: jasmine.Spy = spyOn(component.action, 'emit'); fixture.detectChanges(); - let expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); + const expansionPanel = fixture.debugElement.nativeElement.querySelector('mat-expansion-panel-header'); expansionPanel.click(); fixture.detectChanges(); - let sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger'); + const sortElement = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-cloud-edit-task-property-sort"] .mat-select-trigger'); sortElement.click(); fixture.detectChanges(); const saveAsButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="adf-filter-action-saveAs"]'); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts index 1b4b07b9ed..7d20988087 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/edit-task-filter-cloud.component.ts @@ -259,7 +259,7 @@ export class EditTaskFilterCloudComponent implements OnInit, OnChanges { onDateChanged(newDateValue: any, dateProperty: TaskFilterProperties) { if (newDateValue) { - let momentDate = moment(newDateValue, this.FORMAT_DATE, true); + const momentDate = moment(newDateValue, this.FORMAT_DATE, true); if (momentDate.isValid()) { this.getPropertyController(dateProperty).setValue(momentDate.toDate()); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filter-dialog-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filter-dialog-cloud.component.spec.ts index 369f1f8094..490a26de3b 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filter-dialog-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filter-dialog-cloud.component.spec.ts @@ -62,13 +62,13 @@ describe('TaskFilterDialogCloudComponent', () => { it('should display title', () => { fixture.detectChanges(); - let titleElement = fixture.debugElement.nativeElement.querySelector('#adf-task-filter-dialog-title'); + const titleElement = fixture.debugElement.nativeElement.querySelector('#adf-task-filter-dialog-title'); expect(titleElement.textContent).toEqual(' ADF_CLOUD_EDIT_TASK_FILTER.DIALOG.TITLE '); }); it('should enable save button if form is valid', async(() => { fixture.detectChanges(); - let saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-button-id'); + const saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-button-id'); const inputElement = fixture.debugElement.nativeElement.querySelector('#adf-filter-name-id'); inputElement.value = 'My custom Name'; inputElement.dispatchEvent(new Event('input')); @@ -85,7 +85,7 @@ describe('TaskFilterDialogCloudComponent', () => { inputElement.value = ''; inputElement.dispatchEvent(new Event('input')); fixture.whenStable().then(() => { - let saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-button-id'); + const saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-button-id'); fixture.detectChanges(); expect(saveButton).toBeDefined(); expect(saveButton.disabled).toBe(true); @@ -98,7 +98,7 @@ describe('TaskFilterDialogCloudComponent', () => { inputElement.value = 'My custom Name'; inputElement.dispatchEvent(new Event('input')); fixture.whenStable().then(() => { - let saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-button-id'); + const saveButton = fixture.debugElement.nativeElement.querySelector('#adf-save-button-id'); fixture.detectChanges(); saveButton.click(); expect(saveButton).toBeDefined(); @@ -109,7 +109,7 @@ describe('TaskFilterDialogCloudComponent', () => { it('should able close dialog on click of cancel button', () => { component.data = { data: { name: '' } }; - let cancelButton = fixture.debugElement.nativeElement.querySelector('#adf-cancel-button-id'); + const cancelButton = fixture.debugElement.nativeElement.querySelector('#adf-cancel-button-id'); fixture.detectChanges(); cancelButton.click(); expect(cancelButton).toBeDefined(); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts index c16e51c654..fdd952cae4 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/components/task-filters-cloud.component.spec.ts @@ -31,21 +31,21 @@ describe('TaskFiltersCloudComponent', () => { let taskFilterService: TaskFilterCloudService; - let fakeGlobalFilterObservable = + const fakeGlobalFilterObservable = new Observable(function(observer) { observer.next(fakeGlobalFilter); observer.complete(); }); - let fakeGlobalFilterPromise = new Promise(function (resolve, reject) { + const fakeGlobalFilterPromise = new Promise(function (resolve, reject) { resolve(fakeGlobalFilter); }); - let mockErrorFilterList = { + const mockErrorFilterList = { error: 'wrong request' }; - let mockErrorFilterPromise = Promise.reject(mockErrorFilterList); + const mockErrorFilterPromise = Promise.reject(mockErrorFilterList); let component: TaskFiltersCloudComponent; let fixture: ComponentFixture<TaskFiltersCloudComponent>; @@ -64,14 +64,14 @@ describe('TaskFiltersCloudComponent', () => { it('should attach specific icon for each filter if hasIcon is true', async(() => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(fakeGlobalFilterObservable); - let change = new SimpleChange(undefined, 'my-app-1', true); + const change = new SimpleChange(undefined, 'my-app-1', true); component.ngOnChanges({'appName': change}); fixture.detectChanges(); component.showIcons = true; fixture.whenStable().then(() => { fixture.detectChanges(); expect(component.filters.length).toBe(3); - let filters = fixture.nativeElement.querySelectorAll('.adf-filters__entry-icon'); + const filters = fixture.nativeElement.querySelectorAll('.adf-filters__entry-icon'); expect(filters.length).toBe(3); expect(filters[0].innerText).toContain('adjust'); expect(filters[1].innerText).toContain('done'); @@ -83,13 +83,13 @@ describe('TaskFiltersCloudComponent', () => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); component.showIcons = false; - let change = new SimpleChange(undefined, 'my-app-1', true); + const change = new SimpleChange(undefined, 'my-app-1', true); component.ngOnChanges({'appName': change}); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); + const filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); expect(filters.length).toBe(0); done(); }); @@ -97,13 +97,13 @@ describe('TaskFiltersCloudComponent', () => { it('should display the filters', async(() => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(fakeGlobalFilterObservable); - let change = new SimpleChange(undefined, 'my-app-1', true); + const change = new SimpleChange(undefined, 'my-app-1', true); component.ngOnChanges({'appName': change}); fixture.detectChanges(); component.showIcons = true; fixture.whenStable().then(() => { fixture.detectChanges(); - let filters = fixture.debugElement.queryAll(By.css('mat-list-item[class*="adf-filters__entry"]')); + const filters = fixture.debugElement.queryAll(By.css('mat-list-item[class*="adf-filters__entry"]')); expect(component.filters.length).toBe(3); expect(filters.length).toBe(3); expect(filters[0].nativeElement.innerText).toContain('FakeInvolvedTasks'); @@ -116,7 +116,7 @@ describe('TaskFiltersCloudComponent', () => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(mockErrorFilterPromise)); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({'appName': change}); component.error.subscribe((err) => { @@ -128,7 +128,7 @@ describe('TaskFiltersCloudComponent', () => { it('should return the filter task list', (done) => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); component.success.subscribe((res) => { @@ -142,7 +142,7 @@ describe('TaskFiltersCloudComponent', () => { it('should return the filter task list, filtered By Name', (done) => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); component.success.subscribe((res) => { @@ -159,7 +159,7 @@ describe('TaskFiltersCloudComponent', () => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(fakeGlobalFilterObservable); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.ngOnChanges({ 'appName': change }); @@ -177,7 +177,7 @@ describe('TaskFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ name: 'FakeMyTasks1' }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.ngOnChanges({ 'appName': change }); @@ -196,7 +196,7 @@ describe('TaskFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ name: 'UnexistableFilter' }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.ngOnChanges({ 'appName': change }); @@ -215,7 +215,7 @@ describe('TaskFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ index: 2 }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.ngOnChanges({ 'appName': change }); @@ -233,7 +233,7 @@ describe('TaskFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ id: 12 }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); fixture.detectChanges(); component.ngOnChanges({ 'appName': change }); @@ -252,12 +252,12 @@ describe('TaskFiltersCloudComponent', () => { component.filterParam = new FilterParamsModel({ id: 12 }); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); fixture.detectChanges(); spyOn(component, 'selectFilterAndEmit').and.stub(); - let filterButton = fixture.debugElement.nativeElement.querySelector('span[data-automation-id="fake-my-tast1-filter"]'); + const filterButton = fixture.debugElement.nativeElement.querySelector('span[data-automation-id="fake-my-tast1-filter"]'); filterButton.click(); expect(component.selectFilterAndEmit).toHaveBeenCalledWith({id: fakeGlobalFilter[1].id}); })); @@ -266,7 +266,7 @@ describe('TaskFiltersCloudComponent', () => { spyOn(component, 'getFilters').and.stub(); const appName = 'my-app-1'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); expect(component.getFilters).toHaveBeenCalledWith(appName); @@ -313,14 +313,14 @@ describe('TaskFiltersCloudComponent', () => { spyOn(component, 'getFilters').and.stub(); const appName = 'fake-app-name'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); expect(component.getFilters).toHaveBeenCalledWith(appName); }); it('should return the current filter after one is selected', () => { - let filter = new FilterParamsModel({ name: 'FakeInvolvedTasks' }); + const filter = new FilterParamsModel({ name: 'FakeInvolvedTasks' }); component.filters = fakeGlobalFilter; expect(component.currentFilter).toBeUndefined(); diff --git a/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts index 45abc78fc7..90ed79d974 100644 --- a/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-filters/services/task-filter-cloud.service.ts @@ -36,10 +36,10 @@ export class TaskFilterCloudService { * @returns Observable of default filters just created */ private createDefaultFilters(appName: string) { - let myTasksFilter = this.getMyTasksFilterInstance(appName); + const myTasksFilter = this.getMyTasksFilterInstance(appName); this.addFilter(myTasksFilter); - let completedTasksFilter = this.getCompletedTasksFilterInstance(appName); + const completedTasksFilter = this.getCompletedTasksFilterInstance(appName); this.addFilter(completedTasksFilter); } @@ -50,7 +50,7 @@ export class TaskFilterCloudService { */ getTaskListFilters(appName?: string): Observable<TaskFilterCloudModel[]> { const username = this.getUsername(); - let key = `task-filters-${appName}-${username}`; + const key = `task-filters-${appName}-${username}`; const filters = JSON.parse(this.storage.getItem(key) || '[]'); if (filters.length === 0) { @@ -69,7 +69,7 @@ export class TaskFilterCloudService { */ getTaskFilterById(appName: string, id: string): TaskFilterCloudModel { const username = this.getUsername(); - let key = `task-filters-${appName}-${username}`; + const key = `task-filters-${appName}-${username}`; let filters = []; filters = JSON.parse(this.storage.getItem(key)) || []; return filters.filter((filterTmp: TaskFilterCloudModel) => id === filterTmp.id)[0]; @@ -83,7 +83,7 @@ export class TaskFilterCloudService { addFilter(filter: TaskFilterCloudModel) { const username = this.getUsername(); const key = `task-filters-${filter.appName}-${username}`; - let filters = JSON.parse(this.storage.getItem(key) || '[]'); + const filters = JSON.parse(this.storage.getItem(key) || '[]'); filters.push(filter); @@ -104,8 +104,8 @@ export class TaskFilterCloudService { const username = this.getUsername(); const key = `task-filters-${filter.appName}-${username}`; if (key) { - let filters = JSON.parse(this.storage.getItem(key) || '[]'); - let itemIndex = filters.findIndex((flt: TaskFilterCloudModel) => flt.id === filter.id); + const filters = JSON.parse(this.storage.getItem(key) || '[]'); + const itemIndex = filters.findIndex((flt: TaskFilterCloudModel) => flt.id === filter.id); filters[itemIndex] = filter; this.storage.setItem(key, JSON.stringify(filters)); this.addFiltersToStream(filters); diff --git a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts index 108a178734..b2db6f5b46 100644 --- a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.spec.ts @@ -62,7 +62,7 @@ describe('TaskHeaderCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let formNameEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-assignee"] span')); + const formNameEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-assignee"] span')); expect(formNameEl.nativeElement.innerText).toBe('Wilbur Adams'); }); })); @@ -73,7 +73,7 @@ describe('TaskHeaderCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-assignee"] span')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-assignee"] span')); expect(valueEl.nativeElement.innerText).toBe('ADF_CLOUD_TASK_HEADER.PROPERTIES.ASSIGNEE_DEFAULT'); }); @@ -84,7 +84,7 @@ describe('TaskHeaderCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let formNameEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-priority"]')); + const formNameEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-priority"]')); expect(formNameEl.nativeElement.innerText).toBe('5'); }); })); @@ -94,7 +94,7 @@ describe('TaskHeaderCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); expect(valueEl.nativeElement.innerText.trim()).toBe('Dec 18 2018'); }); })); @@ -105,7 +105,7 @@ describe('TaskHeaderCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); expect(valueEl.nativeElement.innerText.trim()).toBe('ADF_CLOUD_TASK_HEADER.PROPERTIES.DUE_DATE_DEFAULT'); }); })); @@ -116,7 +116,7 @@ describe('TaskHeaderCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-parentName"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-parentName"] .adf-property-value')); expect(valueEl.nativeElement.innerText.trim()).toEqual('ADF_CLOUD_TASK_HEADER.PROPERTIES.PARENT_NAME_DEFAULT'); }); })); @@ -127,7 +127,7 @@ describe('TaskHeaderCloudComponent', () => { spyOn(appConfigService, 'get').and.returnValue(['assignee', 'status']); component.ngOnInit(); fixture.detectChanges(); - let propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); + const propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); fixture.whenStable().then(() => { expect(propertyList).toBeDefined(); @@ -145,7 +145,7 @@ describe('TaskHeaderCloudComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); + const propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); expect(propertyList).toBeDefined(); expect(propertyList).not.toBeNull(); expect(propertyList.length).toBe(component.properties.length); diff --git a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts index c173209509..b9b7b42e30 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.spec.ts @@ -127,7 +127,7 @@ describe('TaskListCloudComponent', () => { it('should return the results if an application name is given', (done) => { spyOn(taskListCloudService, 'getTaskByRequest').and.returnValue(of(fakeGlobalTask)); - let appName = new SimpleChange(null, 'FAKE-APP-NAME', true); + const appName = new SimpleChange(null, 'FAKE-APP-NAME', true); component.success.subscribe((res) => { expect(res).toBeDefined(); expect(component.rows).toBeDefined(); @@ -174,12 +174,12 @@ describe('TaskListCloudComponent', () => { }); it('should emit row click event', (done) => { - let row = new ObjectDataRow({ + const row = new ObjectDataRow({ entry: { id: '999' } }); - let rowEvent = new DataRowEvent(row, null); + const rowEvent = new DataRowEvent(row, null); component.rowClick.subscribe((taskId) => { expect(taskId).toEqual('999'); expect(component.getCurrentId()).toEqual('999'); diff --git a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts index 0132656712..57125e2520 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/components/task-list-cloud.component.ts @@ -180,7 +180,7 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges } private isPropertyChanged(changes: SimpleChanges): boolean { - for (let property in changes) { + for (const property in changes) { if (changes.hasOwnProperty(property)) { if (changes[property] && (changes[property].currentValue !== changes[property].previousValue)) { @@ -250,7 +250,7 @@ export class TaskListCloudComponent extends DataTableSchema implements OnChanges private createRequestNode() { - let requestNode = { + const requestNode = { appName: this.appName, assignee: this.assignee, id: this.id, diff --git a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts index fc967a7d98..8c17a606c5 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.spec.ts @@ -71,7 +71,7 @@ describe('Activiti TaskList Cloud Service', () => { })); it('should return the tasks', (done) => { - let taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName' }; + const taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName' }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnFakeTaskListResults); service.getTaskByRequest(taskRequest).subscribe((res) => { expect(res).toBeDefined(); @@ -84,7 +84,7 @@ describe('Activiti TaskList Cloud Service', () => { }); it('should append to the call all the parameters', (done) => { - let taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; + const taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnCallQueryParameters); service.getTaskByRequest(taskRequest).subscribe((res) => { expect(res).toBeDefined(); @@ -97,7 +97,7 @@ describe('Activiti TaskList Cloud Service', () => { }); it('should concat the app name to the request url', (done) => { - let taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; + const taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service' }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnCallUrl); service.getTaskByRequest(taskRequest).subscribe((requestUrl) => { expect(requestUrl).toBeDefined(); @@ -108,7 +108,7 @@ describe('Activiti TaskList Cloud Service', () => { }); it('should concat the sorting to append as parameters', (done) => { - let taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service', + const taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: 'fakeName', skipCount: 0, maxItems: 20, service: 'fake-service', sorting: [{ orderBy: 'NAME', direction: 'DESC'}, { orderBy: 'TITLE', direction: 'ASC'}] }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnCallQueryParameters); service.getTaskByRequest(taskRequest).subscribe((res) => { @@ -120,7 +120,7 @@ describe('Activiti TaskList Cloud Service', () => { }); it('should return an error when app name is not specified', (done) => { - let taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: null }; + const taskRequest: TaskQueryCloudRequestModel = <TaskQueryCloudRequestModel> { appName: null }; spyOn(alfrescoApiMock, 'getInstance').and.callFake(returnCallUrl); service.getTaskByRequest(taskRequest).subscribe( () => { }, diff --git a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts index fcc9012df4..3c7d3d966c 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts @@ -39,9 +39,9 @@ export class TaskListCloudService { */ getTaskByRequest(requestNode: TaskQueryCloudRequestModel): Observable<any> { if (requestNode.appName) { - let queryUrl = this.buildQueryUrl(requestNode); - let queryParams = this.buildQueryParams(requestNode); - let sortingParams = this.buildSortingParam(requestNode.sorting); + const queryUrl = this.buildQueryUrl(requestNode); + const queryParams = this.buildQueryParams(requestNode); + const sortingParams = this.buildSortingParam(requestNode.sorting); if (sortingParams) { queryParams['sort'] = sortingParams; } @@ -62,8 +62,8 @@ export class TaskListCloudService { } private buildQueryParams(requestNode: TaskQueryCloudRequestModel) { - let queryParam = {}; - for (let property in requestNode) { + const queryParam = {}; + for (const property in requestNode) { if (requestNode.hasOwnProperty(property) && !this.isExcludedField(property) && this.isPropertyValueValid(requestNode, property)) { @@ -84,7 +84,7 @@ export class TaskListCloudService { private buildSortingParam(sortings: TaskListCloudSortingModel[]): string { let finalSorting: string = ''; if (sortings) { - for (let sort of sortings) { + for (const sort of sortings) { if (!finalSorting) { finalSorting = `${sort.orderBy},${sort.direction}`; } else { diff --git a/lib/process-services/app-list/apps-list.component.spec.ts b/lib/process-services/app-list/apps-list.component.spec.ts index d000e194f6..49b73495c1 100644 --- a/lib/process-services/app-list/apps-list.component.spec.ts +++ b/lib/process-services/app-list/apps-list.component.spec.ts @@ -65,7 +65,7 @@ describe('AppsListComponent', () => { component.loading = true; fixture.detectChanges(); fixture.whenStable().then(() => { - let loadingSpinner = fixture.nativeElement.querySelector('mat-spinner'); + const loadingSpinner = fixture.nativeElement.querySelector('mat-spinner'); expect(loadingSpinner).toBeDefined(); }); })); @@ -124,7 +124,7 @@ describe('AppsListComponent', () => { }); it('should emit an error when an error occurs loading apps', () => { - let emitSpy = spyOn(component.error, 'emit'); + const emitSpy = spyOn(component.error, 'emit'); getAppsSpy.and.returnValue(throwError({})); fixture.detectChanges(); expect(emitSpy).toHaveBeenCalled(); @@ -212,7 +212,7 @@ describe('AppsListComponent', () => { }); it('should initially have no app selected', () => { - let selectedEls = debugElement.queryAll(By.css('.selectedIcon')); + const selectedEls = debugElement.queryAll(By.css('.selectedIcon')); expect(selectedEls.length).toBe(0); }); @@ -225,14 +225,14 @@ describe('AppsListComponent', () => { it('should have one app shown as selected after app selected', () => { component.selectApp(deployedApps[1]); fixture.detectChanges(); - let selectedEls = debugElement.queryAll(By.css('.adf-app-listgrid-item-card-actions-icon')); + const selectedEls = debugElement.queryAll(By.css('.adf-app-listgrid-item-card-actions-icon')); expect(selectedEls.length).toBe(1); }); it('should have the correct app shown as selected after app selected', () => { component.selectApp(deployedApps[1]); fixture.detectChanges(); - let appEls = debugElement.queryAll(By.css('.adf-app-listgrid > div')); + const appEls = debugElement.queryAll(By.css('.adf-app-listgrid > div')); expect(appEls[1].query(By.css('.adf-app-listgrid-item-card-actions-icon'))).not.toBeNull(); }); @@ -272,7 +272,7 @@ describe('Custom CustomEmptyAppListTemplateComponent', () => { it('should render the custom no-apps template', async(() => { fixture.detectChanges(); fixture.whenStable().then(() => { - let title: any = fixture.debugElement.queryAll(By.css('#custom-id')); + const title: any = fixture.debugElement.queryAll(By.css('#custom-id')); expect(title.length).toBe(1); expect(title[0].nativeElement.innerText).toBe('No Apps'); }); diff --git a/lib/process-services/app-list/apps-list.component.ts b/lib/process-services/app-list/apps-list.component.ts index 663ad1b380..5b86ff045e 100644 --- a/lib/process-services/app-list/apps-list.component.ts +++ b/lib/process-services/app-list/apps-list.component.ts @@ -147,7 +147,7 @@ export class AppsListComponent implements OnInit, AfterContentInit { } private filterApps(apps: AppDefinitionRepresentationModel []): AppDefinitionRepresentationModel[] { - let filteredApps: AppDefinitionRepresentationModel[] = []; + const filteredApps: AppDefinitionRepresentationModel[] = []; if (this.filtersAppId) { apps.filter((app: AppDefinitionRepresentationModel) => { this.filtersAppId.forEach((filter) => { diff --git a/lib/process-services/app-list/select-apps-dialog-component.spec.ts b/lib/process-services/app-list/select-apps-dialog-component.spec.ts index 989608dd20..56dd406c25 100644 --- a/lib/process-services/app-list/select-apps-dialog-component.spec.ts +++ b/lib/process-services/app-list/select-apps-dialog-component.spec.ts @@ -52,7 +52,7 @@ export class DialogSelectAppTestComponent { describe('Select app dialog', () => { let fixture: ComponentFixture<DialogSelectAppTestComponent>; let component: DialogSelectAppTestComponent; - let dialogRef = { + const dialogRef = { close: jasmine.createSpy('close') }; let overlayContainerElement: HTMLElement; diff --git a/lib/process-services/attachment/create-process-attachment.component.spec.ts b/lib/process-services/attachment/create-process-attachment.component.spec.ts index 74e5108e4d..61575e4981 100644 --- a/lib/process-services/attachment/create-process-attachment.component.spec.ts +++ b/lib/process-services/attachment/create-process-attachment.component.spec.ts @@ -29,11 +29,11 @@ describe('CreateProcessAttachmentComponent', () => { let fixture: ComponentFixture<CreateProcessAttachmentComponent>; let element: HTMLElement; - let file = new File([new Blob()], 'Test'); - let fileObj = { entry: null, file: file, relativeFolder: '/' }; - let customEvent = { detail: { files: [fileObj] } }; + const file = new File([new Blob()], 'Test'); + const fileObj = { entry: null, file: file, relativeFolder: '/' }; + const customEvent = { detail: { files: [fileObj] } }; - let fakeUploadResponse = { + const fakeUploadResponse = { id: 9999, name: 'BANANA.jpeg', created: '2017-06-12T12:52:11.109Z', @@ -73,7 +73,7 @@ describe('CreateProcessAttachmentComponent', () => { it('should update the processInstanceId when it is changed', () => { component.processInstanceId = null; - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); expect(component.processInstanceId).toBe('123'); @@ -96,7 +96,7 @@ describe('CreateProcessAttachmentComponent', () => { })); it('should allow user to upload files via button', async(() => { - let buttonUpload: HTMLElement = <HTMLElement> element.querySelector('#add_new_process_content_button'); + const buttonUpload: HTMLElement = <HTMLElement> element.querySelector('#add_new_process_content_button'); expect(buttonUpload).toBeDefined(); expect(buttonUpload).not.toBeNull(); @@ -106,7 +106,7 @@ describe('CreateProcessAttachmentComponent', () => { expect(res.id).toBe(9999); }); - let dropEvent = new CustomEvent('upload-files', customEvent); + const dropEvent = new CustomEvent('upload-files', customEvent); buttonUpload.dispatchEvent(dropEvent); fixture.detectChanges(); diff --git a/lib/process-services/attachment/create-process-attachment.component.ts b/lib/process-services/attachment/create-process-attachment.component.ts index f0c9f3bb96..a5227a7386 100644 --- a/lib/process-services/attachment/create-process-attachment.component.ts +++ b/lib/process-services/attachment/create-process-attachment.component.ts @@ -51,11 +51,11 @@ export class CreateProcessAttachmentComponent implements OnChanges { } onFileUpload(event: any) { - let filesList: File[] = event.detail.files.map((obj) => obj.file); + const filesList: File[] = event.detail.files.map((obj) => obj.file); - for (let fileInfoObj of filesList) { - let file: File = fileInfoObj; - let opts = { + for (const fileInfoObj of filesList) { + const file: File = fileInfoObj; + const opts = { isRelatedContent: true }; this.activitiContentService.createProcessRelatedContent(this.processInstanceId, file, opts).subscribe( diff --git a/lib/process-services/attachment/create-task-attachment.component.spec.ts b/lib/process-services/attachment/create-task-attachment.component.spec.ts index 17f9e513e0..d73d3a7890 100644 --- a/lib/process-services/attachment/create-task-attachment.component.spec.ts +++ b/lib/process-services/attachment/create-task-attachment.component.spec.ts @@ -47,15 +47,15 @@ describe('AttachmentComponent', () => { }); it('should not call createTaskRelatedContent service when taskId changed', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); expect(createTaskRelatedContentSpy).not.toHaveBeenCalled(); }); it('should not call createTaskRelatedContent service when there is no file uploaded', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); - let customEvent: any = { + const customEvent: any = { detail: { files: [] } @@ -65,10 +65,10 @@ describe('AttachmentComponent', () => { }); it('should call createTaskRelatedContent service when there is a file uploaded', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'taskId': change}); - let file = new File([new Blob()], 'Test'); - let customEvent = { + const file = new File([new Blob()], 'Test'); + const customEvent = { detail: { files: [ file diff --git a/lib/process-services/attachment/create-task-attachment.component.ts b/lib/process-services/attachment/create-task-attachment.component.ts index 2bcbec6200..62b0704fc1 100644 --- a/lib/process-services/attachment/create-task-attachment.component.ts +++ b/lib/process-services/attachment/create-task-attachment.component.ts @@ -51,11 +51,11 @@ export class AttachmentComponent implements OnChanges { } onFileUpload(event: any) { - let filesList: File[] = event.detail.files.map((obj) => obj.file); + const filesList: File[] = event.detail.files.map((obj) => obj.file); - for (let fileInfoObj of filesList) { - let file: File = fileInfoObj; - let opts = { + for (const fileInfoObj of filesList) { + const file: File = fileInfoObj; + const opts = { isRelatedContent: true }; this.activitiContentService.createTaskRelatedContent(this.taskId, file, opts).subscribe( diff --git a/lib/process-services/attachment/process-attachment-list.component.spec.ts b/lib/process-services/attachment/process-attachment-list.component.spec.ts index 4e572552d2..4077c6b623 100644 --- a/lib/process-services/attachment/process-attachment-list.component.spec.ts +++ b/lib/process-services/attachment/process-attachment-list.component.spec.ts @@ -90,7 +90,7 @@ describe('ProcessAttachmentListComponent', () => { getProcessRelatedContentSpy = spyOn(service, 'getProcessRelatedContent').and.returnValue(of(mockAttachment)); spyOn(service, 'deleteRelatedContent').and.returnValue(of({successCode: true})); - let blobObj = new Blob(); + const blobObj = new Blob(); spyOn(service, 'getFileRawContent').and.returnValue(of(blobObj)); }); @@ -104,21 +104,21 @@ describe('ProcessAttachmentListComponent', () => { }); it('should load attachments when processInstanceId specified', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); expect(getProcessRelatedContentSpy).toHaveBeenCalled(); }); it('should emit an error when an error occurs loading attachments', () => { - let emitSpy = spyOn(component.error, 'emit'); + const emitSpy = spyOn(component.error, 'emit'); getProcessRelatedContentSpy.and.returnValue(throwError({})); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); expect(emitSpy).toHaveBeenCalled(); }); it('should emit a success event when the attachments are loaded', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.success.subscribe((attachments) => { expect(attachments[0].name).toEqual(mockAttachment.data[0].name); expect(attachments[0].id).toEqual(mockAttachment.data[0].id); @@ -133,7 +133,7 @@ describe('ProcessAttachmentListComponent', () => { }); it('should display attachments when the process has attachments', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); fixture.detectChanges(); @@ -143,15 +143,15 @@ describe('ProcessAttachmentListComponent', () => { })); it('should display all actions if attachments are not read only', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); fixture.detectChanges(); - let actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); + const actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); actionButton.click(); fixture.whenStable().then(() => { fixture.detectChanges(); - let actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; + const actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; expect(window.document.querySelector('[data-automation-id="ADF_PROCESS_LIST.MENU_ACTIONS.VIEW_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_PROCESS_LIST.MENU_ACTIONS.REMOVE_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_PROCESS_LIST.MENU_ACTIONS.DOWNLOAD_CONTENT"]')).not.toBeNull(); @@ -160,16 +160,16 @@ describe('ProcessAttachmentListComponent', () => { })); it('should not display remove action if attachments are read only', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); component.disabled = true; fixture.detectChanges(); - let actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); + const actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); actionButton.click(); fixture.whenStable().then(() => { fixture.detectChanges(); - let actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; + const actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; expect(window.document.querySelector('[data-automation-id="ADF_PROCESS_LIST.MENU_ACTIONS.VIEW_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_PROCESS_LIST.MENU_ACTIONS.DOWNLOAD_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_PROCESS_LIST.MENU_ACTIONS.REMOVE_CONTENT"]')).toBeNull(); @@ -184,7 +184,7 @@ describe('ProcessAttachmentListComponent', () => { 'start': 0, 'data': [] })); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'processInstanceId': change}); fixture.whenStable().then(() => { fixture.detectChanges(); @@ -199,7 +199,7 @@ describe('ProcessAttachmentListComponent', () => { 'start': 0, 'data': [] })); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'processInstanceId': change}); component.disabled = true; @@ -217,7 +217,7 @@ describe('ProcessAttachmentListComponent', () => { 'start': 0, 'data': [] })); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'processInstanceId': change}); component.disabled = true; @@ -230,7 +230,7 @@ describe('ProcessAttachmentListComponent', () => { it('should not show the empty list component when the attachments list is not empty for completed process', async(() => { getProcessRelatedContentSpy.and.returnValue(of(mockAttachment)); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({'processInstanceId': change}); component.disabled = true; @@ -251,8 +251,8 @@ describe('ProcessAttachmentListComponent', () => { describe('change detection', () => { - let change = new SimpleChange('123', '456', true); - let nullChange = new SimpleChange('123', null, true); + const change = new SimpleChange('123', '456', true); + const nullChange = new SimpleChange('123', null, true); beforeEach(async(() => { component.processInstanceId = '123'; @@ -325,7 +325,7 @@ describe('Custom CustomEmptyTemplateComponent', () => { it('should render the custom template', async(() => { fixture.whenStable().then(() => { fixture.detectChanges(); - let title: any = fixture.debugElement.queryAll(By.css('[adf-empty-list-header]')); + const title: any = fixture.debugElement.queryAll(By.css('[adf-empty-list-header]')); expect(title.length).toBe(1); expect(title[0].nativeElement.innerText).toBe('Custom header'); }); diff --git a/lib/process-services/attachment/process-attachment-list.component.ts b/lib/process-services/attachment/process-attachment-list.component.ts index 3f23d324be..233823db40 100644 --- a/lib/process-services/attachment/process-attachment-list.component.ts +++ b/lib/process-services/attachment/process-attachment-list.component.ts @@ -152,17 +152,17 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn } onShowRowActionsMenu(event: any) { - let viewAction = { + const viewAction = { title: 'ADF_PROCESS_LIST.MENU_ACTIONS.VIEW_CONTENT', name: 'view' }; - let removeAction = { + const removeAction = { title: 'ADF_PROCESS_LIST.MENU_ACTIONS.REMOVE_CONTENT', name: 'remove' }; - let downloadAction = { + const downloadAction = { title: 'ADF_PROCESS_LIST.MENU_ACTIONS.DOWNLOAD_CONTENT', name: 'download' }; @@ -178,8 +178,8 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn } onExecuteRowAction(event: any) { - let args = event.value; - let action = args.action; + const args = event.value; + const action = args.action; if (action.name === 'view') { this.emitDocumentContent(args.row.obj); } else if (action.name === 'remove') { @@ -190,7 +190,7 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn } openContent(event: any): void { - let content = event.value.obj; + const content = event.value.obj; this.emitDocumentContent(content); } diff --git a/lib/process-services/attachment/task-attachment-list.component.spec.ts b/lib/process-services/attachment/task-attachment-list.component.spec.ts index ef58ca6a4e..61b74af8f5 100644 --- a/lib/process-services/attachment/task-attachment-list.component.spec.ts +++ b/lib/process-services/attachment/task-attachment-list.component.spec.ts @@ -86,7 +86,7 @@ describe('TaskAttachmentList', () => { deleteContentSpy = spyOn(service, 'deleteRelatedContent').and.returnValue(of({ successCode: true })); - let blobObj = new Blob(); + const blobObj = new Blob(); getFileRawContentSpy = spyOn(service, 'getFileRawContent').and.returnValue(of(blobObj)); }); @@ -102,21 +102,21 @@ describe('TaskAttachmentList', () => { }); it('should load attachments when taskId specified', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); expect(getTaskRelatedContentSpy).toHaveBeenCalled(); }); it('should emit an error when an error occurs loading attachments', () => { - let emitSpy = spyOn(component.error, 'emit'); + const emitSpy = spyOn(component.error, 'emit'); getTaskRelatedContentSpy.and.returnValue(throwError({})); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); expect(emitSpy).toHaveBeenCalled(); }); it('should emit a success event when the attachments are loaded', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); disposableSuccess = component.success.subscribe((attachments) => { expect(attachments[0].name).toEqual(mockAttachment.data[0].name); expect(attachments[0].id).toEqual(mockAttachment.data[0].id); @@ -131,7 +131,7 @@ describe('TaskAttachmentList', () => { }); it('should display attachments when the task has attachments', (done) => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); @@ -160,7 +160,7 @@ describe('TaskAttachmentList', () => { 'start': 0, 'data': [] })); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); component.hasCustomTemplate = false; @@ -172,15 +172,15 @@ describe('TaskAttachmentList', () => { })); it('should display all actions if attachments are not read only', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); - let actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); + const actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); actionButton.click(); fixture.whenStable().then(() => { fixture.detectChanges(); - let actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; + const actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; expect(window.document.querySelector('[data-automation-id="ADF_TASK_LIST.MENU_ACTIONS.VIEW_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_TASK_LIST.MENU_ACTIONS.REMOVE_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_TASK_LIST.MENU_ACTIONS.DOWNLOAD_CONTENT"]')).not.toBeNull(); @@ -189,16 +189,16 @@ describe('TaskAttachmentList', () => { })); it('should not display remove action if attachments are read only', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); component.disabled = true; fixture.detectChanges(); - let actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); + const actionButton = fixture.debugElement.nativeElement.querySelector('[data-automation-id="action_menu_0"]'); actionButton.click(); fixture.whenStable().then(() => { fixture.detectChanges(); - let actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; + const actionMenu = window.document.querySelectorAll('button.mat-menu-item').length; expect(window.document.querySelector('[data-automation-id="ADF_TASK_LIST.MENU_ACTIONS.VIEW_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_TASK_LIST.MENU_ACTIONS.DOWNLOAD_CONTENT"]')).not.toBeNull(); expect(window.document.querySelector('[data-automation-id="ADF_TASK_LIST.MENU_ACTIONS.REMOVE_CONTENT"]')).toBeNull(); @@ -213,7 +213,7 @@ describe('TaskAttachmentList', () => { 'start': 0, 'data': [] })); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -229,7 +229,7 @@ describe('TaskAttachmentList', () => { 'start': 0, 'data': [] })); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); component.disabled = true; @@ -241,7 +241,7 @@ describe('TaskAttachmentList', () => { it('should not show the empty list component when the attachments list is not empty for completed task', (done) => { getTaskRelatedContentSpy.and.returnValue(of(mockAttachment)); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'taskId': change }); component.disabled = true; @@ -346,7 +346,7 @@ describe('Custom CustomEmptyTemplateComponent', () => { it('should render the custom template', async(() => { fixture.whenStable().then(() => { fixture.detectChanges(); - let title: any = fixture.debugElement.queryAll(By.css('[adf-empty-list-header]')); + const title: any = fixture.debugElement.queryAll(By.css('[adf-empty-list-header]')); expect(title.length).toBe(1); expect(title[0].nativeElement.innerText).toBe('Custom header'); }); diff --git a/lib/process-services/attachment/task-attachment-list.component.ts b/lib/process-services/attachment/task-attachment-list.component.ts index 3252017fde..97017c0284 100644 --- a/lib/process-services/attachment/task-attachment-list.component.ts +++ b/lib/process-services/attachment/task-attachment-list.component.ts @@ -122,7 +122,7 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit const opts = 'true'; this.activitiContentService.getTaskRelatedContent(taskId, opts).subscribe( (res: any) => { - let attachList = []; + const attachList = []; res.data.forEach((content) => { attachList.push({ id: content.id, @@ -162,17 +162,17 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit } onShowRowActionsMenu(event: any) { - let viewAction = { + const viewAction = { title: 'ADF_TASK_LIST.MENU_ACTIONS.VIEW_CONTENT', name: 'view' }; - let removeAction = { + const removeAction = { title: 'ADF_TASK_LIST.MENU_ACTIONS.REMOVE_CONTENT', name: 'remove' }; - let downloadAction = { + const downloadAction = { title: 'ADF_TASK_LIST.MENU_ACTIONS.DOWNLOAD_CONTENT', name: 'download' }; @@ -188,8 +188,8 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit } onExecuteRowAction(event: any) { - let args = event.value; - let action = args.action; + const args = event.value; + const action = args.action; if (action.name === 'view') { this.emitDocumentContent(args.row.obj); } else if (action.name === 'remove') { @@ -200,7 +200,7 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit } openContent(event: any): void { - let content = event.value.obj; + const content = event.value.obj; this.emitDocumentContent(content); } diff --git a/lib/process-services/content-widget/attach-file-widget-dialog.component.spec.ts b/lib/process-services/content-widget/attach-file-widget-dialog.component.spec.ts index 49078302a1..2d6505d473 100644 --- a/lib/process-services/content-widget/attach-file-widget-dialog.component.spec.ts +++ b/lib/process-services/content-widget/attach-file-widget-dialog.component.spec.ts @@ -32,7 +32,7 @@ describe('AttachFileWidgetDialogComponent', () => { let widget: AttachFileWidgetDialogComponent; let fixture: ComponentFixture<AttachFileWidgetDialogComponent>; - let data: AttachFileWidgetDialogComponentData = { + const data: AttachFileWidgetDialogComponentData = { title: 'Move along citizen...', actionName: 'move', selected: new EventEmitter<any>(), @@ -94,8 +94,8 @@ describe('AttachFileWidgetDialogComponent', () => { spyOn(authService, 'login').and.returnValue(of({ type: 'type', ticket: 'ticket'})); isLogged = true; let loginButton: HTMLButtonElement = element.querySelector('button[data-automation-id="attach-file-dialog-actions-login"]'); - let usernameInput: HTMLInputElement = element.querySelector('#username'); - let passwordInput: HTMLInputElement = element.querySelector('#password'); + const usernameInput: HTMLInputElement = element.querySelector('#username'); + const passwordInput: HTMLInputElement = element.querySelector('#password'); usernameInput.value = 'fakse-user'; passwordInput.value = 'fakse-user'; usernameInput.dispatchEvent(new Event('input')); @@ -105,7 +105,7 @@ describe('AttachFileWidgetDialogComponent', () => { fixture.whenStable().then(() => { expect(element.querySelector('#attach-file-content-node')).not.toBeNull(); loginButton = element.querySelector('button[data-automation-id="attach-file-dialog-actions-login"]'); - let chooseButton = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]'); + const chooseButton = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]'); expect(loginButton).toBeNull(); expect(chooseButton).not.toBeNull(); done(); @@ -137,11 +137,11 @@ describe('AttachFileWidgetDialogComponent', () => { expect(nodeList[0].isFile).toBeTruthy(); done(); }); - let fakeNode: Node = new Node({ id: 'fake', isFile: true}); + const fakeNode: Node = new Node({ id: 'fake', isFile: true}); contentNodePanel.componentInstance.select.emit([fakeNode]); fixture.detectChanges(); fixture.whenStable().then(() => { - let chooseButton: HTMLButtonElement = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]'); + const chooseButton: HTMLButtonElement = element.querySelector('button[data-automation-id="attach-file-dialog-actions-choose"]'); chooseButton.click(); }); }); diff --git a/lib/process-services/content-widget/attach-file-widget-dialog.service.spec.ts b/lib/process-services/content-widget/attach-file-widget-dialog.service.spec.ts index d62c040095..1ab346e198 100644 --- a/lib/process-services/content-widget/attach-file-widget-dialog.service.spec.ts +++ b/lib/process-services/content-widget/attach-file-widget-dialog.service.spec.ts @@ -27,7 +27,6 @@ describe('AttachFileWidgetDialogService', () => { let service: AttachFileWidgetDialogService; let materialDialog: MatDialog; let spyOnDialogOpen: jasmine.Spy; - let afterOpenObservable: Subject<any>; setupTestBed({ imports: [ @@ -40,7 +39,7 @@ describe('AttachFileWidgetDialogService', () => { service = TestBed.get(AttachFileWidgetDialogService); materialDialog = TestBed.get(MatDialog); spyOnDialogOpen = spyOn(materialDialog, 'open').and.returnValue({ - afterOpen: () => afterOpenObservable, + afterOpen: () => of({}), afterClosed: () => of({}), componentInstance: { error: new Subject<any>() diff --git a/lib/process-services/content-widget/attach-file-widget-dialog.service.ts b/lib/process-services/content-widget/attach-file-widget-dialog.service.ts index d6f7c33d8d..bbd00536e7 100644 --- a/lib/process-services/content-widget/attach-file-widget-dialog.service.ts +++ b/lib/process-services/content-widget/attach-file-widget-dialog.service.ts @@ -41,7 +41,7 @@ export class AttachFileWidgetDialogService { * @returns Information about the chosen file(s) */ openLogin(ecmHost: string, actionName?: string, context?: string): Observable<Node[]> { - let titleString: string = `Please log in for ${ecmHost}`; + const titleString: string = `Please log in for ${ecmHost}`; const selected = new Subject<Node[]>(); selected.subscribe({ complete: this.close.bind(this) diff --git a/lib/process-services/content-widget/attach-file-widget.component.ts b/lib/process-services/content-widget/attach-file-widget.component.ts index 683604d6c0..1864a0f199 100644 --- a/lib/process-services/content-widget/attach-file-widget.component.ts +++ b/lib/process-services/content-widget/attach-file-widget.component.ts @@ -130,7 +130,7 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements } openSelectDialogFromFileSource() { - let params = this.field.params; + const params = this.field.params; if (this.isDefinedSourceFolder()) { this.contentDialog.openFileBrowseDialogByFolderId(params.fileSource.selectedFolder.pathId).subscribe( (selections: Node[]) => { @@ -183,10 +183,10 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements openSelectDialog(repository) { const accountIdentifier = 'alfresco-' + repository.id + '-' + repository.name; - let currentECMHost = this.getDomainHost(this.appConfigService.get(AppConfigValues.ECMHOST)); - let chosenRepositoryHost = this.getDomainHost(repository.repositoryUrl); + const currentECMHost = this.getDomainHost(this.appConfigService.get(AppConfigValues.ECMHOST)); + const chosenRepositoryHost = this.getDomainHost(repository.repositoryUrl); if (chosenRepositoryHost !== currentECMHost) { - let formattedRepositoryHost = repository.repositoryUrl.replace('/alfresco', ''); + const formattedRepositoryHost = repository.repositoryUrl.replace('/alfresco', ''); this.attachDialogService.openLogin(formattedRepositoryHost).subscribe( (selections: any[]) => { selections.forEach((node) => node.isExternal = true); @@ -229,7 +229,7 @@ export class AttachFileWidgetComponent extends UploadWidgetComponent implements } private getDomainHost(urlToCheck) { - let result = urlToCheck.match('^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)'); + const result = urlToCheck.match('^(?:https?:\/\/)?(?:[^@\/\n]+@)?(?:www\.)?([^:\/?\n]+)'); return result[1]; } diff --git a/lib/process-services/content-widget/attach-file-widget.components.spec.ts b/lib/process-services/content-widget/attach-file-widget.components.spec.ts index 686b6b62b3..9dafcf1a68 100644 --- a/lib/process-services/content-widget/attach-file-widget.components.spec.ts +++ b/lib/process-services/content-widget/attach-file-widget.components.spec.ts @@ -155,7 +155,7 @@ describe('AttachFileWidgetComponent', () => { spyOn(activitiContentService, 'getAlfrescoRepositories').and.returnValue(of(fakeRepositoryListAnswer)); fixture.detectChanges(); fixture.whenRenderingDone().then(() => { - let attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach'); + const attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach'); expect(attachButton).not.toBeNull(); attachButton.click(); fixture.detectChanges(); @@ -182,7 +182,7 @@ describe('AttachFileWidgetComponent', () => { widget.field.params = <FormFieldMetadata> allSourceParams; fixture.detectChanges(); fixture.whenStable().then(() => { - let attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach'); + const attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach'); expect(attachButton).not.toBeNull(); attachButton.click(); fixture.detectChanges(); @@ -206,7 +206,7 @@ describe('AttachFileWidgetComponent', () => { spyOn(contentNodeDialogService, 'openFileBrowseDialogByFolderId').and.returnValue(of([fakeMinimalNode])); fixture.detectChanges(); fixture.whenStable().then(() => { - let attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach'); + const attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach'); expect(attachButton).not.toBeNull(); attachButton.click(); fixture.detectChanges(); @@ -228,7 +228,7 @@ describe('AttachFileWidgetComponent', () => { spyOn(processContentService, 'createTemporaryRawRelatedContent').and.returnValue(of(fakePngAnswer)); fixture.detectChanges(); fixture.whenStable().then(() => { - let inputDebugElement = fixture.debugElement.query(By.css('#attach-file-attach')); + const inputDebugElement = fixture.debugElement.query(By.css('#attach-file-attach')); inputDebugElement.triggerEventHandler('change', { target: { files: [fakePngAnswer] } }); fixture.detectChanges(); @@ -263,7 +263,7 @@ describe('AttachFileWidgetComponent', () => { spyOn(processContentService, 'createTemporaryRawRelatedContent').and.returnValue(of(fakePngAnswer)); fixture.detectChanges(); fixture.whenStable().then(() => { - let inputDebugElement = fixture.debugElement.query(By.css('#attach-file-attach')); + const inputDebugElement = fixture.debugElement.query(By.css('#attach-file-attach')); inputDebugElement.triggerEventHandler('change', {target: {files: [fakePngAnswer]}}); fixture.detectChanges(); expect(element.querySelector('#file-1155-icon')).not.toBeNull(); @@ -271,7 +271,7 @@ describe('AttachFileWidgetComponent', () => { })); it('should show the action menu', async(() => { - let menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); + const menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); expect(menuButton).not.toBeNull(); menuButton.click(); fixture.detectChanges(); @@ -283,7 +283,7 @@ describe('AttachFileWidgetComponent', () => { })); it('should remove file when remove is clicked', async(() => { - let menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); + const menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); expect(menuButton).not.toBeNull(); menuButton.click(); fixture.detectChanges(); @@ -297,7 +297,7 @@ describe('AttachFileWidgetComponent', () => { it('should download file when download is clicked', async(() => { spyOn(contentService, 'downloadBlob').and.stub(); - let menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); + const menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); expect(menuButton).not.toBeNull(); menuButton.click(); fixture.detectChanges(); @@ -314,7 +314,7 @@ describe('AttachFileWidgetComponent', () => { expect(file).not.toBeNull(); expect(file.id).toBe(1155); }); - let menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); + const menuButton: HTMLButtonElement = <HTMLButtonElement> element.querySelector('#file-1155-option-menu'); expect(menuButton).not.toBeNull(); menuButton.click(); fixture.detectChanges(); diff --git a/lib/process-services/content-widget/attach-folder-widget.component.ts b/lib/process-services/content-widget/attach-folder-widget.component.ts index cab7da468e..0d38d5ff74 100644 --- a/lib/process-services/content-widget/attach-folder-widget.component.ts +++ b/lib/process-services/content-widget/attach-folder-widget.component.ts @@ -71,7 +71,7 @@ export class AttachFolderWidgetComponent extends WidgetComponent implements OnIn } openSelectDialogFromFileSource() { - let params = this.field.params; + const params = this.field.params; if (this.isDefinedSourceFolder()) { this.contentDialog.openFolderBrowseDialogByFolderId(params.folderSource.selectedFolder.pathId).subscribe( (selections: Node[]) => { diff --git a/lib/process-services/mock/process/process.model.mock.ts b/lib/process-services/mock/process/process.model.mock.ts index f318fca076..a338919174 100644 --- a/lib/process-services/mock/process/process.model.mock.ts +++ b/lib/process-services/mock/process/process.model.mock.ts @@ -32,7 +32,7 @@ export class ProcessList { export class SingleProcessList extends ProcessList { constructor(name?: string) { - let instance = new ProcessInstance({ + const instance = new ProcessInstance({ id: '123', name: name }); diff --git a/lib/process-services/people/components/people-list/people-list.component.spec.ts b/lib/process-services/people/components/people-list/people-list.component.spec.ts index f4dbfa0f98..ade64e0a43 100644 --- a/lib/process-services/people/components/people-list/people-list.component.spec.ts +++ b/lib/process-services/people/components/people-list/people-list.component.spec.ts @@ -45,8 +45,8 @@ describe('PeopleListComponent', () => { })); it('should emit row click event', (done) => { - let row = new ObjectDataRow(fakeUser); - let rowEvent = new DataRowEvent(row, null); + const row = new ObjectDataRow(fakeUser); + const rowEvent = new DataRowEvent(row, null); peopleListComponent.clickRow.subscribe((selectedUser) => { expect(selectedUser.id).toEqual(1); @@ -60,12 +60,12 @@ describe('PeopleListComponent', () => { }); it('should emit row action event', (done) => { - let row = new ObjectDataRow(fakeUser); - let removeObj = { + const row = new ObjectDataRow(fakeUser); + const removeObj = { name: 'remove', title: 'Remove' }; - let rowActionEvent = new DataRowActionEvent(row, removeObj); + const rowActionEvent = new DataRowActionEvent(row, removeObj); peopleListComponent.clickAction.subscribe((selectedAction: UserEventModel) => { expect(selectedAction.type).toEqual('remove'); diff --git a/lib/process-services/people/components/people-list/people-list.component.ts b/lib/process-services/people/components/people-list/people-list.component.ts index 964932fa9a..1d080fb23a 100644 --- a/lib/process-services/people/components/people-list/people-list.component.ts +++ b/lib/process-services/people/components/people-list/people-list.component.ts @@ -69,7 +69,7 @@ export class PeopleListComponent implements AfterViewInit, AfterContentInit { onShowRowActionsMenu(event: any) { - let removeAction = { + const removeAction = { title: 'Remove', name: 'remove' }; @@ -80,8 +80,8 @@ export class PeopleListComponent implements AfterViewInit, AfterContentInit { } onExecuteRowAction(event: any) { - let args = event.value; - let action = args.action; + const args = event.value; + const action = args.action; this.clickAction.emit(new UserEventModel({type: action.name, value: args.row.obj})); } } diff --git a/lib/process-services/people/components/people-search-field/people-search-field.component.spec.ts b/lib/process-services/people/components/people-search-field/people-search-field.component.spec.ts index 4f52a77efb..045c42a086 100644 --- a/lib/process-services/people/components/people-search-field/people-search-field.component.spec.ts +++ b/lib/process-services/people/components/people-search-field/people-search-field.component.spec.ts @@ -40,7 +40,7 @@ describe('PeopleSearchFieldComponent', () => { }); it('should have the proper placeholder by default', () => { - let searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement; + const searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement; expect(searchField.placeholder).toBe('ADF_TASK_LIST.PEOPLE.SEARCH_USER'); }); @@ -49,7 +49,7 @@ describe('PeopleSearchFieldComponent', () => { fixture.detectChanges(); - let searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement; + const searchField = debug.query(By.css('[data-automation-id="adf-people-search-input"]')).nativeElement; expect(searchField.placeholder).toBe('Arcadia Bay'); }); diff --git a/lib/process-services/people/components/people-search/people-search.component.spec.ts b/lib/process-services/people/components/people-search/people-search.component.spec.ts index e0f4e18a98..3e447115c2 100644 --- a/lib/process-services/people/components/people-search/people-search.component.spec.ts +++ b/lib/process-services/people/components/people-search/people-search.component.spec.ts @@ -40,7 +40,7 @@ describe('PeopleSearchComponent', () => { let peopleSearchComponent: PeopleSearchComponent; let fixture: ComponentFixture<PeopleSearchComponent>; let element: HTMLElement; - let userArray = [fakeUser, fakeSecondUser]; + const userArray = [fakeUser, fakeSecondUser]; let searchInput: any; setupTestBed({ @@ -80,7 +80,7 @@ describe('PeopleSearchComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); - let gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body'); + const gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body'); expect(gatewayElement).not.toBeNull(); expect(gatewayElement.children.length).toBe(2); done(); @@ -99,7 +99,7 @@ describe('PeopleSearchComponent', () => { fixture.whenStable() .then(() => { peopleSearchComponent.onRowClick(fakeUser); - let addUserButton = <HTMLElement> element.querySelector('#add-people'); + const addUserButton = <HTMLElement> element.querySelector('#add-people'); addUserButton.click(); }); }); @@ -115,14 +115,14 @@ describe('PeopleSearchComponent', () => { fixture.detectChanges(); peopleSearchComponent.onRowClick(fakeUser); - let addUserButton = <HTMLElement> element.querySelector('#add-people'); + const addUserButton = <HTMLElement> element.querySelector('#add-people'); addUserButton.click(); fixture.detectChanges(); fixture.whenStable() .then(() => { fixture.detectChanges(); - let gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body'); + const gatewayElement: any = element.querySelector('#search-people-list .adf-datatable-body'); expect(gatewayElement).not.toBeNull(); expect(gatewayElement.children.length).toBe(1); done(); diff --git a/lib/process-services/people/components/people/people.component.spec.ts b/lib/process-services/people/components/people/people.component.spec.ts index d5804d2bab..d447728913 100644 --- a/lib/process-services/people/components/people/people.component.spec.ts +++ b/lib/process-services/people/components/people/people.component.spec.ts @@ -42,7 +42,7 @@ describe('PeopleComponent', () => { let activitiPeopleComponent: PeopleComponent; let fixture: ComponentFixture<PeopleComponent>; let element: HTMLElement; - let userArray = [fakeUser, fakeSecondUser]; + const userArray = [fakeUser, fakeSecondUser]; let logService: LogService; setupTestBed({ @@ -99,7 +99,7 @@ describe('PeopleComponent', () => { it('should show people involved', async(() => { fixture.whenStable() .then(() => { - let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); + const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); expect(gatewayElement).not.toBeNull(); expect(gatewayElement.children.length).toBe(2); }); @@ -113,7 +113,7 @@ describe('PeopleComponent', () => { fixture.whenStable() .then(() => { fixture.detectChanges(); - let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); + const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); expect(gatewayElement).not.toBeNull(); expect(gatewayElement.children.length).toBe(1); }); @@ -127,7 +127,7 @@ describe('PeopleComponent', () => { fixture.whenStable() .then(() => { fixture.detectChanges(); - let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); + const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); expect(gatewayElement).not.toBeNull(); expect(gatewayElement.children.length).toBe(3); }); @@ -206,7 +206,7 @@ describe('PeopleComponent', () => { fixture.whenStable() .then(() => { fixture.detectChanges(); - let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); + const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); expect(gatewayElement).not.toBeNull(); expect(gatewayElement.children.length).toBe(2); }); @@ -220,7 +220,7 @@ describe('PeopleComponent', () => { fixture.whenStable() .then(() => { fixture.detectChanges(); - let gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); + const gatewayElement: any = element.querySelector('#assignment-people-list .adf-datatable-body'); expect(gatewayElement).not.toBeNull(); expect(gatewayElement.children.length).toBe(2); }); diff --git a/lib/process-services/process-comments/process-comments.component.spec.ts b/lib/process-services/process-comments/process-comments.component.spec.ts index ae0364a3a9..92950fc0e6 100644 --- a/lib/process-services/process-comments/process-comments.component.spec.ts +++ b/lib/process-services/process-comments/process-comments.component.spec.ts @@ -49,17 +49,17 @@ describe('ProcessCommentsComponent', () => { }); it('should load comments when processInstanceId specified', () => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); fixture.detectChanges(); expect(getCommentsSpy).toHaveBeenCalled(); }); it('should emit an error when an error occurs loading comments', () => { - let emitSpy = spyOn(component.error, 'emit'); + const emitSpy = spyOn(component.error, 'emit'); getCommentsSpy.and.returnValue(throwError({})); - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); fixture.detectChanges(); @@ -72,7 +72,7 @@ describe('ProcessCommentsComponent', () => { }); it('should display comments when the process has comments', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); fixture.whenStable().then(() => { @@ -83,18 +83,18 @@ describe('ProcessCommentsComponent', () => { })); it('should display comments count when the process has comments', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); fixture.whenStable().then(() => { fixture.detectChanges(); - let element = fixture.nativeElement.querySelector('#comment-header'); + const element = fixture.nativeElement.querySelector('#comment-header'); expect(element.innerText).toBe('ADF_PROCESS_LIST.DETAILS.COMMENTS.HEADER'); }); })); it('should not display comments when the process has no comments', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); getCommentsSpy.and.returnValue(of([])); @@ -105,7 +105,7 @@ describe('ProcessCommentsComponent', () => { })); it('should not display comments input by default', async(() => { - let change = new SimpleChange(null, '123', true); + const change = new SimpleChange(null, '123', true); component.ngOnChanges({ 'processInstanceId': change }); fixture.whenStable().then(() => { diff --git a/lib/process-services/process-comments/process-comments.component.ts b/lib/process-services/process-comments/process-comments.component.ts index bf0ca7d72e..a797ecc24c 100644 --- a/lib/process-services/process-comments/process-comments.component.ts +++ b/lib/process-services/process-comments/process-comments.component.ts @@ -57,7 +57,7 @@ export class ProcessCommentsComponent implements OnChanges { } ngOnChanges(changes: SimpleChanges) { - let processInstanceId = changes['processInstanceId']; + const processInstanceId = changes['processInstanceId']; if (processInstanceId) { if (processInstanceId.currentValue) { this.getProcessInstanceComments(processInstanceId.currentValue); @@ -73,8 +73,8 @@ export class ProcessCommentsComponent implements OnChanges { this.commentProcessService.getProcessInstanceComments(processInstanceId).subscribe( (res: CommentModel[]) => { res = res.sort((comment1: CommentModel, comment2: CommentModel) => { - let date1 = new Date(comment1.created); - let date2 = new Date(comment2.created); + const date1 = new Date(comment1.created); + const date2 = new Date(comment2.created); return date1 > date2 ? -1 : date1 < date2 ? 1 : 0; }); res.forEach((comment) => { diff --git a/lib/process-services/process-list/components/process-audit.directive.spec.ts b/lib/process-services/process-list/components/process-audit.directive.spec.ts index 3fb3a82b8f..216bfb96ee 100644 --- a/lib/process-services/process-list/components/process-audit.directive.spec.ts +++ b/lib/process-services/process-list/components/process-audit.directive.spec.ts @@ -56,7 +56,7 @@ describe('ProcessAuditDirective', () => { let service: ProcessService; function createFakePdfBlob(): Blob { - let pdfData = atob( + const pdfData = atob( 'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwog' + 'IC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAv' + 'TWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0K' + @@ -99,13 +99,13 @@ describe('ProcessAuditDirective', () => { it('should fetch the pdf Blob when the format is pdf', fakeAsync(() => { component.fileName = 'FakeAuditName'; component.format = 'pdf'; - let blob = createFakePdfBlob(); + const blob = createFakePdfBlob(); spyOn(service, 'fetchProcessAuditPdfById').and.returnValue(of(blob)); spyOn(component, 'onAuditClick').and.callThrough(); fixture.detectChanges(); - let button = fixture.nativeElement.querySelector('#auditButton'); + const button = fixture.nativeElement.querySelector('#auditButton'); fixture.whenStable().then(() => { fixture.detectChanges(); @@ -141,7 +141,7 @@ describe('ProcessAuditDirective', () => { fixture.detectChanges(); - let button = fixture.nativeElement.querySelector('#auditButton'); + const button = fixture.nativeElement.querySelector('#auditButton'); fixture.whenStable().then(() => { fixture.detectChanges(); @@ -155,13 +155,13 @@ describe('ProcessAuditDirective', () => { it('should fetch the pdf Blob as default when the format is UNKNOW', fakeAsync(() => { component.fileName = 'FakeAuditName'; component.format = 'fakeFormat'; - let blob = createFakePdfBlob(); + const blob = createFakePdfBlob(); spyOn(service, 'fetchProcessAuditPdfById').and.returnValue(of(blob)); spyOn(component, 'onAuditClick').and.callThrough(); fixture.detectChanges(); - let button = fixture.nativeElement.querySelector('#auditButton'); + const button = fixture.nativeElement.querySelector('#auditButton'); fixture.whenStable().then(() => { fixture.detectChanges(); diff --git a/lib/process-services/process-list/components/process-filters.component.spec.ts b/lib/process-services/process-list/components/process-filters.component.spec.ts index 081327a1c9..d7f18bb46d 100644 --- a/lib/process-services/process-list/components/process-filters.component.spec.ts +++ b/lib/process-services/process-list/components/process-filters.component.spec.ts @@ -85,7 +85,7 @@ describe('ProcessFiltersComponent', () => { it('should return the filter task list', (done) => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); filterList.success.subscribe((res) => { @@ -104,7 +104,7 @@ describe('ProcessFiltersComponent', () => { it('should select the Running process filter', (done) => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); expect(filterList.currentFilter).toBeUndefined(); @@ -121,7 +121,7 @@ describe('ProcessFiltersComponent', () => { it('should emit an event when a filter is selected', (done) => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); expect(filterList.currentFilter).toBeUndefined(); @@ -139,11 +139,11 @@ describe('ProcessFiltersComponent', () => { spyOn(appsProcessService, 'getDeployedApplicationsByName').and.returnValue(from(Promise.resolve({ id: 1 }))); spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); - let change = new SimpleChange(null, 'test', true); + const change = new SimpleChange(null, 'test', true); filterList.ngOnChanges({ 'appName': change }); filterList.success.subscribe((res) => { - let deployApp: any = appsProcessService.getDeployedApplicationsByName; + const deployApp: any = appsProcessService.getDeployedApplicationsByName; expect(deployApp.calls.count()).toEqual(1); expect(res).toBeDefined(); done(); @@ -156,7 +156,7 @@ describe('ProcessFiltersComponent', () => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(mockErrorFilterPromise)); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); filterList.error.subscribe((err) => { @@ -171,7 +171,7 @@ describe('ProcessFiltersComponent', () => { spyOn(appsProcessService, 'getDeployedApplicationsByName').and.returnValue(from(mockErrorFilterPromise)); const appId = 'fake-app'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appName': change }); filterList.error.subscribe((err) => { @@ -183,7 +183,7 @@ describe('ProcessFiltersComponent', () => { }); it('should emit an event when a filter is selected', (done) => { - let currentFilter = new FilterProcessRepresentationModel({ + const currentFilter = new FilterProcessRepresentationModel({ id: 10, name: 'FakeInvolvedTasks', filter: { state: 'open', assignment: 'fake-involved' } @@ -203,7 +203,7 @@ describe('ProcessFiltersComponent', () => { spyOn(filterList, 'getFiltersByAppId').and.stub(); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId); @@ -213,7 +213,7 @@ describe('ProcessFiltersComponent', () => { spyOn(filterList, 'getFiltersByAppId').and.stub(); const appId = null; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); expect(filterList.getFiltersByAppId).toHaveBeenCalledWith(appId); @@ -223,14 +223,14 @@ describe('ProcessFiltersComponent', () => { spyOn(filterList, 'getFiltersByAppName').and.stub(); const appName = 'fake-app-name'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); filterList.ngOnChanges({ 'appName': change }); expect(filterList.getFiltersByAppName).toHaveBeenCalledWith(appName); }); it('should return the current filter after one is selected', () => { - let filter = new FilterProcessRepresentationModel({ + const filter = new FilterProcessRepresentationModel({ name: 'FakeMyTasks', filter: { state: 'open', assignment: 'fake-assignee' } }); @@ -245,7 +245,7 @@ describe('ProcessFiltersComponent', () => { filterList.filterParam = new FilterProcessRepresentationModel({ id: 20 }); const appId = 1; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); @@ -265,7 +265,7 @@ describe('ProcessFiltersComponent', () => { filterList.filterParam = new FilterProcessRepresentationModel({ name: 'FakeMyTasks' }); const appId = 1; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); @@ -285,7 +285,7 @@ describe('ProcessFiltersComponent', () => { filterList.filterParam = new FilterProcessRepresentationModel({}); const appId = 1; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); filterList.ngOnChanges({ 'appId': change }); @@ -302,13 +302,13 @@ describe('ProcessFiltersComponent', () => { it('should attach specific icon for each filter if hasIcon is true', (done) => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); filterList.showIcon = true; - let change = new SimpleChange(undefined, 1, true); + const change = new SimpleChange(undefined, 1, true); filterList.ngOnChanges({ 'appId': change }); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); expect(filterList.filters.length).toBe(3); - let filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); + const filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); expect(filters.length).toBe(3); expect(filters[0].nativeElement.innerText).toContain('dashboard'); expect(filters[1].nativeElement.innerText).toContain('shuffle'); @@ -320,12 +320,12 @@ describe('ProcessFiltersComponent', () => { it('should not attach icons for each filter if hasIcon is false', (done) => { spyOn(processFilterService, 'getProcessFilters').and.returnValue(from(fakeGlobalFilterPromise)); filterList.showIcon = false; - let change = new SimpleChange(undefined, 1, true); + const change = new SimpleChange(undefined, 1, true); filterList.ngOnChanges({ 'appId': change }); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); + const filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); expect(filters.length).toBe(0); done(); }); diff --git a/lib/process-services/process-list/components/process-instance-details.component.spec.ts b/lib/process-services/process-list/components/process-instance-details.component.spec.ts index e205072a17..ae23a9baae 100644 --- a/lib/process-services/process-list/components/process-instance-details.component.spec.ts +++ b/lib/process-services/process-list/components/process-instance-details.component.spec.ts @@ -72,7 +72,7 @@ describe('ProcessInstanceDetailsComponent', () => { component.ngOnChanges({ 'processInstanceId': new SimpleChange(null, '123', true) }); fixture.whenStable().then(() => { fixture.detectChanges(); - let headerEl: DebugElement = fixture.debugElement.query(By.css('.mat-card-title ')); + const headerEl: DebugElement = fixture.debugElement.query(By.css('.mat-card-title ')); expect(headerEl).not.toBeNull(); expect(headerEl.nativeElement.innerText).toBe('Process 123'); }); @@ -84,7 +84,7 @@ describe('ProcessInstanceDetailsComponent', () => { component.ngOnChanges({ 'processInstanceId': new SimpleChange(null, '123', true) }); fixture.whenStable().then(() => { fixture.detectChanges(); - let headerEl: DebugElement = fixture.debugElement.query(By.css('.mat-card-title ')); + const headerEl: DebugElement = fixture.debugElement.query(By.css('.mat-card-title ')); expect(headerEl).not.toBeNull(); expect(headerEl.nativeElement.innerText).toBe('My Process - Nov 10, 2016, 3:37:30 AM'); }); @@ -92,8 +92,8 @@ describe('ProcessInstanceDetailsComponent', () => { describe('change detection', () => { - let change = new SimpleChange('123', '456', true); - let nullChange = new SimpleChange('123', null, true); + const change = new SimpleChange('123', '456', true); + const nullChange = new SimpleChange('123', null, true); beforeEach(async(() => { component.processInstanceId = '123'; @@ -130,7 +130,7 @@ describe('ProcessInstanceDetailsComponent', () => { ended: null }); fixture.detectChanges(); - let buttonEl = fixture.debugElement.query(By.css('[data-automation-id="header-status"] button')); + const buttonEl = fixture.debugElement.query(By.css('[data-automation-id="header-status"] button')); expect(buttonEl).not.toBeNull(); }); @@ -143,7 +143,7 @@ describe('ProcessInstanceDetailsComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let diagramButton = fixture.debugElement.query(By.css('#show-diagram-button')); + const diagramButton = fixture.debugElement.query(By.css('#show-diagram-button')); expect(diagramButton).not.toBeNull(); expect(diagramButton.nativeElement.disabled).toBe(false); }); @@ -157,7 +157,7 @@ describe('ProcessInstanceDetailsComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let diagramButton = fixture.debugElement.query(By.css('#show-diagram-button')); + const diagramButton = fixture.debugElement.query(By.css('#show-diagram-button')); expect(diagramButton).not.toBeNull(); expect(diagramButton.nativeElement.disabled).toBe(true); }); diff --git a/lib/process-services/process-list/components/process-instance-details.component.ts b/lib/process-services/process-list/components/process-instance-details.component.ts index bb55d144f6..1d2ca0271a 100644 --- a/lib/process-services/process-list/components/process-instance-details.component.ts +++ b/lib/process-services/process-list/components/process-instance-details.component.ts @@ -78,7 +78,7 @@ export class ProcessInstanceDetailsComponent implements OnChanges { } ngOnChanges(changes: SimpleChanges) { - let processInstanceId = changes['processInstanceId']; + const processInstanceId = changes['processInstanceId']; if (processInstanceId && !processInstanceId.currentValue) { this.reset(); return; @@ -134,7 +134,7 @@ export class ProcessInstanceDetailsComponent implements OnChanges { } getFormatDate(value, format: string) { - let datePipe = new DatePipe('en-US'); + const datePipe = new DatePipe('en-US'); try { return datePipe.transform(value, format); } catch (err) { diff --git a/lib/process-services/process-list/components/process-instance-header.component.spec.ts b/lib/process-services/process-list/components/process-instance-header.component.spec.ts index 021f773389..c3bdbe83c5 100644 --- a/lib/process-services/process-list/components/process-instance-header.component.spec.ts +++ b/lib/process-services/process-list/components/process-instance-header.component.spec.ts @@ -54,7 +54,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.ended = null; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-status"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-status"]'); expect(valueEl.innerText).toBe('Running'); }); @@ -62,7 +62,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.ended = new Date('2016-11-03'); component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-status"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-status"]'); expect(valueEl.innerText).toBe('Completed'); }); @@ -70,7 +70,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.ended = new Date('2016-11-03'); component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]'); expect(valueEl.innerText).toBe('Nov 03 2016'); }); @@ -78,7 +78,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.ended = null; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-ended"]'); expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.END_DATE_DEFAULT'); }); @@ -86,7 +86,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.processDefinitionCategory = 'Accounts'; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-category"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-category"]'); expect(valueEl.innerText).toBe('Accounts'); }); @@ -94,7 +94,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.processDefinitionCategory = null; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-category"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-category"]'); expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.CATEGORY_DEFAULT'); }); @@ -102,7 +102,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.started = new Date('2016-11-03'); component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-created"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-dateitem-created"]'); expect(valueEl.innerText).toBe('Nov 03 2016'); }); @@ -110,7 +110,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.startedBy = {firstName: 'Admin', lastName: 'User'}; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-assignee"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-assignee"]'); expect(valueEl.innerText).toBe('Admin User'); }); @@ -118,7 +118,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.id = '123'; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-id"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-id"]'); expect(valueEl.innerText).toBe('123'); }); @@ -126,7 +126,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.processDefinitionDescription = 'Test process'; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]'); expect(valueEl.innerText).toBe('Test process'); }); @@ -134,7 +134,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.processDefinitionDescription = null; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-description"]'); expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.DESCRIPTION_DEFAULT'); }); @@ -142,7 +142,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.businessKey = 'fakeBusinessKey'; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]'); expect(valueEl.innerText).toBe('fakeBusinessKey'); }); @@ -150,7 +150,7 @@ describe('ProcessInstanceHeaderComponent', () => { component.processInstance.businessKey = null; component.ngOnChanges({}); fixture.detectChanges(); - let valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]'); + const valueEl = fixture.nativeElement.querySelector('[data-automation-id="card-textitem-value-businessKey"]'); expect(valueEl.innerText).toBe('ADF_PROCESS_LIST.PROPERTIES.BUSINESS_KEY_DEFAULT'); }); diff --git a/lib/process-services/process-list/components/process-instance-tasks.component.spec.ts b/lib/process-services/process-list/components/process-instance-tasks.component.spec.ts index 9bac030ed4..127bb3f8d0 100644 --- a/lib/process-services/process-list/components/process-instance-tasks.component.spec.ts +++ b/lib/process-services/process-list/components/process-instance-tasks.component.spec.ts @@ -36,7 +36,7 @@ describe('ProcessInstanceTasksComponent', () => { let service: ProcessService; // let getProcessTasksSpy: jasmine.Spy; - let exampleProcessInstance = new ProcessInstance({ id: '123' }); + const exampleProcessInstance = new ProcessInstance({ id: '123' }); setupTestBed({ imports: [ @@ -61,7 +61,7 @@ describe('ProcessInstanceTasksComponent', () => { component.processInstanceDetails = undefined; fixture.detectChanges(); fixture.whenStable().then(() => { - let msgEl = fixture.debugElement.query(By.css('[data-automation-id="active-tasks-none"]')); + const msgEl = fixture.debugElement.query(By.css('[data-automation-id="active-tasks-none"]')); expect(msgEl).not.toBeNull(); }); })); @@ -70,7 +70,7 @@ describe('ProcessInstanceTasksComponent', () => { component.processInstanceDetails = undefined; fixture.detectChanges(); fixture.whenStable().then(() => { - let msgEl = fixture.debugElement.query(By.css('[data-automation-id="completed-tasks-none"]')); + const msgEl = fixture.debugElement.query(By.css('[data-automation-id="completed-tasks-none"]')); expect(msgEl).not.toBeNull(); }); })); @@ -78,37 +78,37 @@ describe('ProcessInstanceTasksComponent', () => { it('should not render active tasks list if no process instance ID provided', () => { component.processInstanceDetails = undefined; fixture.detectChanges(); - let listEl = fixture.debugElement.query(By.css('[data-automation-id="active-tasks"]')); + const listEl = fixture.debugElement.query(By.css('[data-automation-id="active-tasks"]')); expect(listEl).toBeNull(); }); it('should not render completed tasks list if no process instance ID provided', () => { component.processInstanceDetails = undefined; fixture.detectChanges(); - let listEl = fixture.debugElement.query(By.css('[data-automation-id="completed-tasks"]')); + const listEl = fixture.debugElement.query(By.css('[data-automation-id="completed-tasks"]')); expect(listEl).toBeNull(); }); it('should display active tasks', async(() => { - let change = new SimpleChange(null, exampleProcessInstance, true); + const change = new SimpleChange(null, exampleProcessInstance, true); fixture.detectChanges(); component.ngOnChanges({ 'processInstanceDetails': change }); fixture.whenStable().then(() => { fixture.detectChanges(); component.ngOnChanges({ 'processInstanceDetails': change }); - let listEl = fixture.debugElement.query(By.css('[data-automation-id="active-tasks"]')); + const listEl = fixture.debugElement.query(By.css('[data-automation-id="active-tasks"]')); expect(listEl).not.toBeNull(); expect(listEl.queryAll(By.css('mat-list-item')).length).toBe(1); }); })); it('should display completed tasks', async(() => { - let change = new SimpleChange(null, exampleProcessInstance, true); + const change = new SimpleChange(null, exampleProcessInstance, true); fixture.detectChanges(); component.ngOnChanges({ 'processInstanceDetails': change }); fixture.whenStable().then(() => { fixture.detectChanges(); - let listEl = fixture.debugElement.query(By.css('[data-automation-id="completed-tasks"]')); + const listEl = fixture.debugElement.query(By.css('[data-automation-id="completed-tasks"]')); expect(listEl).not.toBeNull(); expect(listEl.queryAll(By.css('mat-list-item')).length).toBe(1); }); diff --git a/lib/process-services/process-list/components/process-instance-tasks.component.ts b/lib/process-services/process-list/components/process-instance-tasks.component.ts index 932b56a881..59c5e08b91 100644 --- a/lib/process-services/process-list/components/process-instance-tasks.component.ts +++ b/lib/process-services/process-list/components/process-instance-tasks.component.ts @@ -87,7 +87,7 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges) { - let processInstanceDetails = changes['processInstanceDetails']; + const processInstanceDetails = changes['processInstanceDetails']; if (processInstanceDetails && processInstanceDetails.currentValue) { this.load(processInstanceDetails.currentValue.id); } @@ -148,7 +148,7 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges { } getFormatDate(value, format: string) { - let datePipe = new DatePipe('en-US'); + const datePipe = new DatePipe('en-US'); try { return datePipe.transform(value, format); } catch (err) { @@ -157,7 +157,7 @@ export class ProcessInstanceTasksComponent implements OnInit, OnChanges { } clickTask($event: any, task: TaskDetailsModel) { - let args = new TaskDetailsEvent(task); + const args = new TaskDetailsEvent(task); this.taskClick.emit(args); } diff --git a/lib/process-services/process-list/components/process-list.component.spec.ts b/lib/process-services/process-list/components/process-list.component.spec.ts index 74bf129e59..b6b6e46ff6 100644 --- a/lib/process-services/process-list/components/process-list.component.spec.ts +++ b/lib/process-services/process-list/components/process-list.component.spec.ts @@ -113,7 +113,7 @@ describe('ProcessInstanceListComponent', () => { }); it('should emit onSuccess event when process instances loaded', fakeAsync(() => { - let emitSpy = spyOn(component.success, 'emit'); + const emitSpy = spyOn(component.success, 'emit'); component.appId = 1; component.state = 'open'; fixture.detectChanges(); @@ -183,7 +183,7 @@ describe('ProcessInstanceListComponent', () => { }); it('should return an empty list when the response is wrong', fakeAsync(() => { - let mockError = 'Fake server error'; + const mockError = 'Fake server error'; getProcessInstancesSpy.and.returnValue(throwError(mockError)); component.appId = 1; component.state = 'open'; @@ -197,7 +197,7 @@ describe('ProcessInstanceListComponent', () => { component.state = 'open'; fixture.detectChanges(); tick(); - let emitSpy = spyOn(component.success, 'emit'); + const emitSpy = spyOn(component.success, 'emit'); component.reload(); tick(); expect(emitSpy).toHaveBeenCalledWith(fakeProcessInstance); @@ -223,10 +223,10 @@ describe('ProcessInstanceListComponent', () => { }); it('should emit row click event', (done) => { - let row = new ObjectDataRow({ + const row = new ObjectDataRow({ id: '999' }); - let rowEvent = new DataRowEvent(row, null); + const rowEvent = new DataRowEvent(row, null); component.rowClick.subscribe((taskId) => { expect(taskId).toEqual('999'); @@ -239,7 +239,7 @@ describe('ProcessInstanceListComponent', () => { it('should emit row click event on Enter', (done) => { let prevented = false; - let keyEvent = new CustomEvent('Keyboard event', { detail: { + const keyEvent = new CustomEvent('Keyboard event', { detail: { keyboardEvent: { key: 'Enter' }, row: new ObjectDataRow({ id: '999' }) }}); @@ -258,7 +258,7 @@ describe('ProcessInstanceListComponent', () => { it('should NOT emit row click event on every other key', async(() => { let triggered = false; - let keyEvent = new CustomEvent('Keyboard event', { detail: { + const keyEvent = new CustomEvent('Keyboard event', { detail: { keyboardEvent: { key: 'Space' }, row: new ObjectDataRow({ id: 999 }) }}); @@ -290,7 +290,7 @@ describe('ProcessInstanceListComponent', () => { it('should reload the list when the appId parameter changes', (done) => { const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -306,7 +306,7 @@ describe('ProcessInstanceListComponent', () => { it('should reload the list when the state parameter changes', (done) => { const state = 'open'; - let change = new SimpleChange(null, state, true); + const change = new SimpleChange(null, state, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -322,7 +322,7 @@ describe('ProcessInstanceListComponent', () => { it('should reload the list when the sort parameter changes', (done) => { const sort = 'created-desc'; - let change = new SimpleChange(null, sort, true); + const change = new SimpleChange(null, sort, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -338,7 +338,7 @@ describe('ProcessInstanceListComponent', () => { it('should reload the process list when the processDefinitionId parameter changes', (done) => { const processDefinitionId = 'SimpleProcess:1:10'; - let change = new SimpleChange(null, processDefinitionId, true); + const change = new SimpleChange(null, processDefinitionId, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -354,7 +354,7 @@ describe('ProcessInstanceListComponent', () => { it('should reload the process list when the processDefinitionId parameter changes to null', (done) => { const processDefinitionId = null; - let change = new SimpleChange('SimpleProcess:1:10', processDefinitionId, false); + const change = new SimpleChange('SimpleProcess:1:10', processDefinitionId, false); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -370,7 +370,7 @@ describe('ProcessInstanceListComponent', () => { it('should reload the process list when the processInstanceId parameter changes', (done) => { const processInstanceId = '123'; - let change = new SimpleChange(null, processInstanceId, true); + const change = new SimpleChange(null, processInstanceId, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -386,7 +386,7 @@ describe('ProcessInstanceListComponent', () => { it('should reload the process list when the processInstanceId parameter changes to null', (done) => { const processInstanceId = null; - let change = new SimpleChange('123', processInstanceId, false); + const change = new SimpleChange('123', processInstanceId, false); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -486,7 +486,7 @@ describe('Process List: Custom EmptyTemplateComponent', () => { it('should render the custom template', (done) => { fixture.whenStable().then(() => { fixture.detectChanges(); - let title = fixture.debugElement.query(By.css('#custom-id')); + const title = fixture.debugElement.query(By.css('#custom-id')); expect(title).not.toBeNull(); expect(title.nativeElement.innerText).toBe('No Process Instance'); expect(fixture.debugElement.query(By.css('.adf-empty-content'))).toBeNull(); diff --git a/lib/process-services/process-list/components/process-list.component.ts b/lib/process-services/process-list/components/process-list.component.ts index 6aa4f6d87c..80e61efda9 100644 --- a/lib/process-services/process-list/components/process-list.component.ts +++ b/lib/process-services/process-list/components/process-list.component.ts @@ -173,13 +173,13 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On private isPropertyChanged(changes: SimpleChanges): boolean { let changed: boolean = false; - let appId = changes['appId']; - let processDefinitionId = changes['processDefinitionId']; - let processInstanceId = changes['processInstanceId']; - let state = changes['state']; - let sort = changes['sort']; - let page = changes['page']; - let size = changes['size']; + const appId = changes['appId']; + const processDefinitionId = changes['processDefinitionId']; + const processInstanceId = changes['processInstanceId']; + const state = changes['state']; + const sort = changes['sort']; + const page = changes['page']; + const size = changes['size']; if (appId && appId.currentValue) { changed = true; @@ -232,7 +232,7 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On selectFirst() { if (this.selectFirstRow) { if (!this.isListEmpty()) { - let dataRow = this.rows[0]; + const dataRow = this.rows[0]; dataRow.isSelected = true; this.currentInstanceId = dataRow['id']; } else { @@ -260,7 +260,7 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On * @param event */ onRowClick(event: DataRowEvent) { - let item = event; + const item = event; this.currentInstanceId = item.value.getValue('id'); this.rowClick.emit(this.currentInstanceId); } @@ -302,7 +302,7 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On } getFormatDate(value, format: string) { - let datePipe = new DatePipe('en-US'); + const datePipe = new DatePipe('en-US'); try { return datePipe.transform(value, format); } catch (err) { @@ -311,7 +311,7 @@ export class ProcessInstanceListComponent extends DataTableSchema implements On } private createRequestNode() { - let requestNode = { + const requestNode = { appDefinitionId: this.appId, processDefinitionId: this.processDefinitionId, processInstanceId: this.processInstanceId, diff --git a/lib/process-services/process-list/components/start-process.component.spec.ts b/lib/process-services/process-list/components/start-process.component.spec.ts index 2060b31806..505eff8efd 100644 --- a/lib/process-services/process-list/components/start-process.component.spec.ts +++ b/lib/process-services/process-list/components/start-process.component.spec.ts @@ -81,7 +81,7 @@ describe('StartFormComponent', () => { beforeEach(() => { fixture.detectChanges(); component.name = 'My new process'; - let change = new SimpleChange(null, 123, true); + const change = new SimpleChange(null, 123, true); component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); }); @@ -94,7 +94,7 @@ describe('StartFormComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let startBtn = fixture.nativeElement.querySelector('#button-start'); + const startBtn = fixture.nativeElement.querySelector('#button-start'); expect(startBtn.disabled).toBe(false); }); })); @@ -105,7 +105,7 @@ describe('StartFormComponent', () => { component.processDefinitionInput.setValue(testProcessDef.name); fixture.detectChanges(); fixture.whenStable().then(() => { - let startBtn = fixture.nativeElement.querySelector('#button-start'); + const startBtn = fixture.nativeElement.querySelector('#button-start'); expect(startBtn.disabled).toBe(true); }); })); @@ -114,7 +114,7 @@ describe('StartFormComponent', () => { component.selectedProcessDef = null; fixture.detectChanges(); fixture.whenStable().then(() => { - let startBtn = fixture.nativeElement.querySelector('#button-start'); + const startBtn = fixture.nativeElement.querySelector('#button-start'); expect(startBtn.disabled).toBe(true); }); })); @@ -125,7 +125,7 @@ describe('StartFormComponent', () => { beforeEach(() => { fixture.detectChanges(); getDefinitionsSpy.and.returnValue(of(testProcessDefWithForm)); - let change = new SimpleChange(null, 123, true); + const change = new SimpleChange(null, 123, true); component.ngOnChanges({ 'appId': change }); }); @@ -148,15 +148,15 @@ describe('StartFormComponent', () => { component.name = 'My new process'; fixture.detectChanges(); fixture.whenStable().then(() => { - let startBtn = fixture.nativeElement.querySelector('#button-start'); + const startBtn = fixture.nativeElement.querySelector('#button-start'); expect(startBtn).toBeNull(); }); })); it('should emit cancel event on cancel Button', async(() => { fixture.detectChanges(); - let cancelButton = fixture.nativeElement.querySelector('#cancel_process'); - let cancelSpy: jasmine.Spy = spyOn(component.cancel, 'emit'); + const cancelButton = fixture.nativeElement.querySelector('#cancel_process'); + const cancelSpy: jasmine.Spy = spyOn(component.cancel, 'emit'); cancelButton.click(); fixture.detectChanges(); fixture.whenStable().then(() => { @@ -218,7 +218,7 @@ describe('StartFormComponent', () => { it('should display the correct number of processes in the select list', () => { fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('mat-select'); + const selectElement = fixture.nativeElement.querySelector('mat-select'); expect(selectElement.children.length).toBe(1); }); }); @@ -227,8 +227,8 @@ describe('StartFormComponent', () => { component.processDefinitions = testMultipleProcessDefs; fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger'); - let optionElement = fixture.nativeElement.querySelectorAll('mat-option'); + const selectElement = fixture.nativeElement.querySelector('mat-select > .mat-select-trigger'); + const optionElement = fixture.nativeElement.querySelectorAll('mat-option'); selectElement.click(); expect(selectElement).not.toBeNull(); expect(selectElement).toBeDefined(); @@ -244,7 +244,7 @@ describe('StartFormComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let errorEl = fixture.nativeElement.querySelector('#error-message'); + const errorEl = fixture.nativeElement.querySelector('#error-message'); expect(errorEl).not.toBeNull('Expected error message to be present'); expect(errorEl.innerText.trim()).toBe('ADF_PROCESS_LIST.START_PROCESS.ERROR.LOAD_PROCESS_DEFS'); }); @@ -304,7 +304,7 @@ describe('StartFormComponent', () => { component.ngOnChanges({}); fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); + const selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); expect(selectElement).toBeNull(); }); })); @@ -318,7 +318,7 @@ describe('StartFormComponent', () => { component.ngOnChanges({}); fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); + const selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); expect(selectElement).not.toBeNull(); }); })); @@ -331,7 +331,7 @@ describe('StartFormComponent', () => { component.ngOnChanges({}); fixture.detectChanges(); fixture.whenStable().then(() => { - let selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); + const selectElement = fixture.nativeElement.querySelector('button#adf-select-process-dropdown'); expect(selectElement).not.toBeNull(); }); })); @@ -340,7 +340,7 @@ describe('StartFormComponent', () => { describe('input changes', () => { - let change = new SimpleChange(123, 456, true); + const change = new SimpleChange(123, 456, true); beforeEach(async(() => { component.appId = 123; @@ -403,9 +403,9 @@ describe('StartFormComponent', () => { })); it('should call service to start process with the variables setted', async(() => { - let inputProcessVariable: ProcessInstanceVariable[] = []; + const inputProcessVariable: ProcessInstanceVariable[] = []; - let variable: ProcessInstanceVariable = {}; + const variable: ProcessInstanceVariable = {}; variable.name = 'nodeId'; variable.value = 'id'; @@ -420,7 +420,7 @@ describe('StartFormComponent', () => { })); it('should output start event when process started successfully', async(() => { - let emitSpy = spyOn(component.start, 'emit'); + const emitSpy = spyOn(component.start, 'emit'); component.selectedProcessDef = testProcessDef; component.startProcess(); fixture.whenStable().then(() => { @@ -429,8 +429,8 @@ describe('StartFormComponent', () => { })); it('should throw error event when process cannot be started', async(() => { - let errorSpy = spyOn(component.error, 'error'); - let error = { message: 'My error' }; + const errorSpy = spyOn(component.error, 'error'); + const error = { message: 'My error' }; startProcessSpy = startProcessSpy.and.returnValue(throwError(error)); component.selectedProcessDef = testProcessDef; component.startProcess(); @@ -446,14 +446,14 @@ describe('StartFormComponent', () => { component.startProcess(); fixture.detectChanges(); fixture.whenStable().then(() => { - let errorEl = fixture.nativeElement.querySelector('#error-message'); + const errorEl = fixture.nativeElement.querySelector('#error-message'); expect(errorEl).not.toBeNull(); expect(errorEl.innerText.trim()).toBe('ADF_PROCESS_LIST.START_PROCESS.ERROR.START'); }); })); it('should emit start event when start select a process and add a name', (done) => { - let disposableStart = component.start.subscribe(() => { + const disposableStart = component.start.subscribe(() => { disposableStart.unsubscribe(); done(); }); @@ -467,7 +467,7 @@ describe('StartFormComponent', () => { it('should not emit start event when start the process without select a process and name', () => { component.name = null; component.selectedProcessDef = null; - let startSpy: jasmine.Spy = spyOn(component.start, 'emit'); + const startSpy: jasmine.Spy = spyOn(component.start, 'emit'); component.startProcess(); fixture.detectChanges(); expect(startSpy).not.toHaveBeenCalled(); @@ -475,7 +475,7 @@ describe('StartFormComponent', () => { it('should not emit start event when start the process without name', () => { component.name = null; - let startSpy: jasmine.Spy = spyOn(component.start, 'emit'); + const startSpy: jasmine.Spy = spyOn(component.start, 'emit'); component.startProcess(); fixture.detectChanges(); expect(startSpy).not.toHaveBeenCalled(); @@ -483,7 +483,7 @@ describe('StartFormComponent', () => { it('should not emit start event when start the process without select a process', () => { component.selectedProcessDef = null; - let startSpy: jasmine.Spy = spyOn(component.start, 'emit'); + const startSpy: jasmine.Spy = spyOn(component.start, 'emit'); component.startProcess(); fixture.detectChanges(); expect(startSpy).not.toHaveBeenCalled(); @@ -493,7 +493,7 @@ describe('StartFormComponent', () => { component.name = 'my:process1'; component.selectedProcessDef = testProcessDef; - let disposableStart = component.start.subscribe(() => { + const disposableStart = component.start.subscribe(() => { disposableStart.unsubscribe(); done(); }); diff --git a/lib/process-services/process-list/components/start-process.component.ts b/lib/process-services/process-list/components/start-process.component.ts index 89fd20f10b..a4dc0e0ac8 100644 --- a/lib/process-services/process-list/components/start-process.component.ts +++ b/lib/process-services/process-list/components/start-process.component.ts @@ -137,7 +137,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit { private _filter(value: string): ProcessDefinitionRepresentation[] { if (value !== null && value !== undefined) { const filterValue = value.toLowerCase(); - let filteredProcess = this.processDefinitions.filter((option) => option.name.toLowerCase().includes(filterValue)); + const filteredProcess = this.processDefinitions.filter((option) => option.name.toLowerCase().includes(filterValue)); if (this.processFilterSelector) { this.selectedProcessDef = this.getSelectedProcess(filterValue); @@ -170,7 +170,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit { } if (this.processDefinitionName) { - let selectedProcess = this.processDefinitions.find((currentProcessDefinition) => { + const selectedProcess = this.processDefinitions.find((currentProcessDefinition) => { return currentProcessDefinition.name === this.processDefinitionName; }); if (selectedProcess) { @@ -199,11 +199,11 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit { } moveNodeFromCStoPS() { - let accountIdentifier = this.getAlfrescoRepositoryName(); + const accountIdentifier = this.getAlfrescoRepositoryName(); - for (let key in this.values) { + for (const key in this.values) { if (this.values.hasOwnProperty(key)) { - let currentValue = this.values[key]; + const currentValue = this.values[key]; if (currentValue.isFile) { this.activitiContentService.applyAlfrescoNode(currentValue, null, accountIdentifier).subscribe((res) => { @@ -217,7 +217,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit { public startProcess(outcome?: string) { if (this.selectedProcessDef && this.selectedProcessDef.id && this.name) { this.resetErrorMessage(); - let formValues = this.startForm ? this.startForm.form.values : undefined; + const formValues = this.startForm ? this.startForm.form.values : undefined; this.activitiProcess.startProcess(this.selectedProcessDef.id, this.name, outcome, formValues, this.variables).subscribe( (res) => { this.name = ''; diff --git a/lib/process-services/process-list/services/process-filter.service.spec.ts b/lib/process-services/process-list/services/process-filter.service.spec.ts index 3e4d6bc088..71a9e71a68 100644 --- a/lib/process-services/process-list/services/process-filter.service.spec.ts +++ b/lib/process-services/process-list/services/process-filter.service.spec.ts @@ -163,7 +163,7 @@ describe('Process filter', () => { .callFake((processfilter: FilterProcessRepresentationModel) => Promise.resolve(processfilter)); }); - let filter = fakeProcessFilters.data[0]; + const filter = fakeProcessFilters.data[0]; it('should call the API to create the filter', () => { service.addProcessFilter(filter); diff --git a/lib/process-services/process-list/services/process-filter.service.ts b/lib/process-services/process-list/services/process-filter.service.ts index 8f70071733..152ec83179 100644 --- a/lib/process-services/process-list/services/process-filter.service.ts +++ b/lib/process-services/process-list/services/process-filter.service.ts @@ -38,9 +38,9 @@ export class ProcessFilterService { return from(this.callApiProcessFilters(appId)) .pipe( map((response: any) => { - let filters: FilterProcessRepresentationModel[] = []; + const filters: FilterProcessRepresentationModel[] = []; response.data.forEach((filter: FilterProcessRepresentationModel) => { - let filterModel = new FilterProcessRepresentationModel(filter); + const filterModel = new FilterProcessRepresentationModel(filter); filters.push(filterModel); }); return filters; @@ -87,14 +87,14 @@ export class ProcessFilterService { * @returns Default filters just created */ public createDefaultFilters(appId: number): Observable<FilterProcessRepresentationModel[]> { - let runningFilter = this.getRunningFilterInstance(appId); - let runningObservable = this.addProcessFilter(runningFilter); + const runningFilter = this.getRunningFilterInstance(appId); + const runningObservable = this.addProcessFilter(runningFilter); - let completedFilter = this.getCompletedFilterInstance(appId); - let completedObservable = this.addProcessFilter(completedFilter); + const completedFilter = this.getCompletedFilterInstance(appId); + const completedObservable = this.addProcessFilter(completedFilter); - let allFilter = this.getAllFilterInstance(appId); - let allObservable = this.addProcessFilter(allFilter); + const allFilter = this.getAllFilterInstance(appId); + const allObservable = this.addProcessFilter(allFilter); return new Observable((observer) => { forkJoin( @@ -103,7 +103,7 @@ export class ProcessFilterService { allObservable ).subscribe( (res) => { - let filters: FilterProcessRepresentationModel[] = []; + const filters: FilterProcessRepresentationModel[] = []; res.forEach((filter) => { if (filter.name === runningFilter.name) { runningFilter.id = filter.id; diff --git a/lib/process-services/process-list/services/process.service.spec.ts b/lib/process-services/process-list/services/process.service.spec.ts index bfc393e0c4..aa195a3cf2 100644 --- a/lib/process-services/process-list/services/process.service.spec.ts +++ b/lib/process-services/process-list/services/process.service.spec.ts @@ -47,7 +47,7 @@ describe('ProcessService', () => { let getProcessInstances: jasmine.Spy; - let filter: ProcessFilterParamRepresentationModel = new ProcessFilterParamRepresentationModel({ + const filter: ProcessFilterParamRepresentationModel = new ProcessFilterParamRepresentationModel({ processDefinitionId: '1', appDefinitionId: '1', page: 1, @@ -69,7 +69,7 @@ describe('ProcessService', () => { it('should return the correct instance data', async(() => { service.getProcessInstances(filter).subscribe((instances) => { - let instance = instances.data[0]; + const instance = instances.data[0]; expect(instance.id).toBe(exampleProcess.id); expect(instance.name).toBe(exampleProcess.name); expect(instance.started).toBe(exampleProcess.started); @@ -81,7 +81,7 @@ describe('ProcessService', () => { service.getProcessInstances(filter, 'fakeProcessDefinitionKey1').subscribe((instances) => { expect(instances.data.length).toBe(1); - let instance = instances.data[0]; + const instance = instances.data[0]; expect(instance.id).toBe('340124'); /* cspell:disable-next-line */ expect(instance.name).toBe('James Franklin EMEA Onboarding'); @@ -192,7 +192,7 @@ describe('ProcessService', () => { }); it('should call the API to create the process instance with form parameters', () => { - let formParams = { + const formParams = { type: 'ford', color: 'red' }; @@ -365,9 +365,9 @@ describe('ProcessService', () => { })); it('should return the correct task data', async(() => { - let fakeTasks = fakeTasksList.data; + const fakeTasks = fakeTasksList.data; service.getProcessTasks(processId).subscribe((tasks) => { - let task = tasks[0]; + const task = tasks[0]; expect(task.id).toBe(fakeTasks[0].id); expect(task.name).toBe(fakeTasks[0].name); expect(task.created).toEqual(moment(new Date('2016-11-10T00:00:00+00:00'), 'YYYY-MM-DD').format()); @@ -469,7 +469,7 @@ describe('ProcessService', () => { describe('create or update variables', () => { - let updatedVariables = [new ProcessInstanceVariable({ + const updatedVariables = [new ProcessInstanceVariable({ name: 'var1', value: 'Test1' }), new ProcessInstanceVariable({ diff --git a/lib/process-services/process-list/services/process.service.ts b/lib/process-services/process-list/services/process.service.ts index a4898c3422..4dc81f2681 100644 --- a/lib/process-services/process-list/services/process.service.ts +++ b/lib/process-services/process-list/services/process.service.ts @@ -115,7 +115,7 @@ export class ProcessService { * @returns Array of task instance details */ getProcessTasks(processInstanceId: string, state?: string): Observable<TaskDetailsModel[]> { - let taskOpts = state ? { + const taskOpts = state ? { processInstanceId: processInstanceId, state: state } : { @@ -138,7 +138,7 @@ export class ProcessService { * @returns Array of process definitions */ getProcessDefinitions(appId?: number): Observable<ProcessDefinitionRepresentation[]> { - let opts = appId ? { + const opts = appId ? { latest: true, appDefinitionId: appId } : { @@ -164,7 +164,7 @@ export class ProcessService { * @returns Details of the process instance just started */ startProcess(processDefinitionId: string, name: string, outcome?: string, startFormValues?: FormValues, variables?: ProcessInstanceVariable[]): Observable<ProcessInstance> { - let startRequest: any = { + const startRequest: any = { name: name, processDefinitionId: processDefinitionId }; diff --git a/lib/process-services/task-list/components/attach-form.component.spec.ts b/lib/process-services/task-list/components/attach-form.component.spec.ts index d3c847544f..4d29e83222 100644 --- a/lib/process-services/task-list/components/attach-form.component.spec.ts +++ b/lib/process-services/task-list/components/attach-form.component.spec.ts @@ -51,7 +51,7 @@ describe('AttachFormComponent', () => { it('should show the attach button disabled', async(() => { fixture.detectChanges(); fixture.whenStable().then(() => { - let attachButton = fixture.debugElement.query(By.css('#adf-no-form-attach-form-button')); + const attachButton = fixture.debugElement.query(By.css('#adf-no-form-attach-form-button')); expect(attachButton.nativeElement.disabled).toBeTruthy(); }); })); @@ -87,7 +87,7 @@ describe('AttachFormComponent', () => { spyOn(taskService, 'attachFormToATask').and.returnValue(of(true)); fixture.detectChanges(); fixture.whenStable().then(() => { - let attachButton = fixture.debugElement.query(By.css('#adf-no-form-attach-form-button')); + const attachButton = fixture.debugElement.query(By.css('#adf-no-form-attach-form-button')); expect(attachButton.nativeElement.disabled).toBeFalsy(); }); })); @@ -103,7 +103,7 @@ describe('AttachFormComponent', () => { fixture.detectChanges(); component.attachFormControl.setValue(2); fixture.detectChanges(); - let attachButton = fixture.debugElement.query(By.css('#adf-no-form-attach-form-button')); + const attachButton = fixture.debugElement.query(By.css('#adf-no-form-attach-form-button')); expect(attachButton.nativeElement.disabled).toBeTruthy(); }); })); diff --git a/lib/process-services/task-list/components/checklist.component.spec.ts b/lib/process-services/task-list/components/checklist.component.spec.ts index 7573214e97..7627451797 100644 --- a/lib/process-services/task-list/components/checklist.component.spec.ts +++ b/lib/process-services/task-list/components/checklist.component.spec.ts @@ -178,7 +178,7 @@ describe('ChecklistComponent', () => { })); showChecklistDialog.click(); - let addButtonDialog = <HTMLElement> window.document.querySelector('#add-check'); + const addButtonDialog = <HTMLElement> window.document.querySelector('#add-check'); addButtonDialog.click(); fixture.whenStable().then(() => { @@ -197,7 +197,7 @@ describe('ChecklistComponent', () => { name: 'fake-check-name' })); fixture.detectChanges(); - let checklistElementRemove = <HTMLElement> element.querySelector('#remove-fake-check-id'); + const checklistElementRemove = <HTMLElement> element.querySelector('#remove-fake-check-id'); expect(checklistElementRemove).toBeDefined(); expect(checklistElementRemove).not.toBeNull(); checklistElementRemove.click(); @@ -220,7 +220,7 @@ describe('ChecklistComponent', () => { fixture.whenStable().then(() => { fixture.detectChanges(); expect(checklistComponent.checklist.length).toBe(1); - let checklistElementRemove = <HTMLElement> element.querySelector('#remove-fake-check-id'); + const checklistElementRemove = <HTMLElement> element.querySelector('#remove-fake-check-id'); expect(checklistElementRemove).toBeDefined(); expect(checklistElementRemove).not.toBeNull(); checklistElementRemove.click(); @@ -237,7 +237,7 @@ describe('ChecklistComponent', () => { name: 'fake-check-name' })); fixture.detectChanges(); - let change = new SimpleChange(null, 'new-fake-task-id', true); + const change = new SimpleChange(null, 'new-fake-task-id', true); checklistComponent.ngOnChanges({ taskId: change }); @@ -257,7 +257,7 @@ describe('ChecklistComponent', () => { })); fixture.detectChanges(); checklistComponent.taskId = null; - let change = new SimpleChange(null, 'new-fake-task-id', true); + const change = new SimpleChange(null, 'new-fake-task-id', true); checklistComponent.ngOnChanges({ taskId: change }); @@ -271,7 +271,7 @@ describe('ChecklistComponent', () => { it('should emit checklist task created event when the checklist is successfully added', (done) => { spyOn(service, 'addTask').and.returnValue(of({ id: 'fake-check-added-id', name: 'fake-check-added-name' })); - let disposableCreated = checklistComponent.checklistTaskCreated.subscribe((taskAdded: TaskDetailsModel) => { + const disposableCreated = checklistComponent.checklistTaskCreated.subscribe((taskAdded: TaskDetailsModel) => { fixture.detectChanges(); expect(taskAdded.id).toEqual('fake-check-added-id'); expect(taskAdded.name).toEqual('fake-check-added-name'); @@ -281,7 +281,7 @@ describe('ChecklistComponent', () => { done(); }); showChecklistDialog.click(); - let addButtonDialog = <HTMLElement> window.document.querySelector('#add-check'); + const addButtonDialog = <HTMLElement> window.document.querySelector('#add-check'); addButtonDialog.click(); }); }); diff --git a/lib/process-services/task-list/components/checklist.component.ts b/lib/process-services/task-list/components/checklist.component.ts index 44e35fe5ee..009134433c 100644 --- a/lib/process-services/task-list/components/checklist.component.ts +++ b/lib/process-services/task-list/components/checklist.component.ts @@ -72,7 +72,7 @@ export class ChecklistComponent implements OnChanges { } ngOnChanges(changes: SimpleChanges) { - let taskId = changes['taskId']; + const taskId = changes['taskId']; if (taskId && taskId.currentValue) { this.getTaskChecklist(taskId.currentValue); return; @@ -102,7 +102,7 @@ export class ChecklistComponent implements OnChanges { } public add() { - let newTask = new TaskDetailsModel({ + const newTask = new TaskDetailsModel({ name: this.taskName, parentTaskId: this.taskId, assignee: { id: this.assignee } diff --git a/lib/process-services/task-list/components/no-task-detail-template.directive.spec.ts b/lib/process-services/task-list/components/no-task-detail-template.directive.spec.ts index 774635f32b..61188986bf 100644 --- a/lib/process-services/task-list/components/no-task-detail-template.directive.spec.ts +++ b/lib/process-services/task-list/components/no-task-detail-template.directive.spec.ts @@ -34,7 +34,7 @@ describe('NoTaskDetailsTemplateDirective', () => { }); it('should set "no task details" template on task details component', () => { - let testTemplate: any = 'test template'; + const testTemplate: any = 'test template'; component.template = testTemplate; component.ngAfterContentInit(); expect(detailsComponent.noTaskDetailsTemplateComponent).toBe(testTemplate); diff --git a/lib/process-services/task-list/components/start-task.component.spec.ts b/lib/process-services/task-list/components/start-task.component.spec.ts index 53db72deb0..7b9dd69049 100644 --- a/lib/process-services/task-list/components/start-task.component.spec.ts +++ b/lib/process-services/task-list/components/start-task.component.spec.ts @@ -34,7 +34,7 @@ describe('StartTaskComponent', () => { let getFormListSpy: jasmine.Spy; let createNewTaskSpy: jasmine.Spy; let logSpy: jasmine.Spy; - let fakeForms$ = [ + const fakeForms$ = [ { id: 123, name: 'Display Data' @@ -45,7 +45,7 @@ describe('StartTaskComponent', () => { } ]; - let testUser = { id: 1001, firstName: 'fakeName', email: 'fake@app.activiti.com' }; + const testUser = { id: 1001, firstName: 'fakeName', email: 'fake@app.activiti.com' }; setupTestBed({ imports: [ProcessTestingModule] @@ -96,20 +96,20 @@ describe('StartTaskComponent', () => { }); it('should create new task when start is clicked', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('task'); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalled(); }); it('should send on success event when the task is started', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskDetailsModel = new TaskDetailsModel(taskDetailsMock); component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalledWith({ id: 91, @@ -120,20 +120,20 @@ describe('StartTaskComponent', () => { }); it('should send on success event when only name is given', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.appId = 42; component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalled(); }); it('should not emit success event when data not present', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskDetailsModel = new TaskDetailsModel(null); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(createNewTaskSpy).not.toHaveBeenCalled(); expect(successSpy).not.toHaveBeenCalled(); @@ -161,13 +161,13 @@ describe('StartTaskComponent', () => { assignee: null } )); - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('fakeName'); component.taskForm.controls['formKey'].setValue(1204); component.appId = 42; component.taskDetailsModel = new TaskDetailsModel(taskDetailsMock); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalledWith({ id: 91, @@ -186,13 +186,13 @@ describe('StartTaskComponent', () => { assignee: null } )); - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('fakeName'); component.taskForm.controls['formKey'].setValue(null); component.appId = 42; component.taskDetailsModel = new TaskDetailsModel(taskDetailsMock); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalledWith({ id: 91, @@ -232,13 +232,13 @@ describe('StartTaskComponent', () => { }); it('should assign task when an assignee is selected', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('fakeName'); component.taskForm.controls['formKey'].setValue(1204); component.appId = 42; component.assigneeId = testUser.id; fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalledWith({ id: 91, @@ -249,14 +249,14 @@ describe('StartTaskComponent', () => { }); it('should assign task with id of selected user assigned', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskDetailsModel = new TaskDetailsModel(taskDetailsMock); component.taskForm.controls['name'].setValue('fakeName'); component.taskForm.controls['formKey'].setValue(1204); component.appId = 42; component.getAssigneeId(testUser.id); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalledWith({ id: 91, @@ -267,14 +267,14 @@ describe('StartTaskComponent', () => { }); it('should not assign task when no assignee is selected', () => { - let successSpy = spyOn(component.success, 'emit'); + const successSpy = spyOn(component.success, 'emit'); component.taskForm.controls['name'].setValue('fakeName'); component.taskForm.controls['formKey'].setValue(1204); component.appId = 42; component.assigneeId = null; component.taskDetailsModel = new TaskDetailsModel(taskDetailsMock); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); createTaskButton.click(); expect(successSpy).toHaveBeenCalledWith({ id: 91, @@ -286,7 +286,7 @@ describe('StartTaskComponent', () => { }); it('should not attach a form when a form id is not selected', () => { - let attachFormToATask = spyOn(service, 'attachFormToATask').and.returnValue([]); + const attachFormToATask = spyOn(service, 'attachFormToATask').and.returnValue([]); spyOn(service, 'createNewTask').and.callFake( function() { return new Observable((observer) => { @@ -296,7 +296,7 @@ describe('StartTaskComponent', () => { }); component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); fixture.detectChanges(); createTaskButton.click(); expect(attachFormToATask).not.toHaveBeenCalled(); @@ -310,7 +310,7 @@ describe('StartTaskComponent', () => { }); it('should not emit TaskDetails OnCancel', () => { - let emitSpy = spyOn(component.cancel, 'emit'); + const emitSpy = spyOn(component.cancel, 'emit'); component.onCancel(); expect(emitSpy).not.toBeNull(); expect(emitSpy).toHaveBeenCalled(); @@ -319,13 +319,13 @@ describe('StartTaskComponent', () => { it('should disable start button if name is empty', () => { component.taskForm.controls['name'].setValue(''); fixture.detectChanges(); - let createTaskButton = fixture.nativeElement.querySelector('#button-start'); + const createTaskButton = fixture.nativeElement.querySelector('#button-start'); expect(createTaskButton.disabled).toBeTruthy(); }); it('should cancel start task on cancel button click', () => { - let emitSpy = spyOn(component.cancel, 'emit'); - let cancelTaskButton = <HTMLElement> element.querySelector('#button-cancel'); + const emitSpy = spyOn(component.cancel, 'emit'); + const cancelTaskButton = <HTMLElement> element.querySelector('#button-cancel'); fixture.detectChanges(); cancelTaskButton.click(); expect(emitSpy).not.toBeNull(); @@ -335,27 +335,27 @@ describe('StartTaskComponent', () => { it('should enable start button if name is filled out', () => { component.taskForm.controls['name'].setValue('fakeName'); fixture.detectChanges(); - let createTaskButton = fixture.nativeElement.querySelector('#button-start'); + const createTaskButton = fixture.nativeElement.querySelector('#button-start'); expect(createTaskButton.disabled).toBeFalsy(); }); it('should define the select options for Forms', () => { component.forms$ = service.getFormList(); fixture.detectChanges(); - let selectElement = fixture.nativeElement.querySelector('#form_label'); + const selectElement = fixture.nativeElement.querySelector('#form_label'); expect(selectElement.innerHTML).toContain('ADF_TASK_LIST.START_TASK.FORM.LABEL.FORM'); }); it('should get formatted fullname', () => { - let testUser1 = { 'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com' }; - let testUser2 = { 'id': 1002, 'firstName': '', 'lastName': 'Adams', 'email': 'adams@app.activiti.com' }; - let testUser3 = { 'id': 1003, 'firstName': 'Wilbur', 'lastName': '', 'email': 'wilbur@app.activiti.com' }; - let testUser4 = { 'id': 1004, 'firstName': '', 'lastName': '', 'email': 'test@app.activiti.com' }; + const testUser1 = { 'id': 1001, 'firstName': 'Wilbur', 'lastName': 'Adams', 'email': 'wilbur@app.activiti.com' }; + const testUser2 = { 'id': 1002, 'firstName': '', 'lastName': 'Adams', 'email': 'adams@app.activiti.com' }; + const testUser3 = { 'id': 1003, 'firstName': 'Wilbur', 'lastName': '', 'email': 'wilbur@app.activiti.com' }; + const testUser4 = { 'id': 1004, 'firstName': '', 'lastName': '', 'email': 'test@app.activiti.com' }; - let testFullName1 = component.getDisplayUser(testUser1.firstName, testUser1.lastName, ' '); - let testFullName2 = component.getDisplayUser(testUser2.firstName, testUser2.lastName, ' '); - let testFullName3 = component.getDisplayUser(testUser3.firstName, testUser3.lastName, ' '); - let testFullName4 = component.getDisplayUser(testUser4.firstName, testUser4.lastName, ' '); + const testFullName1 = component.getDisplayUser(testUser1.firstName, testUser1.lastName, ' '); + const testFullName2 = component.getDisplayUser(testUser2.firstName, testUser2.lastName, ' '); + const testFullName3 = component.getDisplayUser(testUser3.firstName, testUser3.lastName, ' '); + const testFullName4 = component.getDisplayUser(testUser4.firstName, testUser4.lastName, ' '); expect(testFullName1.trim()).toBe('Wilbur Adams'); expect(testFullName2.trim()).toBe('Adams'); @@ -365,9 +365,9 @@ describe('StartTaskComponent', () => { it('should emit error when there is an error while creating task', () => { component.taskForm.controls['name'].setValue('fakeName'); - let errorSpy = spyOn(component.error, 'emit'); + const errorSpy = spyOn(component.error, 'emit'); spyOn(service, 'createNewTask').and.returnValue(throwError({})); - let createTaskButton = <HTMLElement> element.querySelector('#button-start'); + const createTaskButton = <HTMLElement> element.querySelector('#button-start'); fixture.detectChanges(); createTaskButton.click(); expect(errorSpy).toHaveBeenCalled(); @@ -377,7 +377,7 @@ describe('StartTaskComponent', () => { component.maxTaskNameLength = 2; component.ngOnInit(); fixture.detectChanges(); - let name = component.taskForm.controls['name']; + const name = component.taskForm.controls['name']; name.setValue('task'); fixture.detectChanges(); expect(name.valid).toBeFalsy(); @@ -388,7 +388,7 @@ describe('StartTaskComponent', () => { it('should emit error when task name field is empty', () => { fixture.detectChanges(); - let name = component.taskForm.controls['name']; + const name = component.taskForm.controls['name']; name.setValue(''); fixture.detectChanges(); expect(name.valid).toBeFalsy(); @@ -407,7 +407,7 @@ describe('StartTaskComponent', () => { it('should emit error when description have only white spaces', () => { fixture.detectChanges(); - let description = component.taskForm.controls['description']; + const description = component.taskForm.controls['description']; description.setValue(' '); fixture.detectChanges(); expect(description.valid).toBeFalsy(); diff --git a/lib/process-services/task-list/components/task-audit.directive.spec.ts b/lib/process-services/task-list/components/task-audit.directive.spec.ts index 02a63d3879..4fa1ef48fb 100644 --- a/lib/process-services/task-list/components/task-audit.directive.spec.ts +++ b/lib/process-services/task-list/components/task-audit.directive.spec.ts @@ -61,7 +61,7 @@ describe('TaskAuditDirective', () => { let service: TaskListService; function createFakePdfBlob(): Blob { - let pdfData = atob( + const pdfData = atob( 'JVBERi0xLjcKCjEgMCBvYmogICUgZW50cnkgcG9pbnQKPDwKICAvVHlwZSAvQ2F0YWxvZwog' + 'IC9QYWdlcyAyIDAgUgo+PgplbmRvYmoKCjIgMCBvYmoKPDwKICAvVHlwZSAvUGFnZXMKICAv' + 'TWVkaWFCb3ggWyAwIDAgMjAwIDIwMCBdCiAgL0NvdW50IDEKICAvS2lkcyBbIDMgMCBSIF0K' + @@ -99,13 +99,13 @@ describe('TaskAuditDirective', () => { it('should fetch the pdf Blob when the format is pdf', fakeAsync(() => { component.fileName = 'FakeAuditName'; component.format = 'pdf'; - let blob = createFakePdfBlob(); + const blob = createFakePdfBlob(); spyOn(service, 'fetchTaskAuditPdfById').and.returnValue(of(blob)); spyOn(component, 'onAuditClick').and.callThrough(); fixture.detectChanges(); - let button = fixture.nativeElement.querySelector('#auditButton'); + const button = fixture.nativeElement.querySelector('#auditButton'); fixture.whenStable().then(() => { fixture.detectChanges(); @@ -127,7 +127,7 @@ describe('TaskAuditDirective', () => { fixture.detectChanges(); - let button = fixture.nativeElement.querySelector('#auditButton'); + const button = fixture.nativeElement.querySelector('#auditButton'); fixture.whenStable().then(() => { fixture.detectChanges(); @@ -141,13 +141,13 @@ describe('TaskAuditDirective', () => { it('should fetch the pdf Blob as default when the format is UNKNOWN', fakeAsync(() => { component.fileName = 'FakeAuditName'; component.format = 'fakeFormat'; - let blob = createFakePdfBlob(); + const blob = createFakePdfBlob(); spyOn(service, 'fetchTaskAuditPdfById').and.returnValue(of(blob)); spyOn(component, 'onAuditClick').and.callThrough(); fixture.detectChanges(); - let button = fixture.nativeElement.querySelector('#auditButton'); + const button = fixture.nativeElement.querySelector('#auditButton'); fixture.whenStable().then(() => { fixture.detectChanges(); diff --git a/lib/process-services/task-list/components/task-details.component.spec.ts b/lib/process-services/task-list/components/task-details.component.spec.ts index cc6fde78ba..012251d19d 100644 --- a/lib/process-services/task-list/components/task-details.component.spec.ts +++ b/lib/process-services/task-list/components/task-details.component.spec.ts @@ -286,19 +286,19 @@ describe('TaskDetailsComponent', () => { }); it('should emit a save event when form saved', () => { - let emitSpy: jasmine.Spy = spyOn(component.formSaved, 'emit'); + const emitSpy: jasmine.Spy = spyOn(component.formSaved, 'emit'); component.onFormSaved(new FormModel()); expect(emitSpy).toHaveBeenCalled(); }); it('should emit a outcome execution event when form outcome executed', () => { - let emitSpy: jasmine.Spy = spyOn(component.executeOutcome, 'emit'); + const emitSpy: jasmine.Spy = spyOn(component.executeOutcome, 'emit'); component.onFormExecuteOutcome(new FormOutcomeEvent(new FormOutcomeModel(new FormModel()))); expect(emitSpy).toHaveBeenCalled(); }); it('should emit a complete event when form completed', () => { - let emitSpy: jasmine.Spy = spyOn(component.formCompleted, 'emit'); + const emitSpy: jasmine.Spy = spyOn(component.formCompleted, 'emit'); component.onFormCompleted(new FormModel()); expect(emitSpy).toHaveBeenCalled(); }); @@ -316,7 +316,7 @@ describe('TaskDetailsComponent', () => { }); it('should emit an error event if an error occurs fetching the next task', () => { - let emitSpy: jasmine.Spy = spyOn(component.error, 'emit'); + const emitSpy: jasmine.Spy = spyOn(component.error, 'emit'); getTasksSpy.and.returnValue(throwError({})); component.onComplete(); expect(emitSpy).toHaveBeenCalled(); @@ -334,7 +334,7 @@ describe('TaskDetailsComponent', () => { }); it('should emit a complete event when complete button clicked and task completed', () => { - let emitSpy: jasmine.Spy = spyOn(component.formCompleted, 'emit'); + const emitSpy: jasmine.Spy = spyOn(component.formCompleted, 'emit'); component.onComplete(); expect(emitSpy).toHaveBeenCalled(); }); @@ -345,13 +345,13 @@ describe('TaskDetailsComponent', () => { }); it('should emit a load event when form loaded', () => { - let emitSpy: jasmine.Spy = spyOn(component.formLoaded, 'emit'); + const emitSpy: jasmine.Spy = spyOn(component.formLoaded, 'emit'); component.onFormLoaded(new FormModel()); expect(emitSpy).toHaveBeenCalled(); }); it('should emit an error event when form error occurs', () => { - let emitSpy: jasmine.Spy = spyOn(component.error, 'emit'); + const emitSpy: jasmine.Spy = spyOn(component.error, 'emit'); component.onFormError({}); expect(emitSpy).toHaveBeenCalled(); }); @@ -368,8 +368,8 @@ describe('TaskDetailsComponent', () => { }); it('should emit a task created event when checklist task is created', () => { - let emitSpy: jasmine.Spy = spyOn(component.taskCreated, 'emit'); - let mockTask = new TaskDetailsModel(taskDetailsMock); + const emitSpy: jasmine.Spy = spyOn(component.taskCreated, 'emit'); + const mockTask = new TaskDetailsModel(taskDetailsMock); component.onChecklistTaskCreated(mockTask); expect(emitSpy).toHaveBeenCalled(); }); diff --git a/lib/process-services/task-list/components/task-details.component.ts b/lib/process-services/task-list/components/task-details.component.ts index 879d463885..5ea8c07922 100644 --- a/lib/process-services/task-list/components/task-details.component.ts +++ b/lib/process-services/task-list/components/task-details.component.ts @@ -212,7 +212,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - let taskId = changes.taskId; + const taskId = changes.taskId; this.showAssignee = false; if (taskId && !taskId.currentValue) { @@ -305,7 +305,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges { this.taskDetails.name = 'No name'; } - let endDate: any = res.endDate; + const endDate: any = res.endDate; if (endDate && !isNaN(endDate.getTime())) { this.internalReadOnlyForm = true; } else { @@ -369,7 +369,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges { * @param processDefinitionId */ private loadNextTask(processInstanceId: string, processDefinitionId: string): void { - let requestNode = new TaskQueryRequestRepresentationModel( + const requestNode = new TaskQueryRequestRepresentationModel( { processInstanceId: processInstanceId, processDefinitionId: processDefinitionId diff --git a/lib/process-services/task-list/components/task-filters.component.spec.ts b/lib/process-services/task-list/components/task-filters.component.spec.ts index a0cb350772..5d62f14e7d 100644 --- a/lib/process-services/task-list/components/task-filters.component.spec.ts +++ b/lib/process-services/task-list/components/task-filters.component.spec.ts @@ -32,7 +32,7 @@ describe('TaskFiltersComponent', () => { let taskFilterService: TaskFilterService; let appsProcessService: AppsProcessService; - let fakeGlobalFilter = []; + const fakeGlobalFilter = []; fakeGlobalFilter.push(new FilterRepresentationModel({ name: 'FakeInvolvedTasks', icon: 'glyphicon-align-left', @@ -52,23 +52,23 @@ describe('TaskFiltersComponent', () => { filter: { state: 'open', assignment: 'fake-assignee' } })); - let fakeGlobalFilterPromise = new Promise(function (resolve, reject) { + const fakeGlobalFilterPromise = new Promise(function (resolve, reject) { resolve(fakeGlobalFilter); }); - let fakeGlobalEmptyFilter = { + const fakeGlobalEmptyFilter = { message: 'invalid data' }; - let fakeGlobalEmptyFilterPromise = new Promise(function (resolve, reject) { + const fakeGlobalEmptyFilterPromise = new Promise(function (resolve, reject) { resolve(fakeGlobalEmptyFilter); }); - let mockErrorFilterList = { + const mockErrorFilterList = { error: 'wrong request' }; - let mockErrorFilterPromise = Promise.reject(mockErrorFilterList); + const mockErrorFilterPromise = Promise.reject(mockErrorFilterList); let component: TaskFiltersComponent; let fixture: ComponentFixture<TaskFiltersComponent>; @@ -80,7 +80,7 @@ describe('TaskFiltersComponent', () => { }); beforeEach(() => { - let appConfig: AppConfigService = TestBed.get(AppConfigService); + const appConfig: AppConfigService = TestBed.get(AppConfigService); appConfig.config.bpmHost = 'http://localhost:9876/bpm'; fixture = TestBed.createComponent(TaskFiltersComponent); @@ -95,7 +95,7 @@ describe('TaskFiltersComponent', () => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(mockErrorFilterPromise)); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); component.ngOnChanges({ 'appId': change }); component.error.subscribe((err) => { @@ -108,7 +108,7 @@ describe('TaskFiltersComponent', () => { it('should return the filter task list', (done) => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); component.ngOnChanges({ 'appId': change }); component.success.subscribe((res) => { @@ -126,18 +126,18 @@ describe('TaskFiltersComponent', () => { it('should return the filter task list, filtered By Name', (done) => { - let fakeDeployedApplicationsPromise = new Promise(function (resolve, reject) { + const fakeDeployedApplicationsPromise = new Promise(function (resolve, reject) { resolve({}); }); spyOn(appsProcessService, 'getDeployedApplicationsByName').and.returnValue(from(fakeDeployedApplicationsPromise)); spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); - let change = new SimpleChange(null, 'test', true); + const change = new SimpleChange(null, 'test', true); component.ngOnChanges({ 'appName': change }); component.success.subscribe((res) => { - let deployApp: any = appsProcessService.getDeployedApplicationsByName; + const deployApp: any = appsProcessService.getDeployedApplicationsByName; expect(deployApp.calls.count()).toEqual(1); expect(res).toBeDefined(); done(); @@ -150,7 +150,7 @@ describe('TaskFiltersComponent', () => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); fixture.detectChanges(); component.ngOnChanges({ 'appId': change }); @@ -169,7 +169,7 @@ describe('TaskFiltersComponent', () => { spyOn(component, 'createFiltersByAppId').and.stub(); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); component.ngOnChanges({ 'appId': change }); component.success.subscribe((res) => { @@ -184,7 +184,7 @@ describe('TaskFiltersComponent', () => { component.filterParam = new FilterParamsModel({ name: 'FakeMyTasks1' }); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); fixture.detectChanges(); component.ngOnChanges({ 'appId': change }); @@ -204,7 +204,7 @@ describe('TaskFiltersComponent', () => { component.filterParam = new FilterParamsModel({ name: 'UnexistableFilter' }); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); fixture.detectChanges(); component.ngOnChanges({ 'appId': change }); @@ -224,7 +224,7 @@ describe('TaskFiltersComponent', () => { component.filterParam = new FilterParamsModel({ index: 2 }); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); fixture.detectChanges(); component.ngOnChanges({ 'appId': change }); @@ -244,7 +244,7 @@ describe('TaskFiltersComponent', () => { component.filterParam = new FilterParamsModel({ id: 10 }); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); fixture.detectChanges(); component.ngOnChanges({ 'appId': change }); @@ -259,7 +259,7 @@ describe('TaskFiltersComponent', () => { }); it('should emit an event when a filter is selected', (done) => { - let currentFilter = fakeGlobalFilter[0]; + const currentFilter = fakeGlobalFilter[0]; component.filters = fakeGlobalFilter; component.filterClick.subscribe((filter: FilterRepresentationModel) => { expect(filter).toBeDefined(); @@ -275,7 +275,7 @@ describe('TaskFiltersComponent', () => { spyOn(component, 'getFiltersByAppId').and.stub(); const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); component.ngOnChanges({ 'appId': change }); expect(component.getFiltersByAppId).toHaveBeenCalledWith(appId); @@ -285,7 +285,7 @@ describe('TaskFiltersComponent', () => { spyOn(component, 'getFiltersByAppId').and.stub(); const appId = null; - let change = new SimpleChange(undefined, appId, true); + const change = new SimpleChange(undefined, appId, true); component.ngOnChanges({ 'appId': change }); expect(component.getFiltersByAppId).toHaveBeenCalledWith(appId); @@ -318,14 +318,14 @@ describe('TaskFiltersComponent', () => { spyOn(component, 'getFiltersByAppName').and.stub(); const appName = 'fake-app-name'; - let change = new SimpleChange(null, appName, true); + const change = new SimpleChange(null, appName, true); component.ngOnChanges({ 'appName': change }); expect(component.getFiltersByAppName).toHaveBeenCalledWith(appName); }); it('should return the current filter after one is selected', () => { - let filter = fakeGlobalFilter[1]; + const filter = fakeGlobalFilter[1]; component.filters = fakeGlobalFilter; expect(component.currentFilter).toBeUndefined(); @@ -336,14 +336,14 @@ describe('TaskFiltersComponent', () => { it('should load default list when app id is null', () => { spyOn(component, 'getFiltersByAppId').and.stub(); - let change = new SimpleChange(undefined, null, true); + const change = new SimpleChange(undefined, null, true); component.ngOnChanges({ 'appId': change }); expect(component.getFiltersByAppId).toHaveBeenCalled(); }); it('should not change the current filter if no filter with taskid is found', async(() => { - let filter = new FilterRepresentationModel({ + const filter = new FilterRepresentationModel({ name: 'FakeMyTasks', filter: { state: 'open', assignment: 'fake-assignee' } }); @@ -358,13 +358,13 @@ describe('TaskFiltersComponent', () => { it('should attach specific icon for each filter if showIcon is true', (done) => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); component.showIcon = true; - let change = new SimpleChange(undefined, 1, true); + const change = new SimpleChange(undefined, 1, true); component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); expect(component.filters.length).toBe(3); - let filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); + const filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); expect(filters.length).toBe(3); expect(filters[0].nativeElement.innerText).toContain('format_align_left'); expect(filters[1].nativeElement.innerText).toContain('check_circle'); @@ -376,12 +376,12 @@ describe('TaskFiltersComponent', () => { it('should not attach icons for each filter if showIcon is false', (done) => { spyOn(taskFilterService, 'getTaskListFilters').and.returnValue(from(fakeGlobalFilterPromise)); component.showIcon = false; - let change = new SimpleChange(undefined, 1, true); + const change = new SimpleChange(undefined, 1, true); component.ngOnChanges({ 'appId': change }); fixture.detectChanges(); fixture.whenStable().then(() => { fixture.detectChanges(); - let filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); + const filters: any = fixture.debugElement.queryAll(By.css('.adf-filters__entry-icon')); expect(filters.length).toBe(0); done(); }); diff --git a/lib/process-services/task-list/components/task-filters.component.ts b/lib/process-services/task-list/components/task-filters.component.ts index 3011049cdf..1e73a97cac 100644 --- a/lib/process-services/task-list/components/task-filters.component.ts +++ b/lib/process-services/task-list/components/task-filters.component.ts @@ -181,7 +181,7 @@ export class TaskFiltersComponent implements OnInit, OnChanges { * @param taskId */ public selectFilterWithTask(taskId: string) { - let filteredFilterList: FilterRepresentationModel[] = []; + const filteredFilterList: FilterRepresentationModel[] = []; this.taskListService.getFilterForTaskById(taskId, this.filters).subscribe( (filter: FilterRepresentationModel) => { filteredFilterList.push(filter); diff --git a/lib/process-services/task-list/components/task-header.component.spec.ts b/lib/process-services/task-list/components/task-header.component.spec.ts index 6a0807864c..f7c0558932 100644 --- a/lib/process-services/task-list/components/task-header.component.spec.ts +++ b/lib/process-services/task-list/components/task-header.component.spec.ts @@ -42,7 +42,7 @@ describe('TaskHeaderComponent', () => { let userBpmService: BpmUserService; let appConfigService: AppConfigService; - let fakeBpmAssignedUser = { + const fakeBpmAssignedUser = { id: 1001, apps: [], capabilities: 'fake-capability', @@ -83,7 +83,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let formNameEl = fixture.debugElement.query(By.css('[data-automation-id="header-assignee"] .adf-textitem-clickable-value')); + const formNameEl = fixture.debugElement.query(By.css('[data-automation-id="header-assignee"] .adf-textitem-clickable-value')); expect(formNameEl.nativeElement.innerText).toBe('Wilbur Adams'); }); })); @@ -93,8 +93,8 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let formNameEl = fixture.debugElement.query(By.css('[data-automation-id="header-assignee"] .adf-textitem-clickable-value')); - let iconE = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-create"]`)); + const formNameEl = fixture.debugElement.query(By.css('[data-automation-id="header-assignee"] .adf-textitem-clickable-value')); + const iconE = fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-edit-icon-create"]`)); expect(formNameEl).not.toBeNull(); expect(iconE).not.toBeNull(); expect(formNameEl.nativeElement.innerText).toBe('Wilbur Adams'); @@ -108,7 +108,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-assignee"] .adf-textitem-clickable-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-assignee"] .adf-textitem-clickable-value')); expect(valueEl.nativeElement.innerText).toBe('ADF_TASK_LIST.PROPERTIES.ASSIGNEE_DEFAULT'); }); @@ -120,7 +120,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let formNameEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-priority"]')); + const formNameEl = fixture.debugElement.query(By.css('[data-automation-id="card-textitem-value-priority"]')); expect(formNameEl.nativeElement.innerText).toBe('27'); }); })); @@ -131,7 +131,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-dueDate"]`)); + const datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-dueDate"]`)); expect(datePicker).toBeNull('Datepicker should NOT be in DOM'); }); })); @@ -142,7 +142,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-dueDate"]`)); + const datePicker = fixture.debugElement.query(By.css(`[data-automation-id="datepicker-dueDate"]`)); expect(datePicker).not.toBeNull('Datepicker should be in DOM'); }); })); @@ -156,7 +156,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); + const claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); expect(claimButton.nativeElement.innerText).toBe('ADF_TASK_LIST.DETAILS.BUTTON.CLAIM'); }); })); @@ -167,7 +167,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); + const claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); expect(component.isTaskClaimable()).toBeTruthy(); expect(claimButton.nativeElement.innerText).toBe('ADF_TASK_LIST.DETAILS.BUTTON.CLAIM'); }); @@ -180,8 +180,8 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); - let unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); + const claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); + const unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); expect(component.isTaskClaimable()).toBeFalsy(); expect(component.isTaskClaimedByCandidateMember()).toBeFalsy(); expect(unclaimButton).toBeNull(); @@ -196,7 +196,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); + const unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); expect(component.isTaskClaimedByCandidateMember()).toBeTruthy(); expect(unclaimButton.nativeElement.innerText).toBe('ADF_TASK_LIST.DETAILS.BUTTON.UNCLAIM'); }); @@ -208,7 +208,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); + const unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); expect(component.isTaskClaimedByCandidateMember()).toBeFalsy(); expect(unclaimButton).toBeNull(); }); @@ -220,7 +220,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); + const claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); expect(component.isTaskClaimable()).toBeTruthy(); expect(component.isTaskClaimedByCandidateMember()).toBeFalsy(); expect(claimButton.nativeElement.innerText).toBe('ADF_TASK_LIST.DETAILS.BUTTON.CLAIM'); @@ -233,8 +233,8 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); - let unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); + const claimButton = fixture.debugElement.query(By.css('[data-automation-id="header-claim-button"]')); + const unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); expect(claimButton).toBeNull(); expect(unclaimButton).toBeNull(); }); @@ -247,7 +247,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); + const unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); unclaimButton.triggerEventHandler('click', {}); expect(service.unclaimTask).toHaveBeenCalledWith('91'); @@ -266,7 +266,7 @@ describe('TaskHeaderComponent', () => { unclaimed = true; }); - let unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); + const unclaimButton = fixture.debugElement.query(By.css('[data-automation-id="header-unclaim-button"]')); unclaimButton.triggerEventHandler('click', {}); expect(unclaimed).toBeTruthy(); @@ -279,7 +279,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); expect(valueEl.nativeElement.innerText.trim()).toBe('Nov 03 2016'); }); })); @@ -290,7 +290,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-dueDate"] .adf-property-value')); expect(valueEl.nativeElement.innerText.trim()).toBe('ADF_TASK_LIST.PROPERTIES.DUE_DATE_DEFAULT'); }); })); @@ -301,7 +301,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-formName"] .adf-textitem-clickable-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-formName"] .adf-textitem-clickable-value')); expect(valueEl.nativeElement.innerText).toBe('test form'); }); })); @@ -312,7 +312,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-parentName"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-parentName"] .adf-property-value')); expect(valueEl.nativeElement.innerText.trim()).toEqual('ADF_TASK_LIST.PROPERTIES.PARENT_NAME_DEFAULT'); }); })); @@ -324,7 +324,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-parentName"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-parentName"] .adf-property-value')); expect(valueEl.nativeElement.innerText.trim()).toEqual('Parent Name'); }); })); @@ -334,7 +334,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-formName"] .adf-property-value')); + const valueEl = fixture.debugElement.query(By.css('[data-automation-id="header-formName"] .adf-property-value')); expect(valueEl.nativeElement.innerText).toBe('ADF_TASK_LIST.PROPERTIES.FORM_NAME_DEFAULT'); }); })); @@ -347,7 +347,7 @@ describe('TaskHeaderComponent', () => { component.taskDetails.processDefinitionName = 'Parent Name'; component.refreshData(); fixture.detectChanges(); - let propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); + const propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); fixture.whenStable().then(() => { expect(propertyList).toBeDefined(); @@ -366,7 +366,7 @@ describe('TaskHeaderComponent', () => { fixture.detectChanges(); fixture.whenStable().then(() => { - let propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); + const propertyList = fixture.debugElement.queryAll(By.css('.adf-property-list .adf-property')); expect(propertyList).toBeDefined(); expect(propertyList).not.toBeNull(); expect(propertyList.length).toBe(component.properties.length); diff --git a/lib/process-services/task-list/components/task-list.component.spec.ts b/lib/process-services/task-list/components/task-list.component.spec.ts index 3a42c62abd..6040c9b6f8 100644 --- a/lib/process-services/task-list/components/task-list.component.spec.ts +++ b/lib/process-services/task-list/components/task-list.component.spec.ts @@ -107,9 +107,9 @@ describe('TaskListComponent', () => { }); it('should return the filtered task list when the input parameters are passed', (done) => { - let state = new SimpleChange(null, 'open', true); - let processDefinitionKey = new SimpleChange(null, null, true); - let assignment = new SimpleChange(null, 'fake-assignee', true); + const state = new SimpleChange(null, 'open', true); + const processDefinitionKey = new SimpleChange(null, null, true); + const assignment = new SimpleChange(null, 'fake-assignee', true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -151,10 +151,10 @@ describe('TaskListComponent', () => { }); it('should return the filtered task list by processDefinitionKey', (done) => { - let state = new SimpleChange(null, 'open', true); + const state = new SimpleChange(null, 'open', true); /* cspell:disable-next-line */ - let processDefinitionKey = new SimpleChange(null, 'fakeprocess', true); - let assignment = new SimpleChange(null, 'fake-assignee', true); + const processDefinitionKey = new SimpleChange(null, 'fakeprocess', true); + const assignment = new SimpleChange(null, 'fake-assignee', true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -177,9 +177,9 @@ describe('TaskListComponent', () => { }); it('should return the filtered task list by processInstanceId', (done) => { - let state = new SimpleChange(null, 'open', true); - let processInstanceId = new SimpleChange(null, 'fakeprocessId', true); - let assignment = new SimpleChange(null, 'fake-assignee', true); + const state = new SimpleChange(null, 'open', true); + const processInstanceId = new SimpleChange(null, 'fakeprocessId', true); + const assignment = new SimpleChange(null, 'fake-assignee', true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -203,9 +203,9 @@ describe('TaskListComponent', () => { }); it('should return the filtered task list by processDefinitionId', (done) => { - let state = new SimpleChange(null, 'open', true); - let processDefinitionId = new SimpleChange(null, 'fakeprocessDefinitionId', true); - let assignment = new SimpleChange(null, 'fake-assignee', true); + const state = new SimpleChange(null, 'open', true); + const processDefinitionId = new SimpleChange(null, 'fakeprocessDefinitionId', true); + const assignment = new SimpleChange(null, 'fake-assignee', true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -229,8 +229,8 @@ describe('TaskListComponent', () => { }); it('should return the filtered task list by created date', (done) => { - let state = new SimpleChange(null, 'open', true); - let afterDate = new SimpleChange(null, '28-02-2017', true); + const state = new SimpleChange(null, 'open', true); + const afterDate = new SimpleChange(null, '28-02-2017', true); component.success.subscribe((res) => { expect(res).toBeDefined(); expect(component.rows).toBeDefined(); @@ -251,9 +251,9 @@ describe('TaskListComponent', () => { }); it('should return the filtered task list for all state', (done) => { - let state = new SimpleChange(null, 'all', true); + const state = new SimpleChange(null, 'all', true); /* cspell:disable-next-line */ - let processInstanceId = new SimpleChange(null, 'fakeprocessId', true); + const processInstanceId = new SimpleChange(null, 'fakeprocessId', true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -317,10 +317,10 @@ describe('TaskListComponent', () => { }); it('should emit row click event', (done) => { - let row = new ObjectDataRow({ + const row = new ObjectDataRow({ id: '999' }); - let rowEvent = new DataRowEvent(row, null); + const rowEvent = new DataRowEvent(row, null); component.rowClick.subscribe((taskId) => { expect(taskId).toEqual('999'); @@ -344,7 +344,7 @@ describe('TaskListComponent', () => { component.rows = [{ id: '999', name: 'Fake-name' }]; const landingTaskId = '999'; - let change = new SimpleChange(null, landingTaskId, true); + const change = new SimpleChange(null, landingTaskId, true); component.ngOnChanges({'landingTaskId': change}); expect(component.reload).not.toHaveBeenCalled(); expect(component.rows.length).toEqual(1); @@ -354,7 +354,7 @@ describe('TaskListComponent', () => { component.currentInstanceId = '999'; component.rows = [{ id: '999', name: 'Fake-name' }]; const landingTaskId = '888'; - let change = new SimpleChange(null, landingTaskId, true); + const change = new SimpleChange(null, landingTaskId, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -381,7 +381,7 @@ describe('TaskListComponent', () => { it('should reload the list when the appId parameter changes', (done) => { const appId = '1'; - let change = new SimpleChange(null, appId, true); + const change = new SimpleChange(null, appId, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -402,7 +402,7 @@ describe('TaskListComponent', () => { it('should reload the list when the processDefinitionKey parameter changes', (done) => { const processDefinitionKey = 'fakeprocess'; - let change = new SimpleChange(null, processDefinitionKey, true); + const change = new SimpleChange(null, processDefinitionKey, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -424,7 +424,7 @@ describe('TaskListComponent', () => { it('should reload the list when the state parameter changes', (done) => { const state = 'open'; - let change = new SimpleChange(null, state, true); + const change = new SimpleChange(null, state, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -446,7 +446,7 @@ describe('TaskListComponent', () => { it('should reload the list when the sort parameter changes', (done) => { const sort = 'desc'; - let change = new SimpleChange(null, sort, true); + const change = new SimpleChange(null, sort, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -468,7 +468,7 @@ describe('TaskListComponent', () => { it('should reload the process list when the name parameter changes', (done) => { const name = 'FakeTaskName'; - let change = new SimpleChange(null, name, true); + const change = new SimpleChange(null, name, true); component.success.subscribe((res) => { expect(res).toBeDefined(); @@ -490,7 +490,7 @@ describe('TaskListComponent', () => { it('should reload the list when the assignment parameter changes', (done) => { const assignment = 'assignee'; - let change = new SimpleChange(null, assignment, true); + const change = new SimpleChange(null, assignment, true); component.success.subscribe((res) => { expect(res).toBeDefined(); diff --git a/lib/process-services/task-list/components/task-list.component.ts b/lib/process-services/task-list/components/task-list.component.ts index 79258ceded..fb0b238cbd 100644 --- a/lib/process-services/task-list/components/task-list.component.ts +++ b/lib/process-services/task-list/components/task-list.component.ts @@ -220,9 +220,9 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft private isPropertyChanged(changes: SimpleChanges): boolean { let changed: boolean = true; - let landingTaskId = changes['landingTaskId']; - let page = changes['page']; - let size = changes['size']; + const landingTaskId = changes['landingTaskId']; + const page = changes['page']; + const size = changes['size']; if (landingTaskId && landingTaskId.currentValue && this.isEqualToCurrentId(landingTaskId.currentValue)) { changed = false; } else if (page && page.currentValue !== page.previousValue) { @@ -353,7 +353,7 @@ export class TaskListComponent extends DataTableSchema implements OnChanges, Aft private createRequestNode() { - let requestNode = { + const requestNode = { appDefinitionId: this.appId, dueAfter: this.dueAfter ? moment(this.dueAfter).toDate() : null, dueBefore: this.dueBefore ? moment(this.dueBefore).toDate() : null, diff --git a/lib/process-services/task-list/models/task-details.model.ts b/lib/process-services/task-list/models/task-details.model.ts index 65a9b3b945..fcbb7e8208 100644 --- a/lib/process-services/task-list/models/task-details.model.ts +++ b/lib/process-services/task-list/models/task-details.model.ts @@ -98,8 +98,8 @@ export class TaskDetailsModel implements TaskRepresentation { let fullName: string = ''; if (this.assignee) { - let firstName: string = this.assignee.firstName ? this.assignee.firstName : ''; - let lastName: string = this.assignee.lastName ? this.assignee.lastName : ''; + const firstName: string = this.assignee.firstName ? this.assignee.firstName : ''; + const lastName: string = this.assignee.lastName ? this.assignee.lastName : ''; fullName = `${firstName} ${lastName}`; } diff --git a/lib/process-services/task-list/services/process-upload.service.ts b/lib/process-services/task-list/services/process-upload.service.ts index 0b2ec4be1c..79b80d1601 100644 --- a/lib/process-services/task-list/services/process-upload.service.ts +++ b/lib/process-services/task-list/services/process-upload.service.ts @@ -29,11 +29,11 @@ export class ProcessUploadService extends UploadService { } getUploadPromise(file: any): any { - let opts = { + const opts = { isRelatedContent: true }; - let processInstanceId = file.options.parentId; - let promise = this.apiService.getInstance().activiti.contentApi.createRelatedContentOnProcessInstance(processInstanceId, file.file, opts); + const processInstanceId = file.options.parentId; + const promise = this.apiService.getInstance().activiti.contentApi.createRelatedContentOnProcessInstance(processInstanceId, file.file, opts); promise.catch((err) => this.handleError(err)); diff --git a/lib/process-services/task-list/services/task-filter.service.spec.ts b/lib/process-services/task-list/services/task-filter.service.spec.ts index 5e500dd29f..31d0a940b0 100644 --- a/lib/process-services/task-list/services/task-filter.service.spec.ts +++ b/lib/process-services/task-list/services/task-filter.service.spec.ts @@ -100,7 +100,7 @@ describe('Activiti Task filter Service', () => { it('should call the api with the appId', (done) => { spyOn(service, 'callApiTaskFilters').and.returnValue((fakeAppPromise)); - let appId = 1; + const appId = 1; service.getTaskListFilters(appId).subscribe((res) => { expect(service.callApiTaskFilters).toHaveBeenCalledWith(appId); done(); @@ -108,7 +108,7 @@ describe('Activiti Task filter Service', () => { }); it('should return the app filter by id', (done) => { - let appId = 1; + const appId = 1; service.getTaskListFilters(appId).subscribe((res) => { expect(res).toBeDefined(); expect(res.length).toEqual(1); @@ -172,7 +172,7 @@ describe('Activiti Task filter Service', () => { }); it('should add a filter', (done) => { - let filterFake = new FilterRepresentationModel({ + const filterFake = new FilterRepresentationModel({ name: 'FakeNameFilter', assignment: 'fake-assignment' }); diff --git a/lib/process-services/task-list/services/task-filter.service.ts b/lib/process-services/task-list/services/task-filter.service.ts index d74a25cc48..65e75b7c72 100644 --- a/lib/process-services/task-list/services/task-filter.service.ts +++ b/lib/process-services/task-list/services/task-filter.service.ts @@ -36,17 +36,17 @@ export class TaskFilterService { * @returns Array of default filters just created */ public createDefaultFilters(appId: number): Observable<FilterRepresentationModel[]> { - let involvedTasksFilter = this.getInvolvedTasksFilterInstance(appId); - let involvedObservable = this.addFilter(involvedTasksFilter); + const involvedTasksFilter = this.getInvolvedTasksFilterInstance(appId); + const involvedObservable = this.addFilter(involvedTasksFilter); - let myTasksFilter = this.getMyTasksFilterInstance(appId); - let myTaskObservable = this.addFilter(myTasksFilter); + const myTasksFilter = this.getMyTasksFilterInstance(appId); + const myTaskObservable = this.addFilter(myTasksFilter); - let queuedTasksFilter = this.getQueuedTasksFilterInstance(appId); - let queuedObservable = this.addFilter(queuedTasksFilter); + const queuedTasksFilter = this.getQueuedTasksFilterInstance(appId); + const queuedObservable = this.addFilter(queuedTasksFilter); - let completedTasksFilter = this.getCompletedTasksFilterInstance(appId); - let completeObservable = this.addFilter(completedTasksFilter); + const completedTasksFilter = this.getCompletedTasksFilterInstance(appId); + const completeObservable = this.addFilter(completedTasksFilter); return new Observable((observer) => { forkJoin( @@ -56,7 +56,7 @@ export class TaskFilterService { completeObservable ).subscribe( (res) => { - let filters: FilterRepresentationModel[] = []; + const filters: FilterRepresentationModel[] = []; res.forEach((filter) => { if (filter.name === involvedTasksFilter.name) { involvedTasksFilter.id = filter.id; diff --git a/lib/process-services/task-list/services/task-upload.service.ts b/lib/process-services/task-list/services/task-upload.service.ts index 639aa0c965..79ec62fbd9 100644 --- a/lib/process-services/task-list/services/task-upload.service.ts +++ b/lib/process-services/task-list/services/task-upload.service.ts @@ -29,11 +29,11 @@ export class TaskUploadService extends UploadService { } getUploadPromise(file: any): any { - let opts = { + const opts = { isRelatedContent: true }; - let taskId = file.options.parentId; - let promise = this.apiService.getInstance().activiti.contentApi.createRelatedContentOnTask(taskId, file.file, opts); + const taskId = file.options.parentId; + const promise = this.apiService.getInstance().activiti.contentApi.createRelatedContentOnTask(taskId, file.file, opts); promise.catch((err) => this.handleError(err)); diff --git a/lib/process-services/task-list/services/tasklist.service.spec.ts b/lib/process-services/task-list/services/tasklist.service.spec.ts index 58ca3cc5b1..0c7f545c40 100644 --- a/lib/process-services/task-list/services/tasklist.service.spec.ts +++ b/lib/process-services/task-list/services/tasklist.service.spec.ts @@ -255,7 +255,7 @@ describe('Activiti TaskList Service', () => { }); it('should add a task ', (done) => { - let taskFake = new TaskDetailsModel({ + const taskFake = new TaskDetailsModel({ id: 123, parentTaskId: 456, name: 'FakeNameTask', @@ -324,7 +324,7 @@ describe('Activiti TaskList Service', () => { }); it('should create a new standalone task ', (done) => { - let taskFake = new TaskDetailsModel({ + const taskFake = new TaskDetailsModel({ name: 'FakeNameTask', description: 'FakeDescription', category: '3' @@ -355,7 +355,7 @@ describe('Activiti TaskList Service', () => { }); it('should assign task to a user', (done) => { - let testTaskId = '8888'; + const testTaskId = '8888'; service.assignTask(testTaskId, fakeUser2).subscribe((res: TaskDetailsModel) => { expect(res).toBeDefined(); expect(res.id).toEqual(testTaskId); @@ -389,7 +389,7 @@ describe('Activiti TaskList Service', () => { }); it('should assign task to a userId', (done) => { - let testTaskId = '8888'; + const testTaskId = '8888'; service.assignTaskByUserId(testTaskId, fakeUser2.id.toString()).subscribe((res: TaskDetailsModel) => { expect(res).toBeDefined(); expect(res.id).toEqual(testTaskId); @@ -421,7 +421,7 @@ describe('Activiti TaskList Service', () => { }); it('should claim a task', (done) => { - let taskId = '111'; + const taskId = '111'; service.claimTask(taskId).subscribe(() => { done(); @@ -435,7 +435,7 @@ describe('Activiti TaskList Service', () => { }); it('should unclaim a task', (done) => { - let taskId = '111'; + const taskId = '111'; service.unclaimTask(taskId).subscribe(() => { done(); @@ -449,7 +449,7 @@ describe('Activiti TaskList Service', () => { }); it('should update a task', (done) => { - let taskId = '111'; + const taskId = '111'; service.updateTask(taskId, { property: 'value' }).subscribe(() => { done(); @@ -463,8 +463,8 @@ describe('Activiti TaskList Service', () => { }); it('should return the filter if it contains task id', (done) => { - let taskId = '1'; - let filterFake = new FilterRepresentationModel({ + const taskId = '1'; + const filterFake = new FilterRepresentationModel({ name: 'FakeNameFilter', assignment: 'fake-assignment', filter: { @@ -489,9 +489,9 @@ describe('Activiti TaskList Service', () => { }); it('should return the filters if it contains task id', (done) => { - let taskId = '1'; + const taskId = '1'; - let fakeFilterList: FilterRepresentationModel[] = []; + const fakeFilterList: FilterRepresentationModel[] = []; fakeFilterList.push(fakeRepresentationFilter1, fakeRepresentationFilter2); let resultFilter: FilterRepresentationModel = null; service.getFilterForTaskById(taskId, fakeFilterList).subscribe((res: FilterRepresentationModel) => { diff --git a/lib/process-services/task-list/services/tasklist.service.ts b/lib/process-services/task-list/services/tasklist.service.ts index 5d6e39e898..080822c41c 100644 --- a/lib/process-services/task-list/services/tasklist.service.ts +++ b/lib/process-services/task-list/services/tasklist.service.ts @@ -57,7 +57,7 @@ export class TaskListService { * @returns The search query */ private generateTaskRequestNodeFromFilter(filterModel: FilterRepresentationModel): TaskQueryRequestRepresentationModel { - let requestNode = { + const requestNode = { appDefinitionId: filterModel.appId, assignment: filterModel.filter.assignment, state: filterModel.filter.state, @@ -73,7 +73,7 @@ export class TaskListService { * @returns The filter if it is related or null otherwise */ isTaskRelatedToFilter(taskId: string, filterModel: FilterRepresentationModel): Observable<FilterRepresentationModel> { - let requestNodeForFilter = this.generateTaskRequestNodeFromFilter(filterModel); + const requestNodeForFilter = this.generateTaskRequestNodeFromFilter(filterModel); return from(this.callApiTasksFiltered(requestNodeForFilter)) .pipe( map((res: any) => { @@ -185,7 +185,7 @@ export class TaskListService { * @returns Array of form details */ getFormList(): Observable<Form[]> { - let opts = { + const opts = { 'filter': 'myReusableForms', // String | filter 'sort': 'modifiedDesc', // String | sort 'modelType': 2 // Integer | modelType @@ -194,7 +194,7 @@ export class TaskListService { return from(this.apiService.getInstance().activiti.modelsApi.getModels(opts)) .pipe( map((response: any) => { - let forms: Form[] = []; + const forms: Form[] = []; response.data.forEach((form) => { forms.push(new Form(form.id, form.name)); }); @@ -306,7 +306,7 @@ export class TaskListService { * @returns Details of the assigned task */ assignTask(taskId: string, requestNode: any): Observable<TaskDetailsModel> { - let assignee = { assignee: requestNode.id }; + const assignee = { assignee: requestNode.id }; return from(this.callApiAssignTask(taskId, assignee)) .pipe( map((response: TaskDetailsModel) => { diff --git a/lib/testing/src/lib/core/browser-visibility.ts b/lib/testing/src/lib/core/browser-visibility.ts index 2a3a297a19..7c2ecfcc42 100644 --- a/lib/testing/src/lib/core/browser-visibility.ts +++ b/lib/testing/src/lib/core/browser-visibility.ts @@ -16,7 +16,7 @@ */ import { browser, protractor } from 'protractor'; -let until = protractor.ExpectedConditions; +const until = protractor.ExpectedConditions; const DEFAULT_TIMEOUT = 40000; diff --git a/lib/testing/src/lib/core/pages/header.page.ts b/lib/testing/src/lib/core/pages/header.page.ts index 6914452431..97d397bbec 100644 --- a/lib/testing/src/lib/core/pages/header.page.ts +++ b/lib/testing/src/lib/core/pages/header.page.ts @@ -49,18 +49,18 @@ export class HeaderPage { } clickShowMenuButton() { - let checkBox = element.all(by.css('mat-checkbox')); + const checkBox = element.all(by.css('mat-checkbox')); BrowserVisibility.waitUntilElementIsVisible(checkBox); return checkBox.get(0).click(); } changeHeaderColor(color) { - let headerColor = element(by.css('option[value="' + color + '"]')); + const headerColor = element(by.css('option[value="' + color + '"]')); return headerColor.click(); } checkAppTitle(name) { - let title = element(by.cssContainingText('.adf-app-title', name)); + const title = element(by.cssContainingText('.adf-app-title', name)); return BrowserVisibility.waitUntilElementIsVisible(title); } @@ -72,7 +72,7 @@ export class HeaderPage { } checkIconIsDisplayed(url) { - let icon = element(by.css('img[src="' + url + '"]')); + const icon = element(by.css('img[src="' + url + '"]')); BrowserVisibility.waitUntilElementIsVisible(icon); } diff --git a/lib/testing/src/lib/core/pages/user-info.page.ts b/lib/testing/src/lib/core/pages/user-info.page.ts index 31ab1da8bd..3dfbfb3cce 100644 --- a/lib/testing/src/lib/core/pages/user-info.page.ts +++ b/lib/testing/src/lib/core/pages/user-info.page.ts @@ -55,19 +55,19 @@ export class UserInfoPage { } clickOnContentServicesTab() { - let tabsPage = new TabsPage(); + const tabsPage = new TabsPage(); tabsPage.clickTabByTitle('Content Services'); return this; } checkProcessServicesTabIsSelected() { - let tabsPage = new TabsPage; + const tabsPage = new TabsPage; tabsPage.checkTabIsSelectedByTitle('Process Services'); return this; } clickOnProcessServicesTab() { - let tabsPage = new TabsPage; + const tabsPage = new TabsPage; tabsPage.clickTabByTitle('Process Services'); return this; } diff --git a/lib/testing/src/lib/material/tabs.page.ts b/lib/testing/src/lib/material/tabs.page.ts index ad195a5dad..f92b4ab700 100644 --- a/lib/testing/src/lib/material/tabs.page.ts +++ b/lib/testing/src/lib/material/tabs.page.ts @@ -21,13 +21,13 @@ import { BrowserVisibility } from '../core/browser-visibility'; export class TabsPage { clickTabByTitle(tabTitle) { - let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle)); + const tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle)); BrowserVisibility.waitUntilElementIsVisible(tab); tab.click(); } checkTabIsSelectedByTitle(tabTitle) { - let tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle)); + const tab = element(by.cssContainingText("div[id*='mat-tab-label']", tabTitle)); tab.getAttribute('aria-selected').then((result) => { expect(result).toBe('true'); }); diff --git a/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts b/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts index 62bf797a4d..b6c9d50c0e 100644 --- a/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts +++ b/lib/testing/src/lib/process-services-cloud/actions/testing-alfresco-api.service.ts @@ -27,7 +27,7 @@ export class TestingAlfrescoApiService extends AlfrescoApiService { constructor(public appConfig: AppConfigService) { super(null, null); - let oauth = Object.assign({}, this.appConfig.get<any>(AppConfigValues.OAUTHCONFIG, null)); + const oauth = Object.assign({}, this.appConfig.get<any>(AppConfigValues.OAUTHCONFIG, null)); this.config = new AlfrescoApiConfig({ provider: this.appConfig.get<string>(AppConfigValues.PROVIDERS), hostEcm: this.appConfig.get<string>(AppConfigValues.ECMHOST), diff --git a/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts b/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts index 41efdbbd92..bc5aa073fa 100644 --- a/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts +++ b/lib/testing/src/lib/process-services-cloud/app/app-list-cloud.page.ts @@ -27,18 +27,18 @@ export class AppListCloudPage { } goToApp(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); BrowserVisibility.waitUntilElementIsVisible(app); app.click(); } checkAppIsNotDisplayed(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); return BrowserVisibility.waitUntilElementIsNotOnPage(app); } checkAppIsDisplayed(applicationName) { - let app = element(by.css('mat-card[title="' + applicationName + '"]')); + const app = element(by.css('mat-card[title="' + applicationName + '"]')); return BrowserVisibility.waitUntilElementIsVisible(app); } diff --git a/lib/testing/src/lib/process-services/pages/form-fields.page.ts b/lib/testing/src/lib/process-services/pages/form-fields.page.ts index f259e7aed9..a3f3c1e9d4 100644 --- a/lib/testing/src/lib/process-services/pages/form-fields.page.ts +++ b/lib/testing/src/lib/process-services/pages/form-fields.page.ts @@ -34,53 +34,53 @@ export class FormFieldsPage { errorMessage = by.css('.adf-error-text-container .adf-error-text'); setFieldValue(locator, field, value) { - let fieldElement: any = element(locator(field)); + const fieldElement: any = element(locator(field)); BrowserVisibility.waitUntilElementIsVisible(fieldElement); fieldElement.clear().sendKeys(value); return this; } checkWidgetIsVisible(fieldId) { - let fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first(); + const fieldElement = element.all(by.css(`adf-form-field div[id='field-${fieldId}-container']`)).first(); BrowserVisibility.waitUntilElementIsVisible(fieldElement); } checkWidgetIsHidden(fieldId) { - let hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`)); + const hiddenElement = element(by.css(`adf-form-field div[id='field-${fieldId}-container'][hidden]`)); BrowserVisibility.waitUntilElementIsVisible(hiddenElement); } getWidget(fieldId) { - let widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); + const widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); BrowserVisibility.waitUntilElementIsVisible(widget); return widget; } getFieldValue(fieldId, valueLocatorParam) { - let value = this.getWidget(fieldId).element(valueLocatorParam || this.valueLocator); + const value = this.getWidget(fieldId).element(valueLocatorParam || this.valueLocator); BrowserVisibility.waitUntilElementIsVisible(value); return value.getAttribute('value'); } getFieldLabel(fieldId, labelLocatorParam) { - let label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first(); + const label = this.getWidget(fieldId).all(labelLocatorParam || this.labelLocator).first(); BrowserVisibility.waitUntilElementIsVisible(label); return label.getText(); } getFieldErrorMessage(fieldId) { - let error = this.getWidget(fieldId).element(this.errorMessage); + const error = this.getWidget(fieldId).element(this.errorMessage); return error.getText(); } getFieldText(fieldId, labelLocatorParam) { - let label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator); + const label = this.getWidget(fieldId).element(labelLocatorParam || this.labelLocator); BrowserVisibility.waitUntilElementIsVisible(label); return label.getText(); } getFieldPlaceHolder(fieldId, locator = 'input') { - let placeHolderLocator = element(by.css(`${locator}#${fieldId}`)).getAttribute('placeholder'); + const placeHolderLocator = element(by.css(`${locator}#${fieldId}`)).getAttribute('placeholder'); BrowserVisibility.waitUntilElementIsVisible(placeHolderLocator); return placeHolderLocator; } @@ -138,14 +138,14 @@ export class FormFieldsPage { } selectFormFromDropDown(formName) { - let formNameElement = element(by.cssContainingText('span', formName)); + const formNameElement = element(by.cssContainingText('span', formName)); BrowserVisibility.waitUntilElementIsVisible(formNameElement); formNameElement.click(); } checkWidgetIsReadOnlyMode(fieldId) { - let widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); - let widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]')); + const widget = element(by.css(`adf-form-field div[id='field-${fieldId}-container']`)); + const widgetReadOnly = widget.element(by.css('div[class*="adf-readonly"]')); BrowserVisibility.waitUntilElementIsVisible(widgetReadOnly); return widgetReadOnly; } @@ -156,7 +156,7 @@ export class FormFieldsPage { } setValueInInputById(fieldId, value) { - let input: any = element(by.id(fieldId)); + const input: any = element(by.id(fieldId)); BrowserVisibility.waitUntilElementIsVisible(input); input.clear().sendKeys(value); return this; diff --git a/tslint.json b/tslint.json index f516762fa3..87615cb6ca 100644 --- a/tslint.json +++ b/tslint.json @@ -138,7 +138,7 @@ "no-empty-interface": true, "no-string-literal": false, "no-string-throw": true, - "prefer-const": false, + "prefer-const": true, "unified-signatures": true, "whitespace": [ true,