From cd72f40841b68e3f4a2c6e6ed3c25a34d5d2261c Mon Sep 17 00:00:00 2001 From: VitoAlbano Date: Mon, 14 Oct 2024 00:08:11 +0100 Subject: [PATCH] [ci:force] - Fixed lint --- lib/content-services/.eslintrc.json | 2 +- .../src/lib/agent/services/agent.service.ts | 1 - .../alfresco-api-no-auth.service.ts | 17 +- .../alfresco-api-v2-loader.service.ts | 12 +- .../services/aspect-list.service.ts | 2 +- .../services/node-aspect.service.ts | 12 +- .../content-auth-loader-factory.ts | 1 - .../content-auth-loader.service.spec.ts | 1 - .../content-auth-loader.service.ts | 21 +- .../breadcrumb/breadcrumb.component.spec.ts | 3 +- .../dropdown-breadcrumb.component.ts | 1 - .../categories-management.component.spec.ts | 10 - .../categories-management.component.ts | 3 - .../category/mock/category-mock.service.ts | 14 +- .../category-tree-datasource.service.ts | 102 +- .../lib/category/services/category.service.ts | 10 - .../src/lib/common/events/file.event.ts | 12 +- .../search-configuration.interface.ts | 1 - .../src/lib/common/models/file.model.spec.ts | 4 +- .../lib/common/services/content.service.ts | 5 +- .../common/services/discovery-api.service.ts | 2 - .../common/services/favorites-api.service.ts | 23 +- .../lib/common/services/nodes-api.service.ts | 12 - .../common/services/people-content.service.ts | 7 - .../lib/common/services/rendition.service.ts | 2 - .../src/lib/common/services/sites.service.ts | 19 - .../src/lib/common/services/upload.service.ts | 7 - .../content-metadata.component.spec.ts | 2 - .../content-metadata.component.ts | 2 - .../services/basic-properties.service.ts | 12 +- .../aspect-oriented-config.service.spec.ts | 72 +- .../config/aspect-oriented-config.service.ts | 37 +- .../content-metadata-config.factory.spec.ts | 13 +- .../config/indifferent-config.service.ts | 20 +- .../config/layout-oriented-config.service.ts | 30 +- .../services/content-metadata.service.ts | 23 +- .../services/content-type-property.service.ts | 38 +- .../property-descriptors.service.spec.ts | 15 +- .../services/property-descriptors.service.ts | 18 +- .../content-node-dialog.service.ts | 10 - .../content-node-selector-panel.component.ts | 13 +- .../services/shared-links-api.service.ts | 22 +- .../lib/content-type/content-type.service.ts | 8 +- .../services/download-zip.service.ts | 7 +- .../check-allowable-operation.directive.ts | 6 - .../lib/directives/node-download.directive.ts | 2 - .../content-action-list.component.ts | 1 - .../components/document-list.component.ts | 3 +- .../data/share-datatable-adapter.ts | 49 +- .../models/content-action.model.ts | 6 +- .../services/custom-resources.service.ts | 12 - .../services/document-actions.service.ts | 3 - .../services/document-list.service.ts | 7 - .../services/folder-actions.service.ts | 54 +- .../document-list/services/lock.service.ts | 4 +- .../services/node-actions.service.ts | 5 - .../src/lib/group/services/group.service.ts | 52 +- .../legal-hold/services/legal-hold.service.ts | 9 - .../lib/mock/add-permission.component.mock.ts | 351 +-- .../src/lib/mock/alfresco-api.service.mock.ts | 4 +- .../lib/mock/date-range-search-filter.mock.ts | 6 +- .../lib/mock/document-list.component.mock.ts | 271 ++- .../inherited-permission.component.mock.ts | 5 +- .../mock/new-version-uploader.service.mock.ts | 47 +- .../mock/permission-list.component.mock.ts | 332 +-- .../src/lib/mock/search-filter-mock.ts | 114 +- .../new-version-uploader.service.ts | 1 - .../node-comments/mocks/node-comments.mock.ts | 130 +- .../services/node-comments.service.ts | 2 - .../permission-list.service.ts | 153 +- .../node-permission-dialog.service.ts | 18 +- .../services/node-permission.service.ts | 10 - .../lib/pipes/node-name-tooltip.pipe.spec.ts | 1 - .../prediction/services/prediction.service.ts | 2 - .../search-ai/services/search-ai.service.ts | 10 +- ...-chip-autocomplete-input.component.spec.ts | 7 - ...earch-chip-autocomplete-input.component.ts | 1 - ...ilter-autocomplete-chips.component.spec.ts | 1 - ...search-facet-chip-tabbed.component.spec.ts | 2 - ...rch-facet-tabbed-content.component.spec.ts | 2 - .../search-input.component.spec.ts | 1 - .../search-logical-filter.component.spec.ts | 3 - .../search-text/search-text.component.ts | 2 +- .../lib/search/forms/search-term-validator.ts | 11 +- .../models/search-filter-list.model.spec.ts | 11 +- .../search/models/search-filter-list.model.ts | 8 +- .../services/search-configuration.service.ts | 1 - .../search/services/search-filter.service.ts | 2 - ...earch-header-query-builder.service.spec.ts | 28 +- .../src/lib/search/services/search.service.ts | 3 - ...-controls-groups-marks-security.service.ts | 10 - .../src/lib/tag/services/tag.service.ts | 11 - .../tags-creator.component.spec.ts | 11 - .../tags-creator/tags-creator.component.ts | 5 - .../lib/tree-view/models/tree-view.model.ts | 2 - .../src/lib/tree/components/tree.component.ts | 9 - .../tree/mock/tree-service.service.mock.ts | 4 +- .../src/lib/tree/services/tree.service.ts | 7 - .../components/base-upload/upload-base.ts | 59 +- .../file-uploading-list.component.ts | 4 - .../components/upload-drag-area.component.ts | 5 - .../directives/file-draggable.directive.ts | 5 - .../version-compatibility-factory.ts | 1 - .../version-compatibility.service.ts | 11 +- .../content-version.service.ts | 1 - .../alfresco-viewer.component.spec.ts | 3 + lib/content-services/tsconfig.lib.json | 3 +- lib/content-services/tsconfig.spec.json | 2 +- lib/core/.eslintrc.json | 2 +- .../api/src/lib/adf-http-client.service.ts | 168 +- .../alfresco-api.param-encoder.ts | 1 - .../alfresco-api.response-error.ts | 3 +- .../alfresco-api/alfresco-api.utils.spec.ts | 6 - .../lib/alfresco-api/alfresco-api.utils.ts | 30 +- lib/core/api/src/lib/types.ts | 2 +- .../authentication.interceptor.spec.ts | 59 +- .../authentication.interceptor.ts | 53 +- .../src/_stories/breadcrumb.stories.ts | 9 +- .../src/_stories/demo-breadcrumb.component.ts | 10 +- .../directives/breadcrumb-focus.directive.ts | 9 +- .../src/lib/guards/is-feature-off.guard.ts | 2 +- .../src/lib/guards/is-feature-on.guard.ts | 2 +- .../lib/guards/is-flags-override-on.guard.ts | 3 +- .../providers/dummy-feature-flags.provider.ts | 1 - .../lib/services/debug-features.service.ts | 2 - lib/core/shell/src/lib/shell.module.ts | 2 - lib/core/shell/src/lib/shell.routes.ts | 8 +- .../app-config-storage-prefix.factory.spec.ts | 10 +- .../app-config-storage-prefix.factory.ts | 7 +- .../src/lib/app-config/app-config.loader.ts | 6 +- .../src/lib/app-config/app-config.service.ts | 8 - .../app-config/debug-app-config.service.ts | 1 - .../auth-bearer.interceptor.spec.ts | 7 +- .../auth-bearer.interceptor.ts | 88 +- .../basic-auth/basic-alfresco-auth.service.ts | 8 +- .../src/lib/auth/basic-auth/content-auth.ts | 17 +- .../src/lib/auth/basic-auth/process-auth.ts | 18 +- .../guard/auth-guard-sso-role.service.spec.ts | 1 - .../auth/guard/auth-guard-sso-role.service.ts | 2 +- .../src/lib/auth/mock/identity-group.mock.ts | 50 +- .../auth/mock/identity-group.service.mock.ts | 37 +- .../src/lib/auth/mock/identity-user.mock.ts | 64 +- .../auth/mock/identity-user.service.mock.ts | 47 +- .../src/lib/auth/mock/oauth2.service.mock.ts | 2 +- .../src/lib/auth/models/redirection.model.ts | 1 - .../src/lib/auth/oidc/auth-config.service.ts | 1 - lib/core/src/lib/auth/oidc/auth.module.ts | 26 +- lib/core/src/lib/auth/oidc/auth.service.ts | 71 +- .../auth/oidc/redirect-auth.service.spec.ts | 1 - .../lib/auth/oidc/redirect-auth.service.ts | 573 ++--- .../authentication-confirmation.component.ts | 6 +- .../auth/services/authentication.service.ts | 4 +- .../services/base-authentication.service.ts | 4 - .../auth/services/identity-group.service.ts | 92 +- .../services/identity-role.service.spec.ts | 94 +- .../auth/services/identity-role.service.ts | 4 - .../auth/services/identity-user.service.ts | 111 +- .../lib/auth/services/jwt-helper.service.ts | 13 - .../src/lib/auth/services/oauth2.service.ts | 19 +- .../auth/services/user-access.service.spec.ts | 2 - .../lib/auth/services/user-access.service.ts | 12 +- .../card-view/card-view.component.spec.ts | 1 - .../models/card-view-arrayitem.model.ts | 1 - .../models/card-view-baseitem.model.spec.ts | 50 +- .../models/card-view-boolitem.model.spec.ts | 1 - .../models/card-view-floatitem.model.spec.ts | 15 +- .../models/card-view-intitem.model.spec.ts | 15 +- .../models/card-view-selectitem.model.spec.ts | 6 +- .../models/card-view-textitem.model.spec.ts | 34 +- .../services/card-view-update.service.spec.ts | 23 +- .../services/card-view-update.service.ts | 5 +- .../card-view-item-float.validator.ts | 1 - .../card-view-item-int.validator.ts | 3 +- ...d-view-item-only-positive-int.validator.ts | 6 +- .../src/lib/clipboard/clipboard.service.ts | 3 - .../comments/mocks/comments.service.mock.ts | 67 +- .../mocks/comments.service.stories.mock.ts | 67 +- .../comments/mocks/comments.stories.mock.ts | 41 +- .../src/lib/common/models/log-levels.model.ts | 12 +- .../src/lib/common/services/cookie.service.ts | 14 +- .../lib/common/services/download.service.ts | 7 +- .../dynamic-component-mapper.service.ts | 12 +- .../services/highlight-transform.service.ts | 7 +- .../lib/common/services/log.service.spec.ts | 8 +- .../src/lib/common/services/log.service.ts | 10 - .../lib/common/services/page-title.service.ts | 7 +- .../lib/common/services/storage.service.ts | 4 - .../lib/common/services/thumbnail.service.ts | 4 +- .../src/lib/common/services/url.service.ts | 7 +- .../services/user-preferences.service.ts | 11 - .../src/lib/common/utils/date-fns-adapter.ts | 1 - .../src/lib/common/utils/date-fns-utils.ts | 7 - .../src/lib/common/utils/object-utils.spec.ts | 1 - lib/core/src/lib/common/utils/object-utils.ts | 44 +- lib/core/src/lib/common/utils/string-utils.ts | 5 +- lib/core/src/lib/context-menu/animations.ts | 44 +- .../context-menu-overlay.service.ts | 48 +- .../lib/context-menu/context-menu-overlay.ts | 3 +- .../datatable/components/data-cell.event.ts | 4 - .../components/data-row-action.event.ts | 3 - .../date-cell/date-cell.component.ts | 1 - .../location-cell/location-cell.component.ts | 1 - .../components/mocks/datatable.mock.ts | 8 +- .../number-cell/number-cell.component.ts | 9 +- .../datatable/data/data-row-event.model.ts | 2 - .../lib/datatable/data/data-sorting.model.ts | 7 +- .../datatable/data/object-datarow.model.ts | 2 - .../data/object-datatable-adapter.spec.ts | 53 +- .../edit-json/edit-json.dialog.module.ts | 9 +- .../edit-json.dialog.stories.component.ts | 11 +- .../lib/dialogs/edit-json/edit-json.dialog.ts | 5 +- .../unsaved-changes-dialog.component.ts | 1 - .../unsaved-changes.guard.ts | 1 - .../lib/directives/upload.directive.spec.ts | 3 +- .../src/lib/directives/upload.directive.ts | 2 - .../dynamic-chip-list.component.spec.ts | 3 - lib/core/src/lib/events/base.event.ts | 2 - .../form/components/form-base.component.ts | 1 - .../components/form-renderer.component.ts | 2 - .../form/components/mock/cloud-form.mock.ts | 90 +- .../mock/form-renderer.component.mock.ts | 112 +- .../src/lib/form/components/mock/form.mock.ts | 94 +- .../base-viewer/base-viewer.widget.spec.ts | 1 - .../widgets/core/container-column.model.ts | 1 - .../widgets/core/container.model.ts | 3 +- .../widgets/core/form-field.model.ts | 3 +- .../widgets/core/form-outcome-event.model.ts | 4 +- .../widgets/core/form-outcome.model.spec.ts | 1 - .../widgets/core/form-widget.model.spec.ts | 1 - .../widgets/core/form.model.spec.ts | 35 +- .../components/widgets/core/form.model.ts | 7 - .../components/widgets/core/tab.model.spec.ts | 1 - .../form/components/widgets/core/tab.model.ts | 3 +- .../widgets/text/text-mask.component.ts | 4 +- .../src/lib/form/events/form-error.event.ts | 2 - .../src/lib/form/events/form-field.event.ts | 2 - .../src/lib/form/events/form-rules.event.ts | 2 - lib/core/src/lib/form/events/form.event.ts | 1 - .../form/events/validate-form-field.event.ts | 2 - .../lib/form/events/validate-form.event.ts | 1 - .../src/lib/form/models/form-rules.model.ts | 1 - .../form/models/widget-visibility.model.ts | 4 +- .../form/services/form-rendering.service.ts | 1 - .../src/lib/form/services/form.service.ts | 1 - .../widget-visibility-cloud.service.spec.ts | 8 +- .../widget-visibility.service.spec.ts | 2 +- .../language-menu/service/language.service.ts | 42 +- .../sidebar-action-menu.component.spec.ts | 1 + .../login-dialog-panel.component.ts | 6 +- .../login-dialog.component.stories.ts | 5 +- .../login-dialog/login-dialog.component.ts | 8 +- .../login-dialog.stories.component.ts | 20 +- .../login/login.component.stories.ts | 5 +- .../login/components/login/login.component.ts | 8 - .../directives/login-footer.directive.ts | 3 +- .../directives/login-header.directive.ts | 3 +- .../lib/login/models/login-submit.event.ts | 2 - .../lib/login/models/login-success.event.ts | 6 +- lib/core/src/lib/mock/cookie.service.mock.ts | 4 - lib/core/src/lib/mock/data-column.mock.ts | 50 +- lib/core/src/lib/mock/event.mock.ts | 1 - .../form/form-definition-readonly.mock.ts | 370 ++-- .../form/form-definition-visibility.mock.ts | 8 +- .../src/lib/mock/form/form-definition.mock.ts | 12 +- .../src/lib/mock/form/form.component.mock.ts | 8 +- .../src/lib/mock/form/form.service.mock.ts | 334 +-- .../widget-visibility-cloud.service.mock.ts | 38 +- .../form/widget-visibility.service.mock.ts | 1885 +++++++++-------- .../src/lib/mock/language.service.mock.ts | 38 +- lib/core/src/lib/models/pagination.model.ts | 1 - .../lib/models/request-pagination.model.ts | 1 - .../helpers/notification.factory.ts | 8 +- .../services/notification.service.ts | 119 +- lib/core/src/lib/pipes/file-size.pipe.spec.ts | 17 +- lib/core/src/lib/pipes/full-name.pipe.spec.ts | 11 +- lib/core/src/lib/pipes/localized-date.pipe.ts | 8 +- lib/core/src/lib/pipes/time-ago.pipe.ts | 14 +- .../src/lib/pipes/user-initial.pipe.spec.ts | 2 - lib/core/src/lib/pipes/user-like.interface.ts | 2 +- .../src/lib/progress/progress.component.ts | 2 - lib/core/src/lib/search-text/animations.ts | 28 +- .../search-text-input.component.spec.ts | 2 - .../lib/services/startup-service-factory.ts | 1 - .../snackbar-content.component.ts | 7 +- .../snackbar-content.module.ts | 16 +- .../sorting-picker.component.spec.ts | 5 +- .../translation/translation.service.spec.ts | 4 +- .../lib/translation/translation.service.ts | 15 +- .../pdf-viewer/pdf-viewer.component.ts | 9 - .../viewer-render/viewer-render.component.ts | 2 - .../directives/viewer-extension.directive.ts | 1 - .../services/rendering-queue.services.ts | 5 - .../lib/viewer/services/view-util.service.ts | 4 - lib/process-services-cloud/.eslintrc.json | 2 +- .../form/models/task-variable-cloud.model.ts | 2 +- lib/process-services-cloud/tsconfig.lib.json | 3 +- lib/process-services-cloud/tsconfig.spec.json | 2 +- lib/process-services/.eslintrc.json | 2 +- .../form/start-form/start-form.component.ts | 3 - lib/process-services/tsconfig.lib.json | 3 +- lib/process-services/tsconfig.spec.json | 2 +- 301 files changed, 3769 insertions(+), 4836 deletions(-) diff --git a/lib/content-services/.eslintrc.json b/lib/content-services/.eslintrc.json index a4408fe1e67..6b350db09ed 100644 --- a/lib/content-services/.eslintrc.json +++ b/lib/content-services/.eslintrc.json @@ -10,7 +10,7 @@ "createDefaultProgram": true }, "rules": { - "jsdoc/newline-after-description": "warn", + "jsdoc/tag-lines": [1], "@typescript-eslint/naming-convention": "warn", "@typescript-eslint/consistent-type-assertions": "warn", "@typescript-eslint/prefer-for-of": "warn", diff --git a/lib/content-services/src/lib/agent/services/agent.service.ts b/lib/content-services/src/lib/agent/services/agent.service.ts index 739997ee936..64225cd5ed6 100644 --- a/lib/content-services/src/lib/agent/services/agent.service.ts +++ b/lib/content-services/src/lib/agent/services/agent.service.ts @@ -39,7 +39,6 @@ export class AgentService { /** * Gets all agents from cache. If cache is empty, fetches agents from backend. - * * @returns Agent[] list containing agents. */ getAgents(): Observable { diff --git a/lib/content-services/src/lib/api-factories/alfresco-api-no-auth.service.ts b/lib/content-services/src/lib/api-factories/alfresco-api-no-auth.service.ts index 1530ccbd47c..e932fd1be42 100644 --- a/lib/content-services/src/lib/api-factories/alfresco-api-no-auth.service.ts +++ b/lib/content-services/src/lib/api-factories/alfresco-api-no-auth.service.ts @@ -23,18 +23,17 @@ import { AlfrescoApiService } from '../services/alfresco-api.service'; @Injectable() export class AlfrescoApiNoAuthService extends AlfrescoApiService { - constructor( - storage: StorageService, - appConfig: AppConfigService, - private readonly adfHttpClient: AdfHttpClient - ) { + constructor(storage: StorageService, appConfig: AppConfigService, private readonly adfHttpClient: AdfHttpClient) { super(appConfig, storage); } override createInstance(config: AlfrescoApiConfig) { - return new AlfrescoApi({ - ...config, - oauthInit: false - }, this.adfHttpClient); + return new AlfrescoApi( + { + ...config, + oauthInit: false + }, + this.adfHttpClient + ); } } diff --git a/lib/content-services/src/lib/api-factories/alfresco-api-v2-loader.service.ts b/lib/content-services/src/lib/api-factories/alfresco-api-v2-loader.service.ts index 353f62ce80d..dc7426f1278 100644 --- a/lib/content-services/src/lib/api-factories/alfresco-api-v2-loader.service.ts +++ b/lib/content-services/src/lib/api-factories/alfresco-api-v2-loader.service.ts @@ -18,11 +18,10 @@ import { AlfrescoApiConfig } from '@alfresco/js-api'; import { Injectable } from '@angular/core'; import { AppConfigService, AppConfigValues, StorageService } from '@alfresco/adf-core'; -import { AlfrescoApiService } from '../services/alfresco-api.service'; +import { AlfrescoApiService } from '../services/alfresco-api.service'; /** * Create a factory to resolve an api service instance - * * @param angularAlfrescoApiService loader service * @returns factory function */ @@ -34,10 +33,11 @@ export function createAlfrescoApiInstance(angularAlfrescoApiService: AlfrescoApi providedIn: 'root' }) export class AlfrescoApiLoaderService { - constructor(private readonly appConfig: AppConfigService, - private readonly apiService: AlfrescoApiService, - private storageService: StorageService) { - } + constructor( + private readonly appConfig: AppConfigService, + private readonly apiService: AlfrescoApiService, + private storageService: StorageService + ) {} async init(): Promise { await this.appConfig.load(); diff --git a/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts b/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts index e33b0c1395a..88c7e081e29 100644 --- a/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts +++ b/lib/content-services/src/lib/aspect-list/services/aspect-list.service.ts @@ -16,7 +16,7 @@ */ import { Injectable } from '@angular/core'; -import { AlfrescoApiService } from '../../services/alfresco-api.service'; +import { AlfrescoApiService } from '../../services/alfresco-api.service'; import { AppConfigService } from '@alfresco/adf-core'; import { from, Observable, of, zip } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; diff --git a/lib/content-services/src/lib/aspect-list/services/node-aspect.service.ts b/lib/content-services/src/lib/aspect-list/services/node-aspect.service.ts index 3d437821757..85eae65ea14 100644 --- a/lib/content-services/src/lib/aspect-list/services/node-aspect.service.ts +++ b/lib/content-services/src/lib/aspect-list/services/node-aspect.service.ts @@ -25,12 +25,12 @@ import { TagService } from '../../tag/services/tag.service'; providedIn: 'root' }) export class NodeAspectService { - - constructor(private nodesApiService: NodesApiService, - private dialogAspectListService: DialogAspectListService, - private cardViewContentUpdateService: CardViewContentUpdateService, - private tagService: TagService) { - } + constructor( + private nodesApiService: NodesApiService, + private dialogAspectListService: DialogAspectListService, + private cardViewContentUpdateService: CardViewContentUpdateService, + private tagService: TagService + ) {} updateNodeAspects(nodeId: string, selectorAutoFocusedOnClose?: string) { this.dialogAspectListService.openAspectListDialog(nodeId, selectorAutoFocusedOnClose).subscribe((aspectList) => { diff --git a/lib/content-services/src/lib/auth-loader/content-auth-loader-factory.ts b/lib/content-services/src/lib/auth-loader/content-auth-loader-factory.ts index 2c38e49b4cf..7879e7b5e70 100644 --- a/lib/content-services/src/lib/auth-loader/content-auth-loader-factory.ts +++ b/lib/content-services/src/lib/auth-loader/content-auth-loader-factory.ts @@ -19,7 +19,6 @@ import { ContentAuthLoaderService } from './content-auth-loader.service'; /** * Create a content auth factory - * * @param authLoaderService service dependency * @returns factory function */ diff --git a/lib/content-services/src/lib/auth-loader/content-auth-loader.service.spec.ts b/lib/content-services/src/lib/auth-loader/content-auth-loader.service.spec.ts index 88fd8e4b522..36d84a7bd8f 100644 --- a/lib/content-services/src/lib/auth-loader/content-auth-loader.service.spec.ts +++ b/lib/content-services/src/lib/auth-loader/content-auth-loader.service.spec.ts @@ -54,7 +54,6 @@ describe('ContentAuthLoaderService', () => { basicAlfrescoAuthService = TestBed.inject(BasicAlfrescoAuthService); }); - it('should require Alf ticket on login if OAuth and provider is ALL or ECM', fakeAsync(() => { spyOn(authService, 'isOauth').and.returnValue(true); spyOn(authService, 'isALLProvider').and.returnValue(true); diff --git a/lib/content-services/src/lib/auth-loader/content-auth-loader.service.ts b/lib/content-services/src/lib/auth-loader/content-auth-loader.service.ts index da9e2ce6a1b..08c1f8e05e0 100644 --- a/lib/content-services/src/lib/auth-loader/content-auth-loader.service.ts +++ b/lib/content-services/src/lib/auth-loader/content-auth-loader.service.ts @@ -21,22 +21,15 @@ import { take } from 'rxjs/operators'; @Injectable() export class ContentAuthLoaderService { - - constructor( - private readonly basicAlfrescoAuthService: BasicAlfrescoAuthService, - private readonly authService: AuthenticationService - ) { - } + constructor(private readonly basicAlfrescoAuthService: BasicAlfrescoAuthService, private readonly authService: AuthenticationService) {} init(): void { - this.authService.onLogin - .pipe(take(1)) - .subscribe({ - next: async () => { - if (this.authService.isOauth() && (this.authService.isALLProvider() || this.authService.isECMProvider())) { - await this.basicAlfrescoAuthService.requireAlfTicket(); - } + this.authService.onLogin.pipe(take(1)).subscribe({ + next: async () => { + if (this.authService.isOauth() && (this.authService.isALLProvider() || this.authService.isECMProvider())) { + await this.basicAlfrescoAuthService.requireAlfTicket(); } - }); + } + }); } } diff --git a/lib/content-services/src/lib/breadcrumb/breadcrumb.component.spec.ts b/lib/content-services/src/lib/breadcrumb/breadcrumb.component.spec.ts index 9e3c73a6a37..3f73dd5d012 100644 --- a/lib/content-services/src/lib/breadcrumb/breadcrumb.component.spec.ts +++ b/lib/content-services/src/lib/breadcrumb/breadcrumb.component.spec.ts @@ -33,8 +33,7 @@ describe('Breadcrumb', () => { }); let documentListComponent: DocumentListComponent; - const getBreadcrumbActionText = (): string => - fixture.debugElement.nativeElement.querySelector('.adf-breadcrumb-item-current').textContent.trim(); + const getBreadcrumbActionText = (): string => fixture.debugElement.nativeElement.querySelector('.adf-breadcrumb-item-current').textContent.trim(); beforeEach(() => { TestBed.configureTestingModule({ diff --git a/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts b/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts index 0db1584e806..c3d8015836b 100644 --- a/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts +++ b/lib/content-services/src/lib/breadcrumb/dropdown-breadcrumb.component.ts @@ -62,7 +62,6 @@ export class DropdownBreadcrumbComponent extends BreadcrumbComponent implements /** * Check if route has more than one element (means: we are not in the root directory) - * * @returns `true` if there are previous nodes, otherwise `false` */ hasPreviousNodes(): boolean { diff --git a/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts b/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts index 7eaa01655d5..01040b65fee 100644 --- a/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts +++ b/lib/content-services/src/lib/category/categories-management/categories-management.component.spec.ts @@ -68,7 +68,6 @@ describe('CategoriesManagementComponent', () => { /** * Get no categories message - * * @returns message text */ function getNoCategoriesMessage(): string { @@ -77,7 +76,6 @@ describe('CategoriesManagementComponent', () => { /** * Get assigned categories list - * * @returns list of native elements */ function getAssignedCategoriesList(): HTMLSpanElement[] { @@ -86,7 +84,6 @@ describe('CategoriesManagementComponent', () => { /** * Get the exiting categories list - * * @returns list of material option element */ function getExistingCategoriesList(): HTMLElement[] { @@ -95,7 +92,6 @@ describe('CategoriesManagementComponent', () => { /** * Create new category - * * @param name name of the category * @param addUsingEnter use Enter key * @param typingTimeout typing timeout in milliseconds (default 300) @@ -115,7 +111,6 @@ describe('CategoriesManagementComponent', () => { /** * Get first error - * * @returns error text */ function getFirstError(): string { @@ -124,7 +119,6 @@ describe('CategoriesManagementComponent', () => { /** * Get selection list - * * @returns material selection list */ function getSelectionList(): MatList { @@ -133,7 +127,6 @@ describe('CategoriesManagementComponent', () => { /** * Get remove category buttons - * * @returns list of native elements */ function getRemoveCategoryButtons(): HTMLButtonElement[] { @@ -144,7 +137,6 @@ describe('CategoriesManagementComponent', () => { /** * Get category control input - * * @returns native input element */ function getCategoryControlInput(): HTMLInputElement { @@ -153,7 +145,6 @@ describe('CategoriesManagementComponent', () => { /** * Get create category label - * * @returns native element */ function getCreateCategoryLabel(): HTMLSpanElement { @@ -162,7 +153,6 @@ describe('CategoriesManagementComponent', () => { /** * Type new category - * * @param name name of the category * @param timeout typing timeout in milliseconds (default 300) */ diff --git a/lib/content-services/src/lib/category/categories-management/categories-management.component.ts b/lib/content-services/src/lib/category/categories-management/categories-management.component.ts index 9e6513b4997..12af93659df 100644 --- a/lib/content-services/src/lib/category/categories-management/categories-management.component.ts +++ b/lib/content-services/src/lib/category/categories-management/categories-management.component.ts @@ -91,7 +91,6 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy { /** * Decides if categoryNameControl should be visible. Sets also existing categories panel visibility * and scrolls control into view when visible. - * * @param categoryNameControlVisible control visibility. */ @Input() @@ -245,7 +244,6 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy { /** * Adds existing category to categories list and removes it from existing categories list. - * * @param category - selection list change containing selected category */ addCategoryToAssign(category: Category) { @@ -260,7 +258,6 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy { /** * Removes the category from categories list and adds it to existing categories list in ASSIGN mode. - * * @param category - category to remove */ removeCategory(category: Category) { diff --git a/lib/content-services/src/lib/category/mock/category-mock.service.ts b/lib/content-services/src/lib/category/mock/category-mock.service.ts index 33188fcdcf9..8e6b555485b 100644 --- a/lib/content-services/src/lib/category/mock/category-mock.service.ts +++ b/lib/content-services/src/lib/category/mock/category-mock.service.ts @@ -18,7 +18,10 @@ import { Injectable } from '@angular/core'; import { CategoryEntry, - CategoryPaging, Pagination, PathInfo, ResultNode, + CategoryPaging, + Pagination, + PathInfo, + ResultNode, ResultSetPaging, ResultSetPagingList, ResultSetRowEntry @@ -27,7 +30,6 @@ import { Observable, of } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class CategoryServiceMock { - public getSubcategories(parentNodeId: string, skipCount?: number, maxItems?: number): Observable { return parentNodeId ? of(this.getChildrenLevelResponse(skipCount, maxItems)) : of(this.getRootLevelResponse(skipCount, maxItems)); } @@ -66,12 +68,12 @@ export class CategoryServiceMock { } private getRootLevelResponse(skipCount?: number, maxItems?: number): CategoryPaging { - const rootCategoryEntry: CategoryEntry = {entry: {id: 'testId', name: 'testNode', parentId: '-root-', hasChildren: true}}; - return {list: {pagination: {skipCount, maxItems, hasMoreItems: false}, entries: [rootCategoryEntry]}}; + const rootCategoryEntry: CategoryEntry = { entry: { id: 'testId', name: 'testNode', parentId: '-root-', hasChildren: true } }; + return { list: { pagination: { skipCount, maxItems, hasMoreItems: false }, entries: [rootCategoryEntry] } }; } private getChildrenLevelResponse(skipCount?: number, maxItems?: number): CategoryPaging { - const childCategoryEntry: CategoryEntry = {entry: {id: 'childId', name: 'childNode', parentId: 'testId', hasChildren: false}}; - return {list: {pagination: {skipCount, maxItems, hasMoreItems: true}, entries: [childCategoryEntry]}}; + const childCategoryEntry: CategoryEntry = { entry: { id: 'childId', name: 'childNode', parentId: 'testId', hasChildren: false } }; + return { list: { pagination: { skipCount, maxItems, hasMoreItems: true }, entries: [childCategoryEntry] } }; } } diff --git a/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts b/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts index 9d3fc4640b1..c3c0876ef2d 100644 --- a/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts +++ b/lib/content-services/src/lib/category/services/category-tree-datasource.service.ts @@ -24,59 +24,65 @@ import { from, Observable } from 'rxjs'; import { map, mergeMap, toArray } from 'rxjs/operators'; @Injectable({ providedIn: 'root' }) -export class CategoryTreeDatasourceService extends TreeService { - +export class CategoryTreeDatasourceService extends TreeService { constructor(private categoryService: CategoryService) { super(); } public getSubNodes(parentNodeId: string, skipCount?: number, maxItems?: number, name?: string): Observable> { - return !name ? this.categoryService.getSubcategories(parentNodeId, skipCount, maxItems).pipe(map((response: CategoryPaging) => { - const parentNode: CategoryNode = this.getParentNode(parentNodeId); - const nodesList: CategoryNode[] = response.list.entries.map((entry: CategoryEntry) => ({ - id: entry.entry.id, - nodeName: entry.entry.name, - parentId: entry.entry.parentId, - hasChildren: entry.entry.hasChildren, - level: parentNode ? parentNode.level + 1 : 0, - isLoading: false, - nodeType: TreeNodeType.RegularNode - })); - if (response.list.pagination.hasMoreItems && parentNode) { - const loadMoreNode: CategoryNode = { - id: 'loadMore', - nodeName: '', - parentId: parentNode.id, - hasChildren: false, - level: parentNode.level + 1, - isLoading: false, - nodeType: TreeNodeType.LoadMoreNode - }; - nodesList.push(loadMoreNode); - } - const treeResponse: TreeResponse = {entries: nodesList, pagination: response.list.pagination}; - return treeResponse; - })) : this.categoryService.searchCategories(name, skipCount, maxItems).pipe(mergeMap((pagingResult) => { - const nextAfterGeneralPathPartIndex = 3; - const pathSeparator = '/'; - return from(pagingResult.list.entries).pipe(mergeMap((category) => { - const path = category.entry.path.name.split(pathSeparator).slice(nextAfterGeneralPathPartIndex) - .join(pathSeparator); + return !name + ? this.categoryService.getSubcategories(parentNodeId, skipCount, maxItems).pipe( + map((response: CategoryPaging) => { + const parentNode: CategoryNode = this.getParentNode(parentNodeId); + const nodesList: CategoryNode[] = response.list.entries.map((entry: CategoryEntry) => ({ + id: entry.entry.id, + nodeName: entry.entry.name, + parentId: entry.entry.parentId, + hasChildren: entry.entry.hasChildren, + level: parentNode ? parentNode.level + 1 : 0, + isLoading: false, + nodeType: TreeNodeType.RegularNode + })); + if (response.list.pagination.hasMoreItems && parentNode) { + const loadMoreNode: CategoryNode = { + id: 'loadMore', + nodeName: '', + parentId: parentNode.id, + hasChildren: false, + level: parentNode.level + 1, + isLoading: false, + nodeType: TreeNodeType.LoadMoreNode + }; + nodesList.push(loadMoreNode); + } + const treeResponse: TreeResponse = { entries: nodesList, pagination: response.list.pagination }; + return treeResponse; + }) + ) + : this.categoryService.searchCategories(name, skipCount, maxItems).pipe( + mergeMap((pagingResult) => { + const nextAfterGeneralPathPartIndex = 3; + const pathSeparator = '/'; + return from(pagingResult.list.entries).pipe( + mergeMap((category) => { + const path = category.entry.path.name.split(pathSeparator).slice(nextAfterGeneralPathPartIndex).join(pathSeparator); - return this.categoryService.getCategory(category.entry.id).pipe( - map((res) => ({ - id: category.entry.id, - nodeName: path ? `${path}/${category.entry.name}` : category.entry.name, - parentId: category.entry.parentId, - level: 0, - nodeType: TreeNodeType.RegularNode, - hasChildren: res.entry.hasChildren, - isLoading: false - })) - ); - }), - toArray(), - map(res => ({entries: res, pagination: pagingResult.list.pagination}))); - })); + return this.categoryService.getCategory(category.entry.id).pipe( + map((res) => ({ + id: category.entry.id, + nodeName: path ? `${path}/${category.entry.name}` : category.entry.name, + parentId: category.entry.parentId, + level: 0, + nodeType: TreeNodeType.RegularNode, + hasChildren: res.entry.hasChildren, + isLoading: false + })) + ); + }), + toArray(), + map((res) => ({ entries: res, pagination: pagingResult.list.pagination })) + ); + }) + ); } } diff --git a/lib/content-services/src/lib/category/services/category.service.ts b/lib/content-services/src/lib/category/services/category.service.ts index 9471daa8a46..8d1ad336456 100644 --- a/lib/content-services/src/lib/category/services/category.service.ts +++ b/lib/content-services/src/lib/category/services/category.service.ts @@ -53,7 +53,6 @@ export class CategoryService { /** * Get subcategories of a given parent category - * * @param parentCategoryId The identifier of a parent category. * @param skipCount Number of top categories to skip. * @param maxItems Maximum number of subcategories returned from Observable. @@ -65,7 +64,6 @@ export class CategoryService { /** * Get a category by ID - * * @param categoryId The identifier of a category. * @param opts Optional parameters. * @param opts.fields A list of field names. @@ -80,7 +78,6 @@ export class CategoryService { /** * Creates subcategories under category with provided categoryId - * * @param parentCategoryId The identifier of a parent category. * @param payload List of categories to be created. * @returns Observable @@ -91,7 +88,6 @@ export class CategoryService { /** * Updates category - * * @param categoryId The identifier of a category. * @param payload Updated category body * @returns Observable @@ -102,7 +98,6 @@ export class CategoryService { /** * Deletes category - * * @param categoryId The identifier of a category. * @returns Observable */ @@ -112,7 +107,6 @@ export class CategoryService { /** * Searches categories by their name. - * * @param name Value for name which should be used during searching categories. * @param skipCount Specify how many first results should be skipped. Default 0. * @param maxItems Specify max number of returned categories. Default is specified by UserPreferencesService. @@ -137,7 +131,6 @@ export class CategoryService { /** * List of categories that node is assigned to - * * @param nodeId The identifier of a node. * @returns Observable Categories that node is assigned to */ @@ -147,7 +140,6 @@ export class CategoryService { /** * Unlink category from a node - * * @param nodeId The identifier of a node. * @param categoryId The identifier of a category. * @returns Observable @@ -158,7 +150,6 @@ export class CategoryService { /** * Link node to a category - * * @param nodeId The identifier of a node. * @param categoryLinkBodyCreate Array of a categories that node will be linked to. * @returns Observable @@ -169,7 +160,6 @@ export class CategoryService { /** * Checks if categories plugin is enabled. - * * @returns boolean true if categories plugin is enabled, false otherwise. */ areCategoriesEnabled(): boolean { diff --git a/lib/content-services/src/lib/common/events/file.event.ts b/lib/content-services/src/lib/common/events/file.event.ts index 008ad64a26f..940ff108d5e 100644 --- a/lib/content-services/src/lib/common/events/file.event.ts +++ b/lib/content-services/src/lib/common/events/file.event.ts @@ -18,35 +18,27 @@ import { FileModel, FileUploadStatus } from '../models/file.model'; export class FileUploadEvent { - constructor( public readonly file: FileModel, public readonly status: FileUploadStatus = FileUploadStatus.Pending, - public readonly error: any = null) { - } - + public readonly error: any = null + ) {} } export class FileUploadCompleteEvent extends FileUploadEvent { - constructor(file: FileModel, public totalComplete: number = 0, public data?: any, public totalAborted: number = 0) { super(file, FileUploadStatus.Complete); } - } export class FileUploadDeleteEvent extends FileUploadEvent { - constructor(file: FileModel, public totalComplete: number = 0) { super(file, FileUploadStatus.Deleted); } - } export class FileUploadErrorEvent extends FileUploadEvent { - constructor(file: FileModel, public error: any, public totalError: number = 0) { super(file, FileUploadStatus.Error); } - } diff --git a/lib/content-services/src/lib/common/interfaces/search-configuration.interface.ts b/lib/content-services/src/lib/common/interfaces/search-configuration.interface.ts index 91fb3d1da04..6a4a5f2d6b7 100644 --- a/lib/content-services/src/lib/common/interfaces/search-configuration.interface.ts +++ b/lib/content-services/src/lib/common/interfaces/search-configuration.interface.ts @@ -20,7 +20,6 @@ import { SearchRequest } from '@alfresco/js-api'; export interface SearchConfigurationInterface { /** * Generates a query object with custom search parameters. - * * @param searchTerm Term text to search for * @param maxResults Maximum number of search results to show in a page * @param skipCount The offset of the start of the page within the results list diff --git a/lib/content-services/src/lib/common/models/file.model.spec.ts b/lib/content-services/src/lib/common/models/file.model.spec.ts index eada504bfb9..330a1c3441f 100644 --- a/lib/content-services/src/lib/common/models/file.model.spec.ts +++ b/lib/content-services/src/lib/common/models/file.model.spec.ts @@ -18,9 +18,7 @@ import { FileModel } from './file.model'; describe('FileModel', () => { - describe('extension', () => { - it('should return the extension if file has it', () => { const file = new FileModel({ name: 'tyrion-lannister.doc' } as File); @@ -33,7 +31,7 @@ describe('FileModel', () => { expect(file.extension).toBe(''); }); - it('should return the empty string if file is starting with . and doesn\'t have extension', () => { + it("should return the empty string if file is starting with . and doesn't have extension", () => { const file = new FileModel({ name: '.white-walkers' } as File); expect(file.extension).toBe(''); diff --git a/lib/content-services/src/lib/common/services/content.service.ts b/lib/content-services/src/lib/common/services/content.service.ts index 7898099fab8..692d14ce497 100644 --- a/lib/content-services/src/lib/common/services/content.service.ts +++ b/lib/content-services/src/lib/common/services/content.service.ts @@ -21,7 +21,7 @@ import { Subject } from 'rxjs'; import { AuthenticationService, ThumbnailService } from '@alfresco/adf-core'; import { PermissionsEnum } from '../models/permissions.enum'; import { AllowableOperationsEnum } from '../models/allowable-operations.enum'; -import { AlfrescoApiService } from '../../services/alfresco-api.service'; +import { AlfrescoApiService } from '../../services/alfresco-api.service'; export interface FolderCreatedEvent { name: string; @@ -48,7 +48,6 @@ export class ContentService { /** * Gets a content URL for the given node. - * * @param node Node or Node ID to get URL for. * @param attachment Toggles whether to retrieve content as an attachment for download * @param ticket Custom ticket to use for authentication @@ -76,7 +75,6 @@ export class ContentService { /** * Checks if the user has permission on that node - * * @param node Node to check permissions * @param permission Required permission type * @param userId Optional current user id will be taken by default @@ -110,7 +108,6 @@ export class ContentService { /** * Checks if the user has permissions on that node - * * @param node Node to check allowableOperations * @param allowableOperation Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions * @returns True if the user has the required permissions, false otherwise diff --git a/lib/content-services/src/lib/common/services/discovery-api.service.ts b/lib/content-services/src/lib/common/services/discovery-api.service.ts index 3a8ab25974c..f3ae479642f 100644 --- a/lib/content-services/src/lib/common/services/discovery-api.service.ts +++ b/lib/content-services/src/lib/common/services/discovery-api.service.ts @@ -52,7 +52,6 @@ export class DiscoveryApiService { /** * Gets product information for Content Services. - * * @returns ProductVersionModel containing product details */ getEcmProductInfo(): Observable { @@ -64,7 +63,6 @@ export class DiscoveryApiService { /** * Gets product information for Process Services. - * * @returns ProductVersionModel containing product details */ getBpmProductInfo(): Observable { diff --git a/lib/content-services/src/lib/common/services/favorites-api.service.ts b/lib/content-services/src/lib/common/services/favorites-api.service.ts index 4bd719652cd..35b3779fb92 100644 --- a/lib/content-services/src/lib/common/services/favorites-api.service.ts +++ b/lib/content-services/src/lib/common/services/favorites-api.service.ts @@ -26,7 +26,6 @@ import { catchError } from 'rxjs/operators'; providedIn: 'root' }) export class FavoritesApiService { - private _favoritesApi: FavoritesApi; get favoritesApi(): FavoritesApi { this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance()); @@ -42,16 +41,11 @@ export class FavoritesApiService { return { entry }; } - constructor( - private apiService: AlfrescoApiService, - private preferences: UserPreferencesService - ) { - } + constructor(private apiService: AlfrescoApiService, private preferences: UserPreferencesService) {} remapFavoritesData(data: FavoritePaging = {}): NodePaging { - const pagination = (data?.list?.pagination || {}); - const entries: any[] = this - .remapFavoriteEntries(data?.list?.entries || []); + const pagination = data?.list?.pagination || {}; + const entries: any[] = this.remapFavoriteEntries(data?.list?.entries || []); return { list: { entries, pagination } @@ -63,13 +57,12 @@ export class FavoritesApiService { .map(({ entry: { target } }: any) => ({ entry: target.file || target.folder })) - .filter(({ entry }) => (!!entry)) + .filter(({ entry }) => !!entry) .map(FavoritesApiService.remapEntry); } /** * Gets the favorites for a user. - * * @param personId ID of the user * @param options Options supported by JS-API * @returns List of favorites @@ -82,12 +75,8 @@ export class FavoritesApiService { include: ['properties', 'allowableOperations'] }; const queryOptions = Object.assign(defaultOptions, options); - const promise = this.favoritesApi - .listFavorites(personId, queryOptions) - .then(this.remapFavoritesData); + const promise = this.favoritesApi.listFavorites(personId, queryOptions).then(this.remapFavoritesData); - return from(promise).pipe( - catchError((err) => of(err)) - ); + return from(promise).pipe(catchError((err) => of(err))); } } diff --git a/lib/content-services/src/lib/common/services/nodes-api.service.ts b/lib/content-services/src/lib/common/services/nodes-api.service.ts index 0d49083aea7..3cf35f8972b 100644 --- a/lib/content-services/src/lib/common/services/nodes-api.service.ts +++ b/lib/content-services/src/lib/common/services/nodes-api.service.ts @@ -52,7 +52,6 @@ export class NodesApiService { /** * Gets the stored information about a node. - * * @param nodeId ID of the target node * @param options Optional parameters supported by JS-API * @returns Node information @@ -71,7 +70,6 @@ export class NodesApiService { /** * Gets the items contained in a folder node. - * * @param nodeId ID of the target node * @param options Optional parameters supported by JS-API * @returns List of child items from the folder @@ -89,7 +87,6 @@ export class NodesApiService { /** * Creates a new document node inside a folder. - * * @param parentNodeId ID of the parent folder node * @param nodeBody Data for the new node * @param options Optional parameters supported by JS-API @@ -104,7 +101,6 @@ export class NodesApiService { /** * Creates a new folder node inside a parent folder. - * * @param parentNodeId ID of the parent folder node * @param nodeBody Data for the new folder * @param options Optional parameters supported by JS-API @@ -117,7 +113,6 @@ export class NodesApiService { /** * Updates the information about a node. - * * @param nodeId ID of the target node * @param nodeBody New data for the node * @param options Optional parameters supported by JS-API @@ -137,7 +132,6 @@ export class NodesApiService { /** * Moves a node to the trashcan. - * * @param nodeId ID of the target node * @param options Optional parameters supported by JS-API * @returns Empty result that notifies when the deletion is complete @@ -148,7 +142,6 @@ export class NodesApiService { /** * Restores a node previously moved to the trashcan. - * * @param nodeId ID of the node to restore * @returns Details of the restored node */ @@ -161,7 +154,6 @@ export class NodesApiService { /** * Get the metadata and the nodeType for a nodeId cleaned by the prefix. - * * @param nodeId ID of the target node * @returns Node metadata */ @@ -171,7 +163,6 @@ export class NodesApiService { /** * Gets the list of holds assigned to the node. - * * @param nodeId ID of the target node * @param options Optional parameters supported by JS-API * @param options.includeSource Also include **source** (in addition to **entries**) with folder information on **nodeId** @@ -198,7 +189,6 @@ export class NodesApiService { /** * Gets content for the given node. - * * @param nodeId ID of the target node * @returns Content data */ @@ -208,7 +198,6 @@ export class NodesApiService { /** * Create a new Node inside `-root-` folder - * * @param name Node name * @param nodeType Node type * @param properties Node body properties @@ -227,7 +216,6 @@ export class NodesApiService { /** * Create a new Node from form metadata. - * * @param nodeType Node type * @param nameSpace Namespace for properties * @param data Property data to store in the node under namespace diff --git a/lib/content-services/src/lib/common/services/people-content.service.ts b/lib/content-services/src/lib/common/services/people-content.service.ts index 95a89294fc0..3bd79958fb3 100644 --- a/lib/content-services/src/lib/common/services/people-content.service.ts +++ b/lib/content-services/src/lib/common/services/people-content.service.ts @@ -60,7 +60,6 @@ export class PeopleContentService { /** * Gets information about a user identified by their username. - * * @param personId ID of the target user * @returns User information */ @@ -74,7 +73,6 @@ export class PeopleContentService { /** * Gets information about the current user alias -me- - * * @returns User information */ getCurrentUserInfo(): Observable { @@ -86,7 +84,6 @@ export class PeopleContentService { /** * Used to know if the current user has the admin capability - * * @returns true or false */ isCurrentUserAdmin(): boolean { @@ -102,7 +99,6 @@ export class PeopleContentService { /** * Gets a list of people. - * * @param requestQuery maxItems and skipCount parameters supported by JS-API * @returns Response containing pagination and list of entries */ @@ -124,7 +120,6 @@ export class PeopleContentService { /** * Creates new person. - * * @param newPerson Object containing the new person details. * @param opts Optional parameters * @returns Created new person @@ -135,7 +130,6 @@ export class PeopleContentService { /** * Updates the person details - * * @param personId The identifier of a person * @param details The person details * @param opts Optional parameters @@ -147,7 +141,6 @@ export class PeopleContentService { /** * Returns a profile image as a URL. - * * @param avatarId Target avatar * @returns Image URL */ diff --git a/lib/content-services/src/lib/common/services/rendition.service.ts b/lib/content-services/src/lib/common/services/rendition.service.ts index 53465e5dc83..7de50ca0398 100644 --- a/lib/content-services/src/lib/common/services/rendition.service.ts +++ b/lib/content-services/src/lib/common/services/rendition.service.ts @@ -253,7 +253,6 @@ export class RenditionService { * This method takes a url to trigger the print dialog against, and the type of artifact that it * is. * This URL should be one that can be rendered in the browser, for example PDF, Image, or Text - * * @param url url to print * @param type type of the rendition */ @@ -278,7 +277,6 @@ export class RenditionService { * These are: images, PDF files, or PDF rendition of files. * We also force PDF rendition for TEXT type objects, otherwise the default URL is to download. * TODO there are different TEXT type objects, (HTML, plaintext, xml, etc. we should determine how these are handled) - * * @param objectId object it * @param mimeType mime type */ diff --git a/lib/content-services/src/lib/common/services/sites.service.ts b/lib/content-services/src/lib/common/services/sites.service.ts index 058e24c993b..af61036474d 100644 --- a/lib/content-services/src/lib/common/services/sites.service.ts +++ b/lib/content-services/src/lib/common/services/sites.service.ts @@ -47,7 +47,6 @@ export class SitesService { /** * Create a site - * * @param siteBody SiteBodyCreate to create site * @returns site SiteEntry */ @@ -57,7 +56,6 @@ export class SitesService { /** * Gets a list of all sites in the repository. - * * @param opts Options supported by JS-API * @returns List of sites */ @@ -72,7 +70,6 @@ export class SitesService { /** * Gets the details for a site. - * * @param siteId ID of the target site * @param opts Options supported by JS-API * @returns Information about the site @@ -83,7 +80,6 @@ export class SitesService { /** * Deletes a site. - * * @param siteId Site to delete * @param permanentFlag True: deletion is permanent; False: site is moved to the trash * @returns Null response notifying when the operation is complete @@ -96,7 +92,6 @@ export class SitesService { /** * Gets a site's content. - * * @param siteId ID of the target site * @returns Site content */ @@ -106,7 +101,6 @@ export class SitesService { /** * Gets a list of all a site's members. - * * @param siteId ID of the target site * @returns Site members */ @@ -116,7 +110,6 @@ export class SitesService { /** * Gets a list of all a site's members. - * * @param siteId ID of the target site * @param opts Optional parameters supported by JS-API * @returns Observable @@ -128,7 +121,6 @@ export class SitesService { /** * Looks for a site inside the path of a Node and returns its guid if it finds one. * (return an empty string if no site is found) - * * @param node Node to look for parent site * @returns Site guid */ @@ -143,7 +135,6 @@ export class SitesService { /** * Gets a list of site membership requests. - * * @param opts Options supported by JS-API * @returns Site membership requests */ @@ -153,7 +144,6 @@ export class SitesService { /** * Creates a site membership for person **personId** on site **siteId**. - * * @param siteId The identifier of a site * @param siteMembershipBodyCreate The person to add and their role * @param opts Optional parameters @@ -165,7 +155,6 @@ export class SitesService { /** * Update a site membership - * * @param siteId The identifier of a site. * @param personId The identifier of a person. * @param siteMembershipBodyUpdate The persons new role @@ -183,7 +172,6 @@ export class SitesService { /** * Delete a site membership - * * @param siteId The identifier of a site. * @param personId The identifier of a person. * @returns Null response notifying when the operation is complete @@ -194,7 +182,6 @@ export class SitesService { /** * Accept site membership requests. - * * @param siteId The identifier of a site. * @param inviteeId The invitee user name. * @param opts Options supported by JS-API @@ -206,7 +193,6 @@ export class SitesService { /** * Reject site membership requests. - * * @param siteId The identifier of a site. * @param inviteeId The invitee user name. * @param opts Options supported by JS-API @@ -218,7 +204,6 @@ export class SitesService { /** * List group membership for site - * * @param siteId The identifier of a site. * @param opts Options supported by JS-API * @returns Observable @@ -229,7 +214,6 @@ export class SitesService { /** * Create a site membership for group - * * @param siteId The identifier of a site. * @param siteMembershipBodyCreate The Group to add and its role * @returns Observable @@ -240,7 +224,6 @@ export class SitesService { /** * Get information about site membership of group - * * @param siteId The identifier of a site. * @param groupId The authorityId of a group. * @returns Observable @@ -251,7 +234,6 @@ export class SitesService { /** * Update site membership of group - * * @param siteId The identifier of a site. * @param groupId The authorityId of a group. * @param siteMembershipBodyUpdate The group new role @@ -263,7 +245,6 @@ export class SitesService { /** * Delete a group membership for site - * * @param siteId The identifier of a site. * @param groupId The authorityId of a group. * @returns Observable diff --git a/lib/content-services/src/lib/common/services/upload.service.ts b/lib/content-services/src/lib/common/services/upload.service.ts index 600beac1026..b86cd2aeaac 100644 --- a/lib/content-services/src/lib/common/services/upload.service.ts +++ b/lib/content-services/src/lib/common/services/upload.service.ts @@ -90,7 +90,6 @@ export class UploadService { /** * Returns the number of concurrent threads for uploading. - * * @returns Number of concurrent threads (default 1) */ getThreadsCount(): number { @@ -99,7 +98,6 @@ export class UploadService { /** * Checks whether the service still has files uploading or awaiting upload. - * * @returns True if files in the queue are still uploading, false otherwise */ isUploading(): boolean { @@ -118,7 +116,6 @@ export class UploadService { /** * Gets the file Queue - * * @returns Array of files that form the queue */ getQueue(): FileModel[] { @@ -127,7 +124,6 @@ export class UploadService { /** * Adds files to the uploading queue to be uploaded - * * @param files One or more separate parameters or an array of files to queue * @returns Array of files that were not blocked from upload by the ignore list */ @@ -140,7 +136,6 @@ export class UploadService { /** * Finds all the files in the queue that are not yet uploaded and uploads them into the directory folder. - * * @param successEmitter Emitter to invoke on file success status change * @param errorEmitter Emitter to invoke on file error status change */ @@ -172,7 +167,6 @@ export class UploadService { * Cancels uploading of files. * If the file is smaller than 1 MB the file will be uploaded and then the node deleted * to prevent having files that were aborted but still uploaded. - * * @param files One or more separate parameters or an array of files specifying uploads to cancel */ cancelUpload(...files: FileModel[]) { @@ -206,7 +200,6 @@ export class UploadService { /** * Gets an upload promise for a file. - * * @param file The target file * @returns Promise that is resolved if the upload is successful or error otherwise */ diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts index 90c60aacbb6..9bd2692087d 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.spec.ts @@ -150,7 +150,6 @@ describe('ContentMetadataComponent', () => { /** * Get metadata categories - * * @returns list of native elements */ function getCategories(): HTMLParagraphElement[] { @@ -159,7 +158,6 @@ describe('ContentMetadataComponent', () => { /** * Get a categories management component - * * @returns angular component */ function getCategoriesManagementComponent(): CategoriesManagementComponent { diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts index 32642942913..ebdf43b16fc 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts @@ -309,7 +309,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { /** * Register all tags which should be assigned to node. Please note that they are just in "register" state and are not yet saved * until button for saving data is clicked. Calling that function causes that save button is enabled. - * * @param tags array of tags to register, they are not saved yet until we click save button. */ storeTagsToAssign(tags: string[]) { @@ -320,7 +319,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { /** * Store all categories that node should be assigned to. Please note that they are just in "stored" state and are not yet saved * until button for saving data is clicked. Calling that function causes that save button is enabled. - * * @param categoriesToAssign array of categories to store. */ storeCategoriesToAssign(categoriesToAssign: Category[]) { diff --git a/lib/content-services/src/lib/content-metadata/services/basic-properties.service.ts b/lib/content-services/src/lib/content-metadata/services/basic-properties.service.ts index 5530fef7d8e..f8038493c2e 100644 --- a/lib/content-services/src/lib/content-metadata/services/basic-properties.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/basic-properties.service.ts @@ -17,13 +17,7 @@ import { inject, Injectable } from '@angular/core'; import { Node } from '@alfresco/js-api'; -import { - CardViewDateItemModel, - CardViewItemMatchValidator, - CardViewTextItemModel, - FileSizePipe, - TranslationService -} from '@alfresco/adf-core'; +import { CardViewDateItemModel, CardViewItemMatchValidator, CardViewTextItemModel, FileSizePipe, TranslationService } from '@alfresco/adf-core'; @Injectable({ providedIn: 'root' @@ -44,9 +38,7 @@ export class BasicPropertiesService { value: node.name, key: 'properties.cm:name', editable: true, - validators: [ - new CardViewItemMatchValidator('[\\/\\*\\\\"\\\\]') - ] + validators: [new CardViewItemMatchValidator('[\\/\\*\\\\"\\\\]')] }), new CardViewTextItemModel({ label: 'CORE.METADATA.BASIC.TITLE', diff --git a/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.spec.ts b/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.spec.ts index ae66bd161d8..45db0b496a5 100644 --- a/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.spec.ts +++ b/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.spec.ts @@ -19,13 +19,11 @@ import { AspectOrientedConfigService } from './aspect-oriented-config.service'; import { AspectOrientedConfig, Property, OrganisedPropertyGroup, PropertyGroupContainer } from '../../interfaces/content-metadata.interfaces'; describe('AspectOrientedConfigService', () => { - let configService: AspectOrientedConfigService; const createConfigService = (configObj: AspectOrientedConfig) => new AspectOrientedConfigService(configObj); describe('reorganiseByConfig', () => { - interface TestCase { name: string; config: AspectOrientedConfig; @@ -51,54 +49,58 @@ describe('AspectOrientedConfigService', () => { { name: 'One property from One group', config: { - berseria: [ 'property1' ] + berseria: ['property1'] }, - expectations: [{ - title: 'Berseria', - properties: [ property1 ] - }] + expectations: [ + { + title: 'Berseria', + properties: [property1] + } + ] }, { name: 'More properties from One group', config: { - berseria: [ 'property1', 'property2' ] + berseria: ['property1', 'property2'] }, - expectations: [{ - title: 'Berseria', - properties: [ property1, property2 ] - }] + expectations: [ + { + title: 'Berseria', + properties: [property1, property2] + } + ] }, { name: 'One-one properties from More group', config: { - berseria: [ 'property1' ], - zestiria: [ 'property3' ] + berseria: ['property1'], + zestiria: ['property3'] }, expectations: [ { title: 'Berseria', - properties: [ property1 ] + properties: [property1] }, { title: 'Zestiria', - properties: [ property3 ] + properties: [property3] } ] }, { name: 'More properties from More groups', config: { - zestiria: [ 'property4', 'property3' ], - berseria: [ 'property2', 'property1' ] + zestiria: ['property4', 'property3'], + berseria: ['property2', 'property1'] }, expectations: [ { title: 'Zestiria', - properties: [ property4, property3 ] + properties: [property4, property3] }, { title: 'Berseria', - properties: [ property2, property1 ] + properties: [property2, property1] } ] }, @@ -106,16 +108,16 @@ describe('AspectOrientedConfigService', () => { name: 'Wildcard', config: { berseria: '*', - zestiria: [ 'property4' ] + zestiria: ['property4'] }, expectations: [ { title: 'Berseria', - properties: [ property1, property2 ] + properties: [property1, property2] }, { title: 'Zestiria', - properties: [ property4 ] + properties: [property4] } ] }, @@ -124,29 +126,29 @@ describe('AspectOrientedConfigService', () => { config: { berseria: '*', 'not-existing-group': '*', - zestiria: [ 'property4' ] + zestiria: ['property4'] }, expectations: [ { title: 'Berseria', - properties: [ property1, property2 ] + properties: [property1, property2] }, { title: 'Zestiria', - properties: [ property4 ] + properties: [property4] } ] }, { name: 'Not existing property', config: { - berseria: [ 'not-existing-property' ], - zestiria: [ 'property4' ] + berseria: ['not-existing-property'], + zestiria: ['property4'] }, expectations: [ { title: 'Zestiria', - properties: [ property4 ] + properties: [property4] } ] } @@ -160,7 +162,7 @@ describe('AspectOrientedConfigService', () => { expect(organisedPropertyGroups.length).toBe(testCase.expectations.length, 'Group count should match'); testCase.expectations.forEach((expectation, i) => { - expect(organisedPropertyGroups[i].title).toBe(expectation.title, 'Group\'s title should match' ); + expect(organisedPropertyGroups[i].title).toBe(expectation.title, "Group's title should match"); expect(organisedPropertyGroups[i].properties.length).toBe( expectation.properties.length, `Property count for '${organisedPropertyGroups[i].title}' group should match.` @@ -194,11 +196,11 @@ describe('AspectOrientedConfigService', () => { expectations: [ { title: 'Berseria', - properties: [ property1, property2 ] + properties: [property1, property2] }, { title: 'Zestiria', - properties: [ property3, property4 ] + properties: [property3, property4] } ] }; @@ -208,7 +210,7 @@ describe('AspectOrientedConfigService', () => { expect(organisedPropertyGroups.length).toBe(testCase.expectations.length, 'Group count should match'); testCase.expectations.forEach((expectation, i) => { - expect(organisedPropertyGroups[i].title).toBe(expectation.title, 'Group\'s title should match' ); + expect(organisedPropertyGroups[i].title).toBe(expectation.title, "Group's title should match"); expect(organisedPropertyGroups[i].properties.length).toBe( expectation.properties.length, `Property count for '${organisedPropertyGroups[i].title}' group should match.` @@ -231,11 +233,11 @@ describe('AspectOrientedConfigService', () => { expectations: [ { title: 'Berseria', - properties: [ property1, property2 ] + properties: [property1, property2] }, { title: 'Zestiria', - properties: [ property3, property4 ] + properties: [property3, property4] } ] }; diff --git a/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.ts b/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.ts index afbc9ea8165..71fc500428e 100644 --- a/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/config/aspect-oriented-config.service.ts @@ -19,8 +19,7 @@ import { ContentMetadataConfig, OrganisedPropertyGroup, PropertyGroupContainer, import { getGroup, getProperty } from './property-group-reader'; export class AspectOrientedConfigService implements ContentMetadataConfig { - - constructor(private config: any) { } + constructor(private config: any) {} public isGroupAllowed(groupName: string): boolean { if (this.isIncludeAllEnabled()) { @@ -43,24 +42,23 @@ export class AspectOrientedConfigService implements ContentMetadataConfig { } public appendAllPreset(propertyGroups: PropertyGroupContainer): OrganisedPropertyGroup[] { - const groups = Object.keys(propertyGroups) - .map((groupName) => { - const propertyGroup = propertyGroups[groupName]; - const properties = propertyGroup.properties; - - if (this.isAspectReadOnly(groupName)) { - Object.keys(properties).map((propertyName) => this.setReadOnlyProperty(properties[propertyName])); - } - - return Object.assign({}, propertyGroup, { - properties: Object.keys(properties).map((propertyName) => { - if (this.isPropertyReadOnly(propertyName)) { - this.setReadOnlyProperty(properties[propertyName]); - } - return properties[propertyName]; - }) - }); + const groups = Object.keys(propertyGroups).map((groupName) => { + const propertyGroup = propertyGroups[groupName]; + const properties = propertyGroup.properties; + + if (this.isAspectReadOnly(groupName)) { + Object.keys(properties).map((propertyName) => this.setReadOnlyProperty(properties[propertyName])); + } + + return Object.assign({}, propertyGroup, { + properties: Object.keys(properties).map((propertyName) => { + if (this.isPropertyReadOnly(propertyName)) { + this.setReadOnlyProperty(properties[propertyName]); + } + return properties[propertyName]; + }) }); + }); return groups; } @@ -87,7 +85,6 @@ export class AspectOrientedConfigService implements ContentMetadataConfig { } else { return readOnlyAspects === propertyGroupName; } - } public filterExcludedPreset(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] { diff --git a/lib/content-services/src/lib/content-metadata/services/config/content-metadata-config.factory.spec.ts b/lib/content-services/src/lib/content-metadata/services/config/content-metadata-config.factory.spec.ts index 3530d6ea233..70226651993 100644 --- a/lib/content-services/src/lib/content-metadata/services/config/content-metadata-config.factory.spec.ts +++ b/lib/content-services/src/lib/content-metadata/services/config/content-metadata-config.factory.spec.ts @@ -25,19 +25,17 @@ import { ContentMetadataConfig } from '../../interfaces/content-metadata.interfa import { HttpClientModule } from '@angular/common/http'; describe('ContentMetadataConfigFactory', () => { - let factory: ContentMetadataConfigFactory; let appConfig: AppConfigService; let config: ContentMetadataConfig; beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - HttpClientModule - ], + imports: [HttpClientModule], providers: [ { - provide: LogService, useValue: { + provide: LogService, + useValue: { error: () => {} } } @@ -48,7 +46,6 @@ describe('ContentMetadataConfigFactory', () => { }); describe('get', () => { - let logService: LogService; beforeEach(() => { @@ -57,7 +54,6 @@ describe('ContentMetadataConfigFactory', () => { }); describe('get', () => { - it('should get back to default preset if no preset is provided as parameter', () => { config = factory.get(); @@ -85,7 +81,6 @@ describe('ContentMetadataConfigFactory', () => { }); describe('set', () => { - const setConfig = (presetName: string, presetConfig: any) => { appConfig.config['content-metadata'] = { presets: { @@ -118,5 +113,5 @@ describe('ContentMetadataConfigFactory', () => { expect(config).toEqual(jasmine.any(LayoutOrientedConfigService)); }); }); - }); + }); }); diff --git a/lib/content-services/src/lib/content-metadata/services/config/indifferent-config.service.ts b/lib/content-services/src/lib/content-metadata/services/config/indifferent-config.service.ts index df06084128b..a7d4c714f51 100644 --- a/lib/content-services/src/lib/content-metadata/services/config/indifferent-config.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/config/indifferent-config.service.ts @@ -15,26 +15,22 @@ * limitations under the License. */ -import { ContentMetadataConfig, OrganisedPropertyGroup, - PropertyGroupContainer -} from '../../interfaces/content-metadata.interfaces'; +import { ContentMetadataConfig, OrganisedPropertyGroup, PropertyGroupContainer } from '../../interfaces/content-metadata.interfaces'; export class IndifferentConfigService implements ContentMetadataConfig { - isGroupAllowed(): boolean { return true; } reorganiseByConfig(propertyGroups: PropertyGroupContainer): OrganisedPropertyGroup[] { - return Object.keys(propertyGroups) - .map((groupName) => { - const propertyGroup = propertyGroups[groupName]; - const properties = propertyGroup.properties; + return Object.keys(propertyGroups).map((groupName) => { + const propertyGroup = propertyGroups[groupName]; + const properties = propertyGroup.properties; - return Object.assign({}, propertyGroup, { - properties: Object.keys(properties).map((propertyName) => properties[propertyName]) - }); + return Object.assign({}, propertyGroup, { + properties: Object.keys(properties).map((propertyName) => properties[propertyName]) }); + }); } filterExcludedPreset(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] { @@ -42,7 +38,7 @@ export class IndifferentConfigService implements ContentMetadataConfig { } appendAllPreset(): OrganisedPropertyGroup[] { - return[]; + return []; } isIncludeAllEnabled(): boolean { diff --git a/lib/content-services/src/lib/content-metadata/services/config/layout-oriented-config.service.ts b/lib/content-services/src/lib/content-metadata/services/config/layout-oriented-config.service.ts index 0c596b0ee51..1401023c4a2 100644 --- a/lib/content-services/src/lib/content-metadata/services/config/layout-oriented-config.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/config/layout-oriented-config.service.ts @@ -25,8 +25,7 @@ import { import { getProperty } from './property-group-reader'; export class LayoutOrientedConfigService implements ContentMetadataConfig { - - constructor(private config: any) { } + constructor(private config: any) {} public isGroupAllowed(groupName: string): boolean { if (this.isIncludeAllEnabled()) { @@ -41,9 +40,9 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig { const organisedPropertyGroup = layoutBlocks.map((layoutBlock) => { const flattenedItems = this.flattenItems(layoutBlock.items); const properties = flattenedItems.reduce((props, explodedItem) => { - const isProperty = typeof explodedItem.property === 'object'; + const isProperty = typeof explodedItem.property === 'object'; const propertyName = isProperty ? explodedItem.property.name : explodedItem.property; - let property = getProperty(propertyGroups, explodedItem.groupName, propertyName) || []; + let property = getProperty(propertyGroups, explodedItem.groupName, propertyName) || []; if (isProperty) { property = this.setPropertyTitle(property, explodedItem.property); } @@ -61,15 +60,14 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig { } public appendAllPreset(propertyGroups: PropertyGroupContainer): OrganisedPropertyGroup[] { - return Object.keys(propertyGroups) - .map((groupName) => { - const propertyGroup = propertyGroups[groupName]; - const properties = propertyGroup.properties; - - return Object.assign({}, propertyGroup, { - properties: Object.keys(properties).map((propertyName) => properties[propertyName]) - }); + return Object.keys(propertyGroups).map((groupName) => { + const propertyGroup = propertyGroups[groupName]; + const properties = propertyGroup.properties; + + return Object.assign({}, propertyGroup, { + properties: Object.keys(properties).map((propertyName) => properties[propertyName]) }); + }); } public filterExcludedPreset(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] { @@ -88,16 +86,14 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig { } public isIncludeAllEnabled() { - const includeAllProperty = this.config - .map((config) => config.includeAll) - .find((includeAll) => includeAll !== undefined); + const includeAllProperty = this.config.map((config) => config.includeAll).find((includeAll) => includeAll !== undefined); return includeAllProperty !== undefined ? includeAllProperty : false; } private setEditableProperty(propertyGroup: Property | Property[], itemConfig): Property | Property[] { if (Array.isArray(propertyGroup)) { - propertyGroup.map((property) => property.editable = itemConfig.editable !== undefined ? itemConfig.editable : true); + propertyGroup.map((property) => (property.editable = itemConfig.editable !== undefined ? itemConfig.editable : true)); } else { propertyGroup.editable = itemConfig.editable !== undefined ? itemConfig.editable : true; } @@ -107,7 +103,7 @@ export class LayoutOrientedConfigService implements ContentMetadataConfig { private setPropertyTitle(item: Property | Property[], property: Property): Property | Property[] { if (!Array.isArray(item)) { - return { ...item, ...(item.name === property.name && !!property.title) && { title: property.title } }; + return { ...item, ...(item.name === property.name && !!property.title && { title: property.title }) }; } return item; } diff --git a/lib/content-services/src/lib/content-metadata/services/content-metadata.service.ts b/lib/content-services/src/lib/content-metadata/services/content-metadata.service.ts index b7900c6e45c..ff73749e853 100644 --- a/lib/content-services/src/lib/content-metadata/services/content-metadata.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/content-metadata.service.ts @@ -30,15 +30,15 @@ import { ContentTypePropertiesService } from './content-type-property.service'; providedIn: 'root' }) export class ContentMetadataService { - error = new Subject<{ statusCode: number; message: string }>(); - constructor(private basicPropertiesService: BasicPropertiesService, - private contentMetadataConfigFactory: ContentMetadataConfigFactory, - private propertyGroupTranslatorService: PropertyGroupTranslatorService, - private propertyDescriptorsService: PropertyDescriptorsService, - private contentTypePropertyService: ContentTypePropertiesService) { - } + constructor( + private basicPropertiesService: BasicPropertiesService, + private contentMetadataConfigFactory: ContentMetadataConfigFactory, + private propertyGroupTranslatorService: PropertyGroupTranslatorService, + private propertyDescriptorsService: PropertyDescriptorsService, + private contentTypePropertyService: ContentTypePropertiesService + ) {} getBasicProperties(node: Node): Observable { return of(this.basicPropertiesService.getProperties(node)); @@ -63,9 +63,7 @@ export class ContentMetadataService { contentMetadataConfig = this.contentMetadataConfigFactory.createConfig(preset); } - const groupNames = node.aspectNames - .concat(node.nodeType) - .filter((groupName) => contentMetadataConfig.isGroupAllowed(groupName)); + const groupNames = node.aspectNames.concat(node.nodeType).filter((groupName) => contentMetadataConfig.isGroupAllowed(groupName)); if (groupNames.length > 0) { groupedProperties = this.propertyDescriptorsService.load(groupNames).pipe( @@ -74,7 +72,8 @@ export class ContentMetadataService { () => contentMetadataConfig.isIncludeAllEnabled(), of(contentMetadataConfig.appendAllPreset(groups).concat(contentMetadataConfig.reorganiseByConfig(groups))), of(contentMetadataConfig.reorganiseByConfig(groups)) - )), + ) + ), map((groups) => contentMetadataConfig.filterExcludedPreset(groups)), map((groups) => this.filterEmptyPreset(groups)), map((groups) => this.setTitleToNameIfNotSet(groups)), @@ -93,7 +92,7 @@ export class ContentMetadataService { return propertyGroups; } - filterEmptyPreset(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] { + filterEmptyPreset(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] { return propertyGroups.filter((props) => props.properties.length); } } diff --git a/lib/content-services/src/lib/content-metadata/services/content-type-property.service.ts b/lib/content-services/src/lib/content-metadata/services/content-type-property.service.ts index c035a062fc5..02ec4f435b0 100644 --- a/lib/content-services/src/lib/content-metadata/services/content-type-property.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/content-type-property.service.ts @@ -31,24 +31,24 @@ import { VersionCompatibilityService } from '../../version-compatibility/version providedIn: 'root' }) export class ContentTypePropertiesService { - - constructor(private contentTypeService: ContentTypeService, - private dialog: MatDialog, - private versionCompatibilityService: VersionCompatibilityService, - private propertyGroupTranslatorService: PropertyGroupTranslatorService) { - } + constructor( + private contentTypeService: ContentTypeService, + private dialog: MatDialog, + private versionCompatibilityService: VersionCompatibilityService, + private propertyGroupTranslatorService: PropertyGroupTranslatorService + ) {} getContentTypeCardItem(node: Node): Observable { if (this.versionCompatibilityService.isVersionSupported('7')) { - return this.contentTypeService.getContentTypeByPrefix(node.nodeType). - pipe( - map((contentType) => { - const contentTypesOptions$ = this.getContentTypesAsSelectOption(contentType); - const contentTypeCard = this.buildContentTypeSelectCardModel(contentType.entry.id, contentTypesOptions$); - const filteredProperties = this.getContentTypeSpecificProperties(contentType); - const propertiesCard = this.buildCardItemsFromPropertyList(filteredProperties, node.properties); - return [contentTypeCard, ...propertiesCard]; - })); + return this.contentTypeService.getContentTypeByPrefix(node.nodeType).pipe( + map((contentType) => { + const contentTypesOptions$ = this.getContentTypesAsSelectOption(contentType); + const contentTypeCard = this.buildContentTypeSelectCardModel(contentType.entry.id, contentTypesOptions$); + const filteredProperties = this.getContentTypeSpecificProperties(contentType); + const propertiesCard = this.buildCardItemsFromPropertyList(filteredProperties, node.properties); + return [contentTypeCard, ...propertiesCard]; + }) + ); } else { return of([this.buildContentTypeTextCardModel(node.nodeType)]); } @@ -80,7 +80,10 @@ export class ContentTypePropertiesService { return contentTypeCard; } - private buildContentTypeSelectCardModel(currentValue: string, options$: Observable[]>): CardViewSelectItemModel { + private buildContentTypeSelectCardModel( + currentValue: string, + options$: Observable[]> + ): CardViewSelectItemModel { const contentTypeCard = new CardViewSelectItemModel({ label: 'CORE.METADATA.BASIC.CONTENT_TYPE', value: currentValue, @@ -100,7 +103,8 @@ export class ContentTypePropertiesService { map(([contentTypesEntries, currentContentType]) => { const updatedTypes = this.appendCurrentType(currentContentType, contentTypesEntries); return updatedTypes.map((contentType) => ({ key: contentType.entry.id, label: contentType.entry.title ?? contentType.entry.id })); - })); + }) + ); } private appendCurrentType(currentType: TypeEntry, contentTypesEntries: TypeEntry[]): TypeEntry[] { diff --git a/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.spec.ts b/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.spec.ts index a7f01737a9f..979008e945b 100644 --- a/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.spec.ts +++ b/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.spec.ts @@ -36,14 +36,13 @@ describe('PropertyDescriptorLoaderService', () => { it('should load the groups passed by paramter', (done) => { spyOn(classesApi, 'getClass').and.returnValue(Promise.resolve({})); - service.load(['exif:exif', 'cm:content', 'custom:custom']) - .subscribe(() => { - expect(classesApi.getClass).toHaveBeenCalledTimes(3); - expect(classesApi.getClass).toHaveBeenCalledWith('exif_exif'); - expect(classesApi.getClass).toHaveBeenCalledWith('cm_content'); - expect(classesApi.getClass).toHaveBeenCalledWith('custom_custom'); - done(); - }); + service.load(['exif:exif', 'cm:content', 'custom:custom']).subscribe(() => { + expect(classesApi.getClass).toHaveBeenCalledTimes(3); + expect(classesApi.getClass).toHaveBeenCalledWith('exif_exif'); + expect(classesApi.getClass).toHaveBeenCalledWith('cm_content'); + expect(classesApi.getClass).toHaveBeenCalledWith('custom_custom'); + done(); + }); }); it('should merge the forked values', (done) => { diff --git a/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts b/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts index 58be7372d33..27c4d2cc8d1 100644 --- a/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts +++ b/lib/content-services/src/lib/content-metadata/services/property-descriptors.service.ts @@ -26,29 +26,29 @@ import { ClassesApi } from '@alfresco/js-api'; providedIn: 'root' }) export class PropertyDescriptorsService { - private _classesApi: ClassesApi; get classesApi(): ClassesApi { this._classesApi = this._classesApi ?? new ClassesApi(this.alfrescoApiService.getInstance()); return this._classesApi; } - constructor(private alfrescoApiService: AlfrescoApiService) { - } + constructor(private alfrescoApiService: AlfrescoApiService) {} load(groupNames: string[]): Observable { const groupFetchStreams = groupNames .map((groupName) => groupName.replace(':', '_')) .map((groupName) => defer(() => this.classesApi.getClass(groupName))); - return forkJoin(groupFetchStreams).pipe( - map(this.convertToObject) - ); + return forkJoin(groupFetchStreams).pipe(map(this.convertToObject)); } private convertToObject(propertyGroupsArray: PropertyGroup[]): PropertyGroupContainer { - return propertyGroupsArray.reduce((propertyGroups, propertyGroup) => Object.assign({}, propertyGroups, { - [propertyGroup.name]: propertyGroup - }), {}); + return propertyGroupsArray.reduce( + (propertyGroups, propertyGroup) => + Object.assign({}, propertyGroups, { + [propertyGroup.name]: propertyGroup + }), + {} + ); } } diff --git a/lib/content-services/src/lib/content-node-selector/content-node-dialog.service.ts b/lib/content-services/src/lib/content-node-selector/content-node-dialog.service.ts index 22bfe1758e6..76691e5865b 100644 --- a/lib/content-services/src/lib/content-node-selector/content-node-dialog.service.ts +++ b/lib/content-services/src/lib/content-node-selector/content-node-dialog.service.ts @@ -54,7 +54,6 @@ export class ContentNodeDialogService { /** * Opens a file browser at a chosen folder location. * shows files and folders in the dialog search result. - * * @param folderNodeId ID of the folder to use * @returns Information about the selected file(s) */ @@ -66,7 +65,6 @@ export class ContentNodeDialogService { /** * Opens a lock node dialog. - * * @param contentEntry Node to lock * @returns Error/status message (if any) */ @@ -94,7 +92,6 @@ export class ContentNodeDialogService { /** * Opens a file browser at a chosen site location. * shows files and folders in the dialog search result. - * * @returns Information about the selected file(s) */ openFileBrowseDialogBySite(): Observable { @@ -106,7 +103,6 @@ export class ContentNodeDialogService { /** * Opens a file browser at a default myFile location. * shows files and folders in the dialog search result. - * * @returns Information about the selected file(s) */ openFileBrowseDialogByDefaultLocation(): Observable { @@ -115,7 +111,6 @@ export class ContentNodeDialogService { /** * Opens a folder browser at a chosen site location. - * * @returns Information about the selected folder(s) */ openFolderBrowseDialogBySite(): Observable { @@ -124,7 +119,6 @@ export class ContentNodeDialogService { /** * Opens a folder browser at a chosen folder location. - * * @param folderNodeId ID of the folder to use * @returns Information about the selected folder(s) */ @@ -136,7 +130,6 @@ export class ContentNodeDialogService { /** * Opens a dialog to copy or move an item to a new location. - * * @param action Name of the action (eg, "Copy" or "Move") to show in the title * @param contentEntry Item to be copied or moved * @param permission Permission for the operation @@ -171,7 +164,6 @@ export class ContentNodeDialogService { /** * Gets the translation of the dialog title. - * * @param action Name of the action to display in the dialog title * @param name Name of the item on which the action is being performed * @returns Translated version of the title @@ -182,7 +174,6 @@ export class ContentNodeDialogService { /** * Opens a dialog to choose folders to upload. - * * @param action Name of the action to show in the title * @param contentEntry Item to upload * @returns Information about the chosen folder(s) @@ -209,7 +200,6 @@ export class ContentNodeDialogService { /** * Opens a dialog to choose a file to upload. - * * @param action Name of the action to show in the title * @param contentEntry Item to upload * @param showFilesInResult Show files in dialog search result diff --git a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts index defd4222dff..aca73676f4a 100644 --- a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts +++ b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts @@ -441,7 +441,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { private isExcludedSiteContent(row: ShareDataRow): boolean { const entry = row.node.entry; - if (this._excludeSiteContent?.length && entry && entry.properties?.['st:componentId']) { + if (this._excludeSiteContent?.length && entry?.properties?.['st:componentId']) { const excludedItem = this._excludeSiteContent.find((id: string) => entry.properties['st:componentId'] === id); return !!excludedItem; } @@ -450,7 +450,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Updates the site attribute and starts a new search - * * @param chosenSite SiteEntry to search within */ siteChanged(chosenSite: SiteEntry): void { @@ -462,7 +461,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Get current breadcrumb folder node - * * @returns the actually selected|entered folder node or null in case of searching for the breadcrumb */ get breadcrumbFolderNode(): Node | null { @@ -479,7 +477,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Prepares the dialog for a new search - * * @param searchRequest request options */ prepareDialogForNewSearch(searchRequest: SearchRequest): void { @@ -552,7 +549,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Show the results of the search - * * @param results Search results */ private showSearchResults(results: NodePaging): void { @@ -565,7 +561,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Sets showingSearchResults state to be able to differentiate between search results or folder results - * * @param $event node event */ onFolderChange($event: NodeEntryEvent): void { @@ -580,7 +575,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Attempts to set the currently loaded node - * * @param nodePaging pagination model */ onFolderLoaded(nodePaging: NodePaging): void { @@ -596,7 +590,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Updates pagination.hasMoreItems to false after filtering only folders during 'COPY' and 'MOVE' action - * * @param nodePaging pagination model */ updatePaginationAfterRowFilter(nodePaging: NodePaging): void { @@ -607,7 +600,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Returns whether breadcrumb has to be shown or not - * * @returns `true` if needs to show the breadcrumb, otherwise `false` */ showBreadcrumbs() { @@ -616,7 +608,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Loads the next batch of search results - * * @param pagination Pagination object */ getNextPageOfSearch(pagination: Pagination): void { @@ -631,7 +622,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * Selects node as chosen if it has the right permission, clears the selection otherwise - * * @param entry node entry */ private attemptNodeSelection(entry: Node): void { @@ -649,7 +639,6 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy { /** * It filters and emit the selection coming from the document list - * * @param nodesEntries selected nodes */ onCurrentSelection(nodesEntries: NodeEntry[]): void { diff --git a/lib/content-services/src/lib/content-node-share/services/shared-links-api.service.ts b/lib/content-services/src/lib/content-node-share/services/shared-links-api.service.ts index 2e515036c2c..646bbf7124b 100644 --- a/lib/content-services/src/lib/content-node-share/services/shared-links-api.service.ts +++ b/lib/content-services/src/lib/content-node-share/services/shared-links-api.service.ts @@ -26,7 +26,6 @@ import { AlfrescoApiService } from '../../services/alfresco-api.service'; providedIn: 'root' }) export class SharedLinksApiService { - error = new Subject<{ statusCode: number; message: string }>(); private _sharedLinksApi: SharedlinksApi; @@ -35,13 +34,10 @@ export class SharedLinksApiService { return this._sharedLinksApi; } - constructor(private apiService: AlfrescoApiService, - private preferences: UserPreferencesService) { - } + constructor(private apiService: AlfrescoApiService, private preferences: UserPreferencesService) {} /** * Gets shared links available to the current user. - * * @param options Options supported by JS-API * @returns List of shared links */ @@ -54,38 +50,30 @@ export class SharedLinksApiService { const queryOptions = Object.assign({}, defaultOptions, options); const promise = this.sharedLinksApi.listSharedLinks(queryOptions); - return from(promise).pipe( - catchError((err) => of(err)) - ); + return from(promise).pipe(catchError((err) => of(err))); } /** * Creates a shared link available to the current user. - * * @param nodeId ID of the node to link to * @param sharedLinkWithExpirySettings shared link with nodeId and expiryDate * @param options Options supported by JS-API * @returns The shared link just created */ createSharedLinks(nodeId: string, sharedLinkWithExpirySettings?: SharedLinkBodyCreate, options: any = {}): Observable { - const promise = this.sharedLinksApi.createSharedLink(sharedLinkWithExpirySettings? sharedLinkWithExpirySettings : { nodeId }, options); + const promise = this.sharedLinksApi.createSharedLink(sharedLinkWithExpirySettings ? sharedLinkWithExpirySettings : { nodeId }, options); - return from(promise).pipe( - catchError((err) => of(err)) - ); + return from(promise).pipe(catchError((err) => of(err))); } /** * Deletes a shared link. - * * @param sharedId ID of the link to delete * @returns Null response notifying when the operation is complete */ deleteSharedLink(sharedId: string): Observable { const promise = this.sharedLinksApi.deleteSharedLink(sharedId); - return from(promise).pipe( - catchError((err: Error) => of(err)) - ); + return from(promise).pipe(catchError((err: Error) => of(err))); } } diff --git a/lib/content-services/src/lib/content-type/content-type.service.ts b/lib/content-services/src/lib/content-type/content-type.service.ts index d209749bce2..8dbabd69821 100644 --- a/lib/content-services/src/lib/content-type/content-type.service.ts +++ b/lib/content-services/src/lib/content-type/content-type.service.ts @@ -25,15 +25,13 @@ import { map } from 'rxjs/operators'; providedIn: 'root' }) export class ContentTypeService { - private _typesApi: TypesApi; get typesApi(): TypesApi { this._typesApi = this._typesApi ?? new TypesApi(this.alfrescoApiService.getInstance()); return this._typesApi; } - constructor(private alfrescoApiService: AlfrescoApiService) { - } + constructor(private alfrescoApiService: AlfrescoApiService) {} getContentTypeByPrefix(prefixedType: string): Observable { return from(this.typesApi.getType(prefixedType)); @@ -45,8 +43,6 @@ export class ContentTypeService { where, include: ['properties'] }; - return from(this.typesApi.listTypes(opts)).pipe( - map((result: TypePaging) => result.list.entries) - ); + return from(this.typesApi.listTypes(opts)).pipe(map((result: TypePaging) => result.list.entries)); } } diff --git a/lib/content-services/src/lib/dialogs/download-zip/services/download-zip.service.ts b/lib/content-services/src/lib/dialogs/download-zip/services/download-zip.service.ts index 4e1c972e1f1..c72821d0381 100755 --- a/lib/content-services/src/lib/dialogs/download-zip/services/download-zip.service.ts +++ b/lib/content-services/src/lib/dialogs/download-zip/services/download-zip.service.ts @@ -24,19 +24,16 @@ import { AlfrescoApiService } from '../../../services/alfresco-api.service'; providedIn: 'root' }) export class DownloadZipService { - private _downloadsApi: DownloadsApi; get downloadsApi(): DownloadsApi { this._downloadsApi = this._downloadsApi ?? new DownloadsApi(this.apiService.getInstance()); return this._downloadsApi; } - constructor(private apiService: AlfrescoApiService) { - } + constructor(private apiService: AlfrescoApiService) {} /** * Creates a new download. - * * @param payload Object containing the node IDs of the items to add to the ZIP file * @returns Status object for the download */ @@ -46,7 +43,6 @@ export class DownloadZipService { /** * Gets status information for a download node. - * * @param downloadId ID of the download node * @returns Status object for the download */ @@ -56,7 +52,6 @@ export class DownloadZipService { /** * Cancels a download. - * * @param downloadId ID of the target download node */ cancelDownload(downloadId: string) { diff --git a/lib/content-services/src/lib/directives/check-allowable-operation.directive.ts b/lib/content-services/src/lib/directives/check-allowable-operation.directive.ts index 807e988704f..148cde00bdf 100644 --- a/lib/content-services/src/lib/directives/check-allowable-operation.directive.ts +++ b/lib/content-services/src/lib/directives/check-allowable-operation.directive.ts @@ -59,7 +59,6 @@ export class CheckAllowableOperationDirective implements OnChanges { /** * Updates disabled state for the decorated element - * * @returns the new state */ updateElement(): boolean { @@ -94,8 +93,6 @@ export class CheckAllowableOperationDirective implements OnChanges { /** * Enables decorated element - * - * @memberof CheckAllowableOperationDirective */ enableElement(): void { this.renderer.removeAttribute(this.elementRef.nativeElement, 'disabled'); @@ -103,8 +100,6 @@ export class CheckAllowableOperationDirective implements OnChanges { /** * Disables decorated element - * - * @memberof CheckAllowableOperationDirective */ disableElement(): void { this.renderer.setAttribute(this.elementRef.nativeElement, 'disabled', 'true'); @@ -112,7 +107,6 @@ export class CheckAllowableOperationDirective implements OnChanges { /** * Checks whether all nodes have a particular permission - * * @param nodes Node collection to check * @param permission Permission to check for each node * @returns `true` if there are allowable operations, otherwise `false` diff --git a/lib/content-services/src/lib/directives/node-download.directive.ts b/lib/content-services/src/lib/directives/node-download.directive.ts index e083e5d7151..33cdc1df166 100755 --- a/lib/content-services/src/lib/directives/node-download.directive.ts +++ b/lib/content-services/src/lib/directives/node-download.directive.ts @@ -55,7 +55,6 @@ export class NodeDownloadDirective { /** * Downloads multiple selected nodes. * Packs result into a .ZIP archive if there is more than one node selected. - * * @param selection Multiple selected nodes to download */ downloadNodes(selection: NodeEntry | Array) { @@ -76,7 +75,6 @@ export class NodeDownloadDirective { /** * Downloads a single node. * Packs result into a .ZIP archive is the node is a Folder. - * * @param node Node to download */ downloadNode(node: NodeEntry) { diff --git a/lib/content-services/src/lib/document-list/components/content-action/content-action-list.component.ts b/lib/content-services/src/lib/document-list/components/content-action/content-action-list.component.ts index fd0f94fbf16..ca27a742ef7 100644 --- a/lib/content-services/src/lib/document-list/components/content-action/content-action-list.component.ts +++ b/lib/content-services/src/lib/document-list/components/content-action/content-action-list.component.ts @@ -31,7 +31,6 @@ export class ContentActionListComponent { /** * Registers action handler within the parent document list component. - * * @param action Action model to register. * @returns `true` if actions was registered, otherwise `false` */ diff --git a/lib/content-services/src/lib/document-list/components/document-list.component.ts b/lib/content-services/src/lib/document-list/components/document-list.component.ts index 22930be07c7..e09369bc590 100644 --- a/lib/content-services/src/lib/document-list/components/document-list.component.ts +++ b/lib/content-services/src/lib/document-list/components/document-list.component.ts @@ -733,7 +733,7 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On } private isLinkFolder(node: Node) { - return node.nodeType === 'app:folderlink' && node.properties && node.properties['cm:destination']; + return node.nodeType === 'app:folderlink' && node.properties?.['cm:destination']; } private updateCustomSourceData(nodeId: string): void { @@ -742,7 +742,6 @@ export class DocumentListComponent extends DataTableSchema implements OnInit, On /** * Invoked when executing content action for a document or folder. - * * @param node Node to be the context of the execution. * @param action Action to be executed against the context. */ diff --git a/lib/content-services/src/lib/document-list/data/share-datatable-adapter.ts b/lib/content-services/src/lib/document-list/data/share-datatable-adapter.ts index f1ce4e8fdef..723a6adfc59 100644 --- a/lib/content-services/src/lib/document-list/data/share-datatable-adapter.ts +++ b/lib/content-services/src/lib/document-list/data/share-datatable-adapter.ts @@ -15,13 +15,7 @@ * limitations under the License. */ -import { - DataColumn, - DataRow, - DataSorting, - DataTableAdapter, - ThumbnailService -} from '@alfresco/adf-core'; +import { DataColumn, DataRow, DataSorting, DataTableAdapter, ThumbnailService } from '@alfresco/adf-core'; import { NodePaging, NodeEntry } from '@alfresco/js-api'; import { PermissionStyleModel } from './../models/permissions-style.model'; import { ShareDataRow } from './share-data-row.model'; @@ -57,12 +51,14 @@ export class ShareDataTableAdapter implements DataTableAdapter { return this._sortingMode; } - constructor(private thumbnailService: ThumbnailService, - private contentService: ContentService, - schema: DataColumn[] = [], - sorting?: DataSorting, - sortingMode: string = 'client', - allowDropFiles: boolean = false) { + constructor( + private thumbnailService: ThumbnailService, + private contentService: ContentService, + schema: DataColumn[] = [], + sorting?: DataSorting, + sortingMode: string = 'client', + allowDropFiles: boolean = false + ) { this.rows = []; this.columns = schema || []; this.sorting = sorting; @@ -106,7 +102,6 @@ export class ShareDataTableAdapter implements DataTableAdapter { } if (col.key === '$thumbnail') { - if (this.imageResolver) { const resolved = this.imageResolver(row, col); if (resolved) { @@ -137,7 +132,6 @@ export class ShareDataTableAdapter implements DataTableAdapter { } if (col.type === 'image') { - if (this.imageResolver) { const resolved = this.imageResolver(row, col); if (resolved) { @@ -149,10 +143,8 @@ export class ShareDataTableAdapter implements DataTableAdapter { return dataRow.cacheValue(col.key, value); } - /** * Gets a thumbnail URL for the given document node. - * * @param node Node or Node ID to get URL for. * @param attachment Toggles whether to retrieve content as an attachment for download * @param ticket Custom ticket to use for authentication @@ -217,14 +209,12 @@ export class ShareDataTableAdapter implements DataTableAdapter { isSmartFolder(node: any) { const nodeAspects = this.getNodeAspectNames(node); - return nodeAspects.indexOf('smf:customConfigSmartFolder') > -1 || - (nodeAspects.indexOf('smf:systemConfigSmartFolder') > -1); + return nodeAspects.indexOf('smf:customConfigSmartFolder') > -1 || nodeAspects.indexOf('smf:systemConfigSmartFolder') > -1; } isRuleFolder(node: any) { const nodeAspects = this.getNodeAspectNames(node); - return nodeAspects.indexOf('rule:rules') > -1 || - (nodeAspects.indexOf('rule:rules') > -1); + return nodeAspects.indexOf('rule:rules') > -1 || nodeAspects.indexOf('rule:rules') > -1; } isALinkFolder(node: any) { @@ -233,7 +223,7 @@ export class ShareDataTableAdapter implements DataTableAdapter { } private getNodeAspectNames(node: any): any[] { - return node.entry?.aspectNames ? node.entry.aspectNames : (node.aspectNames ? node.aspectNames : []); + return node.entry?.aspectNames ? node.entry.aspectNames : node.aspectNames ? node.aspectNames : []; } private sortRows(rows: DataRow[], sorting: DataSorting) { @@ -244,7 +234,6 @@ export class ShareDataTableAdapter implements DataTableAdapter { const options: Intl.CollatorOptions = {}; if (sorting?.key && rows?.length) { - if (sorting.key.includes('sizeInBytes') || sorting.key === 'name') { options.numeric = true; } @@ -256,21 +245,19 @@ export class ShareDataTableAdapter implements DataTableAdapter { let left = a.getValue(sorting.key); if (left) { - left = (left instanceof Date) ? left.valueOf().toString() : left.toString(); + left = left instanceof Date ? left.valueOf().toString() : left.toString(); } else { left = ''; } let right = b.getValue(sorting.key); if (right) { - right = (right instanceof Date) ? right.valueOf().toString() : right.toString(); + right = right instanceof Date ? right.valueOf().toString() : right.toString(); } else { right = ''; } - return sorting.direction === 'asc' - ? left.localeCompare(right, undefined, options) - : right.localeCompare(left, undefined, options); + return sorting.direction === 'asc' ? left.localeCompare(right, undefined, options) : right.localeCompare(left, undefined, options); }); } } @@ -283,7 +270,9 @@ export class ShareDataTableAdapter implements DataTableAdapter { if (nodePaging?.list) { const nodeEntries: NodeEntry[] = nodePaging.list.entries; if (nodeEntries?.length) { - shareDataRows = nodeEntries.map((item) => new ShareDataRow(item, this.contentService, this.permissionsStyle, this.thumbnailService, this.allowDropFiles)); + shareDataRows = nodeEntries.map( + (item) => new ShareDataRow(item, this.contentService, this.permissionsStyle, this.thumbnailService, this.allowDropFiles) + ); if (this.filter) { shareDataRows = shareDataRows.filter(this.filter); @@ -326,6 +315,6 @@ export class ShareDataTableAdapter implements DataTableAdapter { } getRowByNodeId(nodeId: string): DataRow { - return this.rows.find((row: DataRow) => row.node.entry.id === nodeId); + return this.rows.find((row: DataRow) => row.node.entry.id === nodeId); } } diff --git a/lib/content-services/src/lib/document-list/models/content-action.model.ts b/lib/content-services/src/lib/document-list/models/content-action.model.ts index 5c55fdd6868..a207e207726 100644 --- a/lib/content-services/src/lib/document-list/models/content-action.model.ts +++ b/lib/content-services/src/lib/document-list/models/content-action.model.ts @@ -59,14 +59,14 @@ export enum ContentActionTarget { export type ContentActionHandler = (obj: any, target?: any, permission?: string) => any; export class DocumentActionModel extends ContentActionModel { - constructor(json?: any) { + constructor(json?: any) { super(json); this.target = 'document'; } } -export class FolderActionModel extends ContentActionModel { - constructor(json?: any) { +export class FolderActionModel extends ContentActionModel { + constructor(json?: any) { super(json); this.target = 'folder'; } diff --git a/lib/content-services/src/lib/document-list/services/custom-resources.service.ts b/lib/content-services/src/lib/document-list/services/custom-resources.service.ts index 6f46e8e5daa..85580cec1b6 100644 --- a/lib/content-services/src/lib/document-list/services/custom-resources.service.ts +++ b/lib/content-services/src/lib/document-list/services/custom-resources.service.ts @@ -89,7 +89,6 @@ export class CustomResourcesService { /** * Gets files recently accessed by a user. - * * @param personId ID of the user * @param pagination Specifies how to paginate the results * @param filters Specifies additional filters to apply (joined with **AND**) @@ -176,7 +175,6 @@ export class CustomResourcesService { /** * Gets favorite files for the current user. - * * @param pagination Specifies how to paginate the results * @param includeFields List of data field names to include in the results * @param where A string to restrict the returned objects by using a predicate @@ -231,7 +229,6 @@ export class CustomResourcesService { /** * Gets sites that the current user is a member of. - * * @param pagination Specifies how to paginate the results * @param where A string to restrict the returned objects by using a predicate * @returns List of sites @@ -273,7 +270,6 @@ export class CustomResourcesService { /** * Gets all sites in the repository. - * * @param pagination Specifies how to paginate the results * @param where A string to restrict the returned objects by using a predicate * @returns List of sites @@ -306,7 +302,6 @@ export class CustomResourcesService { /** * Gets all items currently in the trash. - * * @param pagination Specifies how to paginate the results * @param includeFields List of data field names to include in the results * @returns List of deleted items @@ -325,7 +320,6 @@ export class CustomResourcesService { /** * Gets shared links for the current user. - * * @param pagination Specifies how to paginate the results * @param includeFields List of data field names to include in the results * @param where A string to restrict the returned objects by using a predicate @@ -346,7 +340,6 @@ export class CustomResourcesService { /** * Is the folder ID one of the well-known aliases? - * * @param folderId Folder ID name to check * @returns True if the ID is a well-known name, false otherwise */ @@ -363,7 +356,6 @@ export class CustomResourcesService { /** * Is the folder ID a "-my", "-root-", or "-shared-" alias? - * * @param folderId Folder ID name to check * @returns True if the ID is one of the supported sources, false otherwise */ @@ -380,7 +372,6 @@ export class CustomResourcesService { /** * Gets a folder's contents. - * * @param nodeId ID of the target folder node * @param pagination Specifies how to paginate the results * @param includeFields List of data field names to include in the results @@ -407,7 +398,6 @@ export class CustomResourcesService { /** * Gets the contents of one of the well-known aliases in the form of node ID strings. - * * @param nodeId ID of the target folder node * @param pagination Specifies how to paginate the results * @returns List of node IDs @@ -427,7 +417,6 @@ export class CustomResourcesService { /** * Chooses the correct ID for a node entry. - * * @param node Node object * @param nodeId ID of the node object * @returns ID value @@ -446,7 +435,6 @@ export class CustomResourcesService { /** * Does the well-known alias have a corresponding node ID? - * * @param nodeId Node to check * @returns True if the alias has a corresponding node ID, false otherwise */ diff --git a/lib/content-services/src/lib/document-list/services/document-actions.service.ts b/lib/content-services/src/lib/document-list/services/document-actions.service.ts index cf9d30a8194..b502dfe334c 100644 --- a/lib/content-services/src/lib/document-list/services/document-actions.service.ts +++ b/lib/content-services/src/lib/document-list/services/document-actions.service.ts @@ -48,7 +48,6 @@ export class DocumentActionsService { /** * Gets the handler for an action. - * * @param key Identifier of the action * @returns The handler for the action */ @@ -62,7 +61,6 @@ export class DocumentActionsService { /** * Sets a new handler for an action. - * * @param key Identifier of the action * @param handler Handler for the action * @returns False if the key was an empty/null string, true otherwise @@ -78,7 +76,6 @@ export class DocumentActionsService { /** * Checks if actions can be executed for an item. - * * @param nodeEntry Item to receive an action * @returns True if the action can be executed on this item, false otherwise */ diff --git a/lib/content-services/src/lib/document-list/services/document-list.service.ts b/lib/content-services/src/lib/document-list/services/document-list.service.ts index ca6ea46f418..c7e40c7bd0e 100644 --- a/lib/content-services/src/lib/document-list/services/document-list.service.ts +++ b/lib/content-services/src/lib/document-list/services/document-list.service.ts @@ -63,7 +63,6 @@ export class DocumentListService implements DocumentListLoader { /** * Deletes a node. - * * @param nodeId ID of the node to delete * @returns Empty response when the operation is complete */ @@ -73,7 +72,6 @@ export class DocumentListService implements DocumentListLoader { /** * Copy a node to destination node - * * @param nodeId The id of the node to be copied * @param targetParentId The id of the folder where the node will be copied * @returns NodeEntry for the copied node @@ -84,7 +82,6 @@ export class DocumentListService implements DocumentListLoader { /** * Moves a node to destination node. - * * @param nodeId The id of the node to be moved * @param targetParentId The id of the folder where the node will be moved * @returns NodeEntry for the moved node @@ -95,7 +92,6 @@ export class DocumentListService implements DocumentListLoader { /** * Gets the folder node with the specified relative name path below the root node. - * * @param folder Path to folder. * @param opts Options. * @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association") @@ -140,7 +136,6 @@ export class DocumentListService implements DocumentListLoader { /** * Gets a node via its node ID. - * * @param nodeId ID of the target node * @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association") * @returns Details of the folder @@ -160,7 +155,6 @@ export class DocumentListService implements DocumentListLoader { /** * Gets a folder node via its node ID. - * * @param nodeId ID of the folder node * @param includeFields Extra information to include (available options are "aspectNames", "isLink" and "association") * @returns Details of the folder @@ -184,7 +178,6 @@ export class DocumentListService implements DocumentListLoader { /** * Load a folder by Node Id. - * * @param nodeId ID of the folder node * @param pagination pagination model * @param includeFields List of data field names to include in the results diff --git a/lib/content-services/src/lib/document-list/services/folder-actions.service.ts b/lib/content-services/src/lib/document-list/services/folder-actions.service.ts index 496ce6afcfe..65f48e88109 100644 --- a/lib/content-services/src/lib/document-list/services/folder-actions.service.ts +++ b/lib/content-services/src/lib/document-list/services/folder-actions.service.ts @@ -29,23 +29,23 @@ import { NodeActionsService } from './node-actions.service'; providedIn: 'root' }) export class FolderActionsService { - permissionEvent = new Subject(); error = new Subject(); success = new Subject(); private handlers: { [id: string]: ContentActionHandler } = {}; - constructor(private nodeActionsService: NodeActionsService, - private documentListService: DocumentListService, - private contentService: ContentService, - private translation: TranslationService) { + constructor( + private nodeActionsService: NodeActionsService, + private documentListService: DocumentListService, + private contentService: ContentService, + private translation: TranslationService + ) { this.setupActionHandlers(); } /** * Gets the handler function for an action. - * * @param key Identifier for the action * @returns The handler function */ @@ -59,7 +59,6 @@ export class FolderActionsService { /** * Sets a new handler function for an action. - * * @param key Identifier for the action * @param handler The new handler function * @returns True if the key was a valid action identifier, false otherwise @@ -75,7 +74,6 @@ export class FolderActionsService { /** * Checks if an action is available for a particular item. - * * @param nodeEntry Item to check * @returns True if the action is available, false otherwise */ @@ -107,36 +105,36 @@ export class FolderActionsService { } private prepareHandlers(actionObservable: Observable, target?: any): void { - actionObservable.subscribe( - (fileOperationMessage) => { - if (target && typeof target.reload === 'function') { - target.reload(); - } - this.success.next(fileOperationMessage); - }, - this.error.next.bind(this.error) - ); + actionObservable.subscribe((fileOperationMessage) => { + if (target && typeof target.reload === 'function') { + target.reload(); + } + this.success.next(fileOperationMessage); + }, this.error.next.bind(this.error)); } private deleteNode(node: NodeEntry, target?: any, permission?: string): Observable { if (this.canExecuteAction(node)) { if (this.contentService.hasAllowableOperations(node.entry, permission)) { const handlerObservable = this.documentListService.deleteNode(node.entry.id); - handlerObservable.subscribe(() => { - if (target && typeof target.reload === 'function') { - target.reload(); + handlerObservable.subscribe( + () => { + if (target && typeof target.reload === 'function') { + target.reload(); + } + + const message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name }); + this.success.next(message); + }, + () => { + const message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name }); + this.error.next(message); } - - const message = this.translation.instant('CORE.DELETE_NODE.SINGULAR', { name: node.entry.name }); - this.success.next(message); - }, () => { - const message = this.translation.instant('CORE.DELETE_NODE.ERROR_SINGULAR', { name: node.entry.name }); - this.error.next(message); - }); + ); return handlerObservable; } else { - this.permissionEvent.next(new PermissionModel({type: 'folder', action: 'delete', permission})); + this.permissionEvent.next(new PermissionModel({ type: 'folder', action: 'delete', permission })); return throwError(new Error('No permission to delete')); } } diff --git a/lib/content-services/src/lib/document-list/services/lock.service.ts b/lib/content-services/src/lib/document-list/services/lock.service.ts index efb0d0f19c5..034159a5c78 100644 --- a/lib/content-services/src/lib/document-list/services/lock.service.ts +++ b/lib/content-services/src/lib/document-list/services/lock.service.ts @@ -24,9 +24,7 @@ import { isAfter } from 'date-fns'; providedIn: 'root' }) export class LockService { - - constructor(private authService: AuthenticationService) { - } + constructor(private authService: AuthenticationService) {} isLocked(node: Node): boolean { let isLocked = false; diff --git a/lib/content-services/src/lib/document-list/services/node-actions.service.ts b/lib/content-services/src/lib/document-list/services/node-actions.service.ts index 4e0ceb6b1f5..f9261457be7 100644 --- a/lib/content-services/src/lib/document-list/services/node-actions.service.ts +++ b/lib/content-services/src/lib/document-list/services/node-actions.service.ts @@ -52,7 +52,6 @@ export class NodeActionsService { /** * Copy content node - * * @param contentEntry node to copy * @param permission permission which is needed to apply the action * @returns operation result @@ -63,7 +62,6 @@ export class NodeActionsService { /** * Copy folder node - * * @param contentEntry node to copy * @param permission permission which is needed to apply the action * @returns operation result @@ -74,7 +72,6 @@ export class NodeActionsService { /** * Move content node - * * @param contentEntry node to move * @param permission permission which is needed to apply the action * @returns operation result @@ -85,7 +82,6 @@ export class NodeActionsService { /** * Move folder node - * * @param contentEntry node to move * @param permission permission which is needed to apply the action * @returns operation result @@ -96,7 +92,6 @@ export class NodeActionsService { /** * General method for performing the given operation (copy|move) - * * @param action the action to perform (copy|move) * @param type type of the content (content|folder) * @param contentEntry the contentEntry which has to have the action performed on diff --git a/lib/content-services/src/lib/group/services/group.service.ts b/lib/content-services/src/lib/group/services/group.service.ts index 0cab9e5434b..d712943155a 100644 --- a/lib/content-services/src/lib/group/services/group.service.ts +++ b/lib/content-services/src/lib/group/services/group.service.ts @@ -25,27 +25,27 @@ import { map } from 'rxjs/operators'; providedIn: 'root' }) export class GroupService { - private _groupsApi: GroupsApi; get groupsApi(): GroupsApi { this._groupsApi = this._groupsApi ?? new GroupsApi(this.alfrescoApiService.getInstance()); return this._groupsApi; } - constructor( - private alfrescoApiService: AlfrescoApiService - ) { - } + constructor(private alfrescoApiService: AlfrescoApiService) {} async listAllGroupMembershipsForPerson(personId: string, opts?: any, accumulator = []): Promise { const groupsPaginated = await this.groupsApi.listGroupMembershipsForPerson(personId, opts); accumulator = [...accumulator, ...groupsPaginated.list.entries]; if (groupsPaginated.list.pagination.hasMoreItems) { const skip = groupsPaginated.list.pagination.skipCount + groupsPaginated.list.pagination.count; - return this.listAllGroupMembershipsForPerson(personId, { - maxItems: opts.maxItems, - skipCount: skip - }, accumulator); + return this.listAllGroupMembershipsForPerson( + personId, + { + maxItems: opts.maxItems, + skipCount: skip + }, + accumulator + ); } else { return accumulator; } @@ -53,32 +53,40 @@ export class GroupService { /** * Returns group for specified id. - * * @param id id of group to return. * @param opts additional query parameters * @returns Observable group for specified id. */ getGroup(id: string, opts?: ContentIncludeQuery): Observable { - return from(this.groupsApi.getGroup(id, opts)).pipe(map((group) => { - group.entry.description ||= ''; - return group; - })); + return from(this.groupsApi.getGroup(id, opts)).pipe( + map((group) => { + group.entry.description ||= ''; + return group; + }) + ); } /** * Updates specified group. - * * @param group group to update. * @param opts additional query parameters * @returns Observable updated group. */ updateGroup(group: Group, opts?: ContentIncludeQuery): Observable { - return from(this.groupsApi.updateGroup(group.id, { - displayName: group.displayName, - description: group.description - }, opts)).pipe(map((updatedGroup) => { - updatedGroup.entry.description ||= ''; - return updatedGroup; - })); + return from( + this.groupsApi.updateGroup( + group.id, + { + displayName: group.displayName, + description: group.description + }, + opts + ) + ).pipe( + map((updatedGroup) => { + updatedGroup.entry.description ||= ''; + return updatedGroup; + }) + ); } } diff --git a/lib/content-services/src/lib/legal-hold/services/legal-hold.service.ts b/lib/content-services/src/lib/legal-hold/services/legal-hold.service.ts index 9b877a3485f..be7a92b3119 100644 --- a/lib/content-services/src/lib/legal-hold/services/legal-hold.service.ts +++ b/lib/content-services/src/lib/legal-hold/services/legal-hold.service.ts @@ -45,7 +45,6 @@ export class LegalHoldService { /** * Gets the list of holds available in the file plan. - * * @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias. * @param options Optional parameters supported by JS-API * @returns List of holds Observable @@ -56,7 +55,6 @@ export class LegalHoldService { /** * Assign a node to a hold. - * * @param nodeId The Id of the node which will be assigned to a hold * @param holdId The Id of the hold to which nodes will be assigned * @returns Observable @@ -67,7 +65,6 @@ export class LegalHoldService { /** * Assign multiple nodes to a hold. - * * @param nodeIds The list of managed node Ids * @param holdId The Id of the hold to which nodes will be assigned * @returns Observable @@ -78,7 +75,6 @@ export class LegalHoldService { /** * Unassign the relationship between a child with id nodeId and a parent hold with id holdId. - * * @param holdId The hold Id * @param nodeId The Id of the node which is unassigned * @returns Empty response @@ -89,7 +85,6 @@ export class LegalHoldService { /** * Create hold. - * * @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias. * @param hold Hold to create * @returns List of created holds Observable @@ -100,7 +95,6 @@ export class LegalHoldService { /** * Create list of holds. - * * @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias. * @param holds Array of holds to create * @returns List of created holds Observable @@ -111,7 +105,6 @@ export class LegalHoldService { /** * Start the asynchronous bulk process for a hold with id holdId based on search query results. - * * @param holdId The identifier of a hold * @param query Search query * @returns Observable @@ -122,7 +115,6 @@ export class LegalHoldService { /** * Assign a folder to a hold. - * * @param holdId The identifier of a hold * @param folderId The identifier of a folder * @param language Language code @@ -139,7 +131,6 @@ export class LegalHoldService { /** * Get status of bulk operation with **bulkStatusId** for **holdId**. - * * @param bulkStatusId The identifier of a bulk status * @param holdId The identifier of a hold * @returns Promise diff --git a/lib/content-services/src/lib/mock/add-permission.component.mock.ts b/lib/content-services/src/lib/mock/add-permission.component.mock.ts index 481d6bd5614..3ffac7fb6de 100644 --- a/lib/content-services/src/lib/mock/add-permission.component.mock.ts +++ b/lib/content-services/src/lib/mock/add-permission.component.mock.ts @@ -17,128 +17,126 @@ /* spellchecker: disable */ -export const fakeAuthorityResults: any[] = [{ - entry: { - aspectNames: [ - 'cm:personDisabled', - 'cm:ownable', - 'cm:preferences' - ], - isFolder: false, - search: { - score: 4.014668 - }, - isFile: false, - name: 'dc103838-645f-43c1-8a2a-bc187e13c343', - location: 'nodes', - id: 'dc103838-645f-43c1-8a2a-bc187e13c343', - nodeType: 'cm:person', - properties: { - 'cm:location': 'Tilbury, UK', - 'cm:persondescription': { - contentUrl: 'store://2018/4/18/9/30/514bb261-bc61-4502-ad2f-dfafec9ae4eb.bin', - mimetype: 'application/octet-stream', - size: 55, - encoding: 'UTF-8', - locale: 'en_US', - id: 148, - infoUrl: 'contentUrl=store://2018/4/18/9/30/514bb261-bc61-4502-ad2f-dfafec9ae4eb.bin|mimetype=application/octet-stream|size=55|encoding=UTF-8|locale=en_US_' +export const fakeAuthorityResults: any[] = [ + { + entry: { + aspectNames: ['cm:personDisabled', 'cm:ownable', 'cm:preferences'], + isFolder: false, + search: { + score: 4.014668 }, - 'cm:owner': { - id: 'abeecher', - displayName: 'Alice Beecher' + isFile: false, + name: 'dc103838-645f-43c1-8a2a-bc187e13c343', + location: 'nodes', + id: 'dc103838-645f-43c1-8a2a-bc187e13c343', + nodeType: 'cm:person', + properties: { + 'cm:location': 'Tilbury, UK', + 'cm:persondescription': { + contentUrl: 'store://2018/4/18/9/30/514bb261-bc61-4502-ad2f-dfafec9ae4eb.bin', + mimetype: 'application/octet-stream', + size: 55, + encoding: 'UTF-8', + locale: 'en_US', + id: 148, + infoUrl: + 'contentUrl=store://2018/4/18/9/30/514bb261-bc61-4502-ad2f-dfafec9ae4eb.bin|mimetype=application/octet-stream|size=55|encoding=UTF-8|locale=en_US_' + }, + 'cm:owner': { + id: 'abeecher', + displayName: 'Alice Beecher' + }, + 'cm:companyaddress2': 'Tilbury', + 'cm:userStatus': 'Helping to design the look and feel of the new web site', + 'cm:companyaddress1': '200 Butterwick Street', + 'cm:telephone': '0112211001100', + 'cm:preferenceValues': { + contentUrl: 'store://2018/4/18/9/30/afc39bc9-6bac-4f24-8730-9d9f617a322e.bin', + mimetype: 'text/plain', + size: 709, + encoding: 'UTF-8', + locale: 'en_US', + id: 147, + infoUrl: + 'contentUrl=store://2018/4/18/9/30/afc39bc9-6bac-4f24-8730-9d9f617a322e.bin|mimetype=text/plain|size=709|encoding=UTF-8|locale=en_US_' + }, + 'cm:userName': 'abeecher', + 'cm:companyaddress3': 'UK', + 'cm:userStatusTime': '2011-02-15T20:20:13.432+0000', + 'cm:email': 'abeecher@example.com', + 'cm:skype': 'abeecher', + 'cm:jobtitle': 'Graphic Designer', + 'cm:homeFolderProvider': 'userHomesHomeFolderProvider', + 'cm:homeFolder': '242533d8-68e6-4811-bc3d-61ec63c614aa', + 'cm:lastName': 'Beecher', + 'cm:sizeCurrent': 8382006, + 'cm:sizeQuota': -1, + 'cm:firstName': 'Alice', + 'cm:emailFeedId': 440, + 'cm:authorizationStatus': 'NEVER_AUTHORIZED', + 'cm:mobile': '0112211001100', + 'cm:organization': 'Moresby, Garland and Wedge', + 'cm:companypostcode': 'ALF1 SAM1' }, - 'cm:companyaddress2': 'Tilbury', - 'cm:userStatus': 'Helping to design the look and feel of the new web site', - 'cm:companyaddress1': '200 Butterwick Street', - 'cm:telephone': '0112211001100', - 'cm:preferenceValues': { - contentUrl: 'store://2018/4/18/9/30/afc39bc9-6bac-4f24-8730-9d9f617a322e.bin', - mimetype: 'text/plain', - size: 709, - encoding: 'UTF-8', - locale: 'en_US', - id: 147, - infoUrl: 'contentUrl=store://2018/4/18/9/30/afc39bc9-6bac-4f24-8730-9d9f617a322e.bin|mimetype=text/plain|size=709|encoding=UTF-8|locale=en_US_' + parentId: '063f5d48-a0b3-4cbf-826c-88a4fbfa3336' + } + }, + { + entry: { + aspectNames: ['cm:ownable', 'cm:preferences'], + isFolder: false, + search: { + score: 4.014668 }, - 'cm:userName': 'abeecher', - 'cm:companyaddress3': 'UK', - 'cm:userStatusTime': '2011-02-15T20:20:13.432+0000', - 'cm:email': 'abeecher@example.com', - 'cm:skype': 'abeecher', - 'cm:jobtitle': 'Graphic Designer', - 'cm:homeFolderProvider': 'userHomesHomeFolderProvider', - 'cm:homeFolder': '242533d8-68e6-4811-bc3d-61ec63c614aa', - 'cm:lastName': 'Beecher', - 'cm:sizeCurrent': 8382006, - 'cm:sizeQuota': -1, - 'cm:firstName': 'Alice', - 'cm:emailFeedId': 440, - 'cm:authorizationStatus': 'NEVER_AUTHORIZED', - 'cm:mobile': '0112211001100', - 'cm:organization': 'Moresby, Garland and Wedge', - 'cm:companypostcode': 'ALF1 SAM1' - }, - parentId: '063f5d48-a0b3-4cbf-826c-88a4fbfa3336' - } -}, -{ - entry: { - aspectNames: [ - 'cm:ownable', - 'cm:preferences' - ], - isFolder: false, - search: { - score: 4.014668 - }, - isFile: false, - name: 'e320c16b-a763-4a4e-9f22-286ff5d8dca2', - location: 'nodes', - id: 'e320c16b-a763-4a4e-9f22-286ff5d8dca2', - nodeType: 'cm:person', - properties: { - 'cm:homeFolderProvider': 'bootstrapHomeFolderProvider', - 'cm:preferenceValues': { - contentUrl: 'store://2018/4/23/14/42/92bb4aa9-db27-41a4-9804-ddab3cc83d3e.bin', - mimetype: 'text/plain', - size: 102, - encoding: 'UTF-8', - locale: 'en', - id: 313, - infoUrl: 'contentUrl=store://2018/4/23/14/42/92bb4aa9-db27-41a4-9804-ddab3cc83d3e.bin|mimetype=text/plain|size=102|encoding=UTF-8|locale=en_' + isFile: false, + name: 'e320c16b-a763-4a4e-9f22-286ff5d8dca2', + location: 'nodes', + id: 'e320c16b-a763-4a4e-9f22-286ff5d8dca2', + nodeType: 'cm:person', + properties: { + 'cm:homeFolderProvider': 'bootstrapHomeFolderProvider', + 'cm:preferenceValues': { + contentUrl: 'store://2018/4/23/14/42/92bb4aa9-db27-41a4-9804-ddab3cc83d3e.bin', + mimetype: 'text/plain', + size: 102, + encoding: 'UTF-8', + locale: 'en', + id: 313, + infoUrl: + 'contentUrl=store://2018/4/23/14/42/92bb4aa9-db27-41a4-9804-ddab3cc83d3e.bin|mimetype=text/plain|size=102|encoding=UTF-8|locale=en_' + }, + 'cm:authorizationStatus': 'AUTHORIZED', + 'cm:homeFolder': 'a20cd541-4ada-4525-9807-9fa0a047d9f4', + 'cm:userName': 'admin', + 'cm:sizeCurrent': 0, + 'cm:email': 'admin@alfresco.com', + 'cm:firstName': 'Administrator', + 'cm:owner': { + id: 'admin', + displayName: 'Administrator' + } }, - 'cm:authorizationStatus': 'AUTHORIZED', - 'cm:homeFolder': 'a20cd541-4ada-4525-9807-9fa0a047d9f4', - 'cm:userName': 'admin', - 'cm:sizeCurrent': 0, - 'cm:email': 'admin@alfresco.com', - 'cm:firstName': 'Administrator', - 'cm:owner': { - id: 'admin', - displayName: 'Administrator' - } - }, - parentId: '063f5d48-a0b3-4cbf-826c-88a4fbfa3336' - } -}, -{ - entry: { - isFolder: false, - search: { - score: 0.3541112 - }, - isFile: false, - name: 'GROUP_ALFRESCO_ADMINISTRATORS', - location: 'nodes', - id: 'GROUP_ALFRESCO_ADMINISTRATORS', - nodeType: 'cm:authorityContainer', - properties: { - 'cm:authorityName': 'GROUP_ALFRESCO_ADMINISTRATORS' - }, - parentId: '030d833e-da8e-4f5c-8ef9-d809638bd04b' + parentId: '063f5d48-a0b3-4cbf-826c-88a4fbfa3336' + } + }, + { + entry: { + isFolder: false, + search: { + score: 0.3541112 + }, + isFile: false, + name: 'GROUP_ALFRESCO_ADMINISTRATORS', + location: 'nodes', + id: 'GROUP_ALFRESCO_ADMINISTRATORS', + nodeType: 'cm:authorityContainer', + properties: { + 'cm:authorityName': 'GROUP_ALFRESCO_ADMINISTRATORS' + }, + parentId: '030d833e-da8e-4f5c-8ef9-d809638bd04b' + } } -}]; +]; export const fakeAuthorityListResult: any = { list: { @@ -168,64 +166,67 @@ export const fakeNameListResult: any = { lastTxId: 5496 } }, - entries: [{ - entry: { - aspectNames: ['cm:ownable'], - isFolder: false, - search: { - score: 1.0 - }, - isFile: false, - name: '730cd9b0-5617-4865-aee8-90de1d596997', - location: 'nodes', - id: '730cd9b0-5617-4865-aee8-90de1d596997', - nodeType: 'cm:person', - properties: { - 'cm:homeFolderProvider': 'userHomesHomeFolderProvider', - 'cm:authorizationStatus': 'NEVER_AUTHORIZED', - 'cm:homeFolder': '277f505d-6526-45b1-a7b3-c9bdd66f17f6', - 'cm:userName': 'test1', - 'cm:lastName': 'lastName1', - 'cm:sizeCurrent': 0, - 'cm:email': 'test1@gmail.com', - 'cm:sizeQuota': 1073741824, - 'cm:firstName': 'firstName', - 'cm:owner': { - id: 'test1', - displayName: 'firstName lastName1' - } - }, - parentId: '3e9ce910-a4a0-4531-8f80-7734bece6342' - } - }, { - entry: { - aspectNames: ['cm:ownable'], - isFolder: false, - search: { - score: 1.0 - }, - isFile: false, - name: '3d1e9e57-505f-431e-bb2b-38ad8d5d2d15', - location: 'nodes', - id: '3d1e9e57-505f-431e-bb2b-38ad8d5d2d15', - nodeType: 'cm:person', - properties: { - 'cm:homeFolderProvider': 'userHomesHomeFolderProvider', - 'cm:authorizationStatus': 'NEVER_AUTHORIZED', - 'cm:homeFolder': '81a07ff0-82fb-4bbb-b869-d5fd92e71e17', - 'cm:userName': 'test11', - 'cm:lastName': 'lastName2', - 'cm:sizeCurrent': 0, - 'cm:email': 'test2@gmail.com', - 'cm:sizeQuota': -1, - 'cm:firstName': 'firstName', - 'cm:owner': { - id: 'test11', - displayName: 'firstName lastName2' - } - }, - parentId: '3e9ce910-a4a0-4531-8f80-7734bece6342' + entries: [ + { + entry: { + aspectNames: ['cm:ownable'], + isFolder: false, + search: { + score: 1.0 + }, + isFile: false, + name: '730cd9b0-5617-4865-aee8-90de1d596997', + location: 'nodes', + id: '730cd9b0-5617-4865-aee8-90de1d596997', + nodeType: 'cm:person', + properties: { + 'cm:homeFolderProvider': 'userHomesHomeFolderProvider', + 'cm:authorizationStatus': 'NEVER_AUTHORIZED', + 'cm:homeFolder': '277f505d-6526-45b1-a7b3-c9bdd66f17f6', + 'cm:userName': 'test1', + 'cm:lastName': 'lastName1', + 'cm:sizeCurrent': 0, + 'cm:email': 'test1@gmail.com', + 'cm:sizeQuota': 1073741824, + 'cm:firstName': 'firstName', + 'cm:owner': { + id: 'test1', + displayName: 'firstName lastName1' + } + }, + parentId: '3e9ce910-a4a0-4531-8f80-7734bece6342' + } + }, + { + entry: { + aspectNames: ['cm:ownable'], + isFolder: false, + search: { + score: 1.0 + }, + isFile: false, + name: '3d1e9e57-505f-431e-bb2b-38ad8d5d2d15', + location: 'nodes', + id: '3d1e9e57-505f-431e-bb2b-38ad8d5d2d15', + nodeType: 'cm:person', + properties: { + 'cm:homeFolderProvider': 'userHomesHomeFolderProvider', + 'cm:authorizationStatus': 'NEVER_AUTHORIZED', + 'cm:homeFolder': '81a07ff0-82fb-4bbb-b869-d5fd92e71e17', + 'cm:userName': 'test11', + 'cm:lastName': 'lastName2', + 'cm:sizeCurrent': 0, + 'cm:email': 'test2@gmail.com', + 'cm:sizeQuota': -1, + 'cm:firstName': 'firstName', + 'cm:owner': { + id: 'test11', + displayName: 'firstName lastName2' + } + }, + parentId: '3e9ce910-a4a0-4531-8f80-7734bece6342' + } } - }] + ] } }; diff --git a/lib/content-services/src/lib/mock/alfresco-api.service.mock.ts b/lib/content-services/src/lib/mock/alfresco-api.service.mock.ts index 043dff72952..267de0b79be 100644 --- a/lib/content-services/src/lib/mock/alfresco-api.service.mock.ts +++ b/lib/content-services/src/lib/mock/alfresco-api.service.mock.ts @@ -21,9 +21,7 @@ import { AppConfigService, StorageService } from '@alfresco/adf-core'; @Injectable() export class AlfrescoApiServiceMock extends AlfrescoApiService { - - constructor(protected appConfig: AppConfigService, - protected storageService: StorageService) { + constructor(protected appConfig: AppConfigService, protected storageService: StorageService) { super(appConfig, storageService); if (!this.alfrescoApi) { this.initAlfrescoApi(); diff --git a/lib/content-services/src/lib/mock/date-range-search-filter.mock.ts b/lib/content-services/src/lib/mock/date-range-search-filter.mock.ts index 47acf6ee7cb..09fbe5c3d00 100644 --- a/lib/content-services/src/lib/mock/date-range-search-filter.mock.ts +++ b/lib/content-services/src/lib/mock/date-range-search-filter.mock.ts @@ -18,7 +18,7 @@ import { SearchCategory } from '../search/models/search-category.interface'; export const mockSearchFilterWithoutDisplayedLabelsByField: SearchCategory = { - id : 'test', + id: 'test', name: 'test', expanded: false, enabled: true, @@ -33,7 +33,7 @@ export const mockSearchFilterWithoutDisplayedLabelsByField: SearchCategory = { }; export const mockSearchFilterWithWrongDisplayedLabelsByField: SearchCategory = { - id : 'test', + id: 'test', name: 'test', expanded: false, enabled: true, @@ -51,7 +51,7 @@ export const mockSearchFilterWithWrongDisplayedLabelsByField: SearchCategory = { }; export const mockSearchFilterWithDisplayedLabelsByField: SearchCategory = { - id : 'test', + id: 'test', name: 'test', expanded: false, enabled: true, diff --git a/lib/content-services/src/lib/mock/document-list.component.mock.ts b/lib/content-services/src/lib/mock/document-list.component.mock.ts index aa799212b1e..d881226d8c7 100644 --- a/lib/content-services/src/lib/mock/document-list.component.mock.ts +++ b/lib/content-services/src/lib/mock/document-list.component.mock.ts @@ -27,10 +27,13 @@ export const fakeNodeWithCreatePermission = new Node({ path: { name: '/Company Home/User Homes', isComplete: true, - elements: [{ - id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', - name: 'Company Home' - }, { id: '55052317-7e59-4058-8e07-769f41e615e1', name: 'User Homes' }] + elements: [ + { + id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', + name: 'Company Home' + }, + { id: '55052317-7e59-4058-8e07-769f41e615e1', name: 'User Homes' } + ] }, isFolder: true, modifiedByUser: { id: 'Test', displayName: 'Test' }, @@ -51,10 +54,13 @@ export const fakeNodeWithNoPermission = new Node({ path: { name: '/Company Home/User Homes', isComplete: true, - elements: [{ - id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', - name: 'Company Home' - }, { id: '55052317-7e59-4058-8e07-769f41e615e1', name: 'User Homes' }] + elements: [ + { + id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', + name: 'Company Home' + }, + { id: '55052317-7e59-4058-8e07-769f41e615e1', name: 'User Homes' } + ] }, isFolder: true, modifiedByUser: { id: 'Test', displayName: 'Test' }, @@ -72,36 +78,41 @@ export const fakeNodeAnswerWithEntries = { skipCount: 10, maxItems: 10 }, - entries: [{ - entry: { - isFile: true, - createdByUser: { id: 'admin', displayName: 'Administrator' }, - modifiedAt: '2017-05-24T15:08:55.640Z', - nodeType: 'cm:content', - content: { - mimeType: 'application/rtf', - mimeTypeName: 'Rich Text Format', - sizeInBytes: 14530, - encoding: 'UTF-8' - }, - parentId: 'd124de26-6ba0-4f40-8d98-4907da2d337a', - createdAt: '2017-05-24T15:08:55.640Z', - path: { - name: '/Company Home/Guest Home', - isComplete: true, - elements: [{ - id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', - name: 'Company Home' - }, { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' }] - }, - isFolder: false, - modifiedByUser: { id: 'admin', displayName: 'Administrator' }, - name: 'b_txt_file.rtf', - id: '67b80f77-dbca-4f58-be6c-71b9dd61ea53', - properties: { 'cm:versionLabel': '1.0', 'cm:versionType': 'MAJOR' }, - allowableOperations: ['delete', 'update'] + entries: [ + { + entry: { + isFile: true, + createdByUser: { id: 'admin', displayName: 'Administrator' }, + modifiedAt: '2017-05-24T15:08:55.640Z', + nodeType: 'cm:content', + content: { + mimeType: 'application/rtf', + mimeTypeName: 'Rich Text Format', + sizeInBytes: 14530, + encoding: 'UTF-8' + }, + parentId: 'd124de26-6ba0-4f40-8d98-4907da2d337a', + createdAt: '2017-05-24T15:08:55.640Z', + path: { + name: '/Company Home/Guest Home', + isComplete: true, + elements: [ + { + id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', + name: 'Company Home' + }, + { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' } + ] + }, + isFolder: false, + modifiedByUser: { id: 'admin', displayName: 'Administrator' }, + name: 'b_txt_file.rtf', + id: '67b80f77-dbca-4f58-be6c-71b9dd61ea53', + properties: { 'cm:versionLabel': '1.0', 'cm:versionType': 'MAJOR' }, + allowableOperations: ['delete', 'update'] + } } - }] + ] } }; @@ -127,34 +138,38 @@ export const fakeGetSitesAnswer = { skipCount: 0, maxItems: 20 }, - entries: [{ - entry: { - role: 'SiteManager', - visibility: 'PRIVATE', - guid: 'ac65fdbe-0c79-4f67-bd6a-b89a2768561b', - id: 'admin-site', - preset: 'site-dashboard', - title: 'Admin Site' - } - }, { - entry: { - role: 'SiteManager', - visibility: 'PUBLIC', - guid: 'b4cff62a-664d-4d45-9302-98723eac1319', - description: 'This is a Sample Alfresco Team site.', - id: 'swsdp', - preset: 'site-dashboard', - title: 'Sample: Web Site Design Project' - } - }, { - entry: { - visibility: 'PUBLIC', - guid: 'af36cf8f-d43c-4a4b-84e6-d1b03e3a2ce5', - id: 'test-site', - preset: 'site-dashboard', - title: 'Test Site' + entries: [ + { + entry: { + role: 'SiteManager', + visibility: 'PRIVATE', + guid: 'ac65fdbe-0c79-4f67-bd6a-b89a2768561b', + id: 'admin-site', + preset: 'site-dashboard', + title: 'Admin Site' + } + }, + { + entry: { + role: 'SiteManager', + visibility: 'PUBLIC', + guid: 'b4cff62a-664d-4d45-9302-98723eac1319', + description: 'This is a Sample Alfresco Team site.', + id: 'swsdp', + preset: 'site-dashboard', + title: 'Sample: Web Site Design Project' + } + }, + { + entry: { + visibility: 'PUBLIC', + guid: 'af36cf8f-d43c-4a4b-84e6-d1b03e3a2ce5', + id: 'test-site', + preset: 'site-dashboard', + title: 'Test Site' + } } - }] + ] } }; @@ -167,30 +182,39 @@ export const fakeGetSiteMembership = { skipCount: 0, maxItems: 20 }, - entries: [{ - entry: { - site: { + entries: [ + { + entry: { + site: { + role: 'SiteManager', + visibility: 'PRIVATE', + guid: 'ac65fdbe-0c79-4f67-bd6a-b89a2768561b', + id: 'admin-site', + preset: 'site-dashboard', + title: 'Admin Site' + }, role: 'SiteManager', - visibility: 'PRIVATE', guid: 'ac65fdbe-0c79-4f67-bd6a-b89a2768561b', - id: 'admin-site', - preset: 'site-dashboard', - title: 'Admin Site' - }, role: 'SiteManager', guid: 'ac65fdbe-0c79-4f67-bd6a-b89a2768561b', id: 'admin-site' - } - }, { - entry: { - site: { + id: 'admin-site' + } + }, + { + entry: { + site: { + role: 'SiteManager', + visibility: 'PUBLIC', + guid: 'b4cff62a-664d-4d45-9302-98723eac1319', + description: 'This is a Sample Alfresco Team site.', + id: 'swsdp', + preset: 'site-dashboard', + title: 'Sample: Web Site Design Project' + }, role: 'SiteManager', - visibility: 'PUBLIC', guid: 'b4cff62a-664d-4d45-9302-98723eac1319', - description: 'This is a Sample Alfresco Team site.', - id: 'swsdp', - preset: 'site-dashboard', - title: 'Sample: Web Site Design Project' - }, role: 'SiteManager', guid: 'b4cff62a-664d-4d45-9302-98723eac1319', id: 'swsdp' + id: 'swsdp' + } } - }] + ] } }; @@ -202,17 +226,24 @@ export const fakeNodePaging: NodePaging = { totalItems: 5, skipCount: 0, maxItems: 100 - }, entries: [{ - entry: fakeNodeWithNoPermission - }, { - entry: fakeNodeWithNoPermission - }, { - entry: fakeNodeWithNoPermission - }, { - entry: fakeNodeWithNoPermission - }, { - entry: fakeNodeWithNoPermission - }] + }, + entries: [ + { + entry: fakeNodeWithNoPermission + }, + { + entry: fakeNodeWithNoPermission + }, + { + entry: fakeNodeWithNoPermission + }, + { + entry: fakeNodeWithNoPermission + }, + { + entry: fakeNodeWithNoPermission + } + ] } }; @@ -232,10 +263,13 @@ export const mockNode1 = new Node({ path: { name: '/Company Home/Guest Home', isComplete: true, - elements: [{ - id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', - name: 'Company Home' - }, { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' }] + elements: [ + { + id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', + name: 'Company Home' + }, + { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' } + ] }, isFolder: false, modifiedByUser: { id: 'admin', displayName: 'Administrator' }, @@ -261,10 +295,13 @@ export const mockNode2 = new Node({ path: { name: '/Company Home/Guest Home', isComplete: true, - elements: [{ - id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', - name: 'Company Home' - }, { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' }] + elements: [ + { + id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', + name: 'Company Home' + }, + { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' } + ] }, isFolder: false, modifiedByUser: { id: 'admin', displayName: 'Administrator' }, @@ -290,10 +327,13 @@ export const mockNode3 = new Node({ path: { name: '/Company Home/Guest Home', isComplete: true, - elements: [{ - id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', - name: 'Company Home' - }, { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' }] + elements: [ + { + id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', + name: 'Company Home' + }, + { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' } + ] }, isFolder: false, modifiedByUser: { id: 'admin', displayName: 'Administrator' }, @@ -320,12 +360,17 @@ export const mockNodePagingWithPreselectedNodes: NodePaging = { totalItems: 5, skipCount: 0, maxItems: 100 - }, entries: [{ - entry: mockNode1 - }, { - entry: mockNode2 - }, { - entry: mockNode3 - }] + }, + entries: [ + { + entry: mockNode1 + }, + { + entry: mockNode2 + }, + { + entry: mockNode3 + } + ] } }; diff --git a/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts b/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts index 5cbefa40aad..2559b42e93d 100644 --- a/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts +++ b/lib/content-services/src/lib/mock/inherited-permission.component.mock.ts @@ -24,15 +24,12 @@ import { Component } from '@angular/core'; NODE UPDATED ` }) - export class SimpleInheritedPermissionTestComponent { - message: string = ''; nodeId: string = 'fake-node-id'; updatedNode: boolean = false; - constructor() { - } + constructor() {} onUpdate(node: any) { this.updatedNode = node.permissions?.isInheritanceEnabled ?? false; diff --git a/lib/content-services/src/lib/mock/new-version-uploader.service.mock.ts b/lib/content-services/src/lib/mock/new-version-uploader.service.mock.ts index c98a4e1fe8b..5cf7054de41 100644 --- a/lib/content-services/src/lib/mock/new-version-uploader.service.mock.ts +++ b/lib/content-services/src/lib/mock/new-version-uploader.service.mock.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -export const mockNode: any = ({ +export const mockNode: any = { isFile: true, createdByUser: { id: 'admin', displayName: 'Administrator' }, modifiedAt: '2017-05-24T15:08:55.640Z', @@ -31,10 +31,13 @@ export const mockNode: any = ({ path: { name: '/Company Home/Guest Home', isComplete: true, - elements: [{ - id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', - name: 'Company Home' - }, { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' }] + elements: [ + { + id: '94acfc73-7014-4475-9bd9-93a2162f0f8c', + name: 'Company Home' + }, + { id: 'd124de26-6ba0-4f40-8d98-4907da2d337a', name: 'Guest Home' } + ] }, isFolder: false, modifiedByUser: { id: 'admin', displayName: 'Administrator' }, @@ -42,7 +45,7 @@ export const mockNode: any = ({ id: '70e1cc6a-6918-468a-b84a-1048093b06fd', properties: { 'cm:versionLabel': '1.0', 'cm:versionType': 'MAJOR' }, allowableOperations: ['delete', 'update'] -}); +}; export const mockFile = new File(['fakefake'], 'file-fake.png', { type: 'image/png' }); @@ -59,21 +62,13 @@ export const mockNewVersionUploaderData: any = { modifiedAt: '2022-05-24T10:19:43.544Z', nodeType: 'cm:content', content: { - mimeType: - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', mimeTypeName: 'Microsoft Word 2007', sizeInBytes: 11887, encoding: 'UTF-8' }, parentId: '422538ca-ea4b-4086-83f9-b36e4521ec7f', - aspectNames: [ - 'rn:renditioned', - 'cm:versionable', - 'cm:titled', - 'cm:auditable', - 'cm:author', - 'cm:thumbnailModification' - ], + aspectNames: ['rn:renditioned', 'cm:versionable', 'cm:titled', 'cm:auditable', 'cm:author', 'cm:thumbnailModification'], createdAt: '2022-05-24T07:26:44.429Z', isFolder: false, modifiedByUser: { @@ -101,21 +96,13 @@ export const mockNewVersionUploaderData: any = { modifiedAt: '2022-05-24T07:26:45.337Z', nodeType: 'cm:content', content: { - mimeType: - 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', + mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', mimeTypeName: 'Microsoft Word 2007', sizeInBytes: 11949, encoding: 'UTF-8' }, parentId: '422538ca-ea4b-4086-83f9-b36e4521ec7f', - aspectNames: [ - 'rn:renditioned', - 'cm:versionable', - 'cm:titled', - 'cm:auditable', - 'cm:author', - 'cm:thumbnailModification' - ], + aspectNames: ['rn:renditioned', 'cm:versionable', 'cm:titled', 'cm:auditable', 'cm:author', 'cm:thumbnailModification'], createdAt: '2022-05-24T07:26:44.429Z', path: { name: '/Company Home/User Homes/hruser', @@ -155,13 +142,7 @@ export const mockNewVersionUploaderData: any = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: true }, modifiedByUser: { diff --git a/lib/content-services/src/lib/mock/permission-list.component.mock.ts b/lib/content-services/src/lib/mock/permission-list.component.mock.ts index e4203444232..295c4739db7 100644 --- a/lib/content-services/src/lib/mock/permission-list.component.mock.ts +++ b/lib/content-services/src/lib/mock/permission-list.component.mock.ts @@ -16,34 +16,28 @@ */ export const fakeNodeWithPermissions: any = { - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/Sites/testsite/documentLibrary', isComplete: true, elements: [ - { - id: '2be275a1-b00d-4e45-83d8-66af43ac2252', - name: 'Company Home' - }, - { - id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', - name: 'Sites' - }, - { - id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', - name: 'testsite' - }, - { - id: '71626fae-0c04-4d0c-a129-20fa4c178716', - name: 'documentLibrary' - } + { + id: '2be275a1-b00d-4e45-83d8-66af43ac2252', + name: 'Company Home' + }, + { + id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', + name: 'Sites' + }, + { + id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', + name: 'testsite' + }, + { + id: '71626fae-0c04-4d0c-a129-20fa4c178716', + name: 'documentLibrary' + } ] }, isFolder: true, @@ -73,13 +67,7 @@ export const fakeNodeWithPermissions: any = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: true }, modifiedByUser: { @@ -92,45 +80,37 @@ export const fakeNodeWithPermissions: any = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } }; export const fakeNodeInheritedOnly = { - allowableOperations: [ 'updatePermissions' ], - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + allowableOperations: ['updatePermissions'], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/Sites/testsite/documentLibrary', isComplete: true, elements: [ - { - id: '2be275a1-b00d-4e45-83d8-66af43ac2252', - name: 'Company Home' - }, - { - id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', - name: 'Sites' - }, - { - id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', - name: 'testsite', - nodeType: 'st:site' - }, - { - id: '71626fae-0c04-4d0c-a129-20fa4c178716', - name: 'documentLibrary' - } + { + id: '2be275a1-b00d-4e45-83d8-66af43ac2252', + name: 'Company Home' + }, + { + id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', + name: 'Sites' + }, + { + id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', + name: 'testsite', + nodeType: 'st:site' + }, + { + id: '71626fae-0c04-4d0c-a129-20fa4c178716', + name: 'documentLibrary' + } ] }, isFolder: true, @@ -153,13 +133,7 @@ export const fakeNodeInheritedOnly = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: true }, modifiedByUser: { @@ -172,43 +146,35 @@ export const fakeNodeInheritedOnly = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } }; export const fakeReadOnlyNodeInherited = { - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/Sites/testsite/documentLibrary', isComplete: true, elements: [ - { - id: '2be275a1-b00d-4e45-83d8-66af43ac2252', - name: 'Company Home' - }, - { - id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', - name: 'Sites' - }, - { - id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', - name: 'testsite' - }, - { - id: '71626fae-0c04-4d0c-a129-20fa4c178716', - name: 'documentLibrary' - } + { + id: '2be275a1-b00d-4e45-83d8-66af43ac2252', + name: 'Company Home' + }, + { + id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', + name: 'Sites' + }, + { + id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', + name: 'testsite' + }, + { + id: '71626fae-0c04-4d0c-a129-20fa4c178716', + name: 'documentLibrary' + } ] }, isFolder: true, @@ -231,13 +197,7 @@ export const fakeReadOnlyNodeInherited = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: true }, modifiedByUser: { @@ -250,22 +210,14 @@ export const fakeReadOnlyNodeInherited = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } }; export const fakeNodeWithoutSite: any = { - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/User Homes/user/documentLibrary', @@ -308,13 +260,7 @@ export const fakeNodeWithoutSite: any = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: false }, modifiedByUser: { @@ -327,47 +273,39 @@ export const fakeNodeWithoutSite: any = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } }; export const fakeNodeWithOnlyLocally: any = { - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/Sites/testsite/documentLibrary', isComplete: true, elements: [ - { - id: '2be275a1-b00d-4e45-83d8-66af43ac2252', - name: 'Company Home', - nodeType: 'cm:folder' - }, - { - id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', - name: 'Sites', - nodeType: 'st:sites' - }, - { - id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', - name: 'testsite', - nodeType: 'st:site' - }, - { - id: '71626fae-0c04-4d0c-a129-20fa4c178716', - name: 'documentLibrary', - nodeType: 'cm:folder' - } + { + id: '2be275a1-b00d-4e45-83d8-66af43ac2252', + name: 'Company Home', + nodeType: 'cm:folder' + }, + { + id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', + name: 'Sites', + nodeType: 'st:sites' + }, + { + id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', + name: 'testsite', + nodeType: 'st:site' + }, + { + id: '71626fae-0c04-4d0c-a129-20fa4c178716', + name: 'documentLibrary', + nodeType: 'cm:folder' + } ] }, isFolder: true, @@ -385,13 +323,7 @@ export const fakeNodeWithOnlyLocally: any = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: false }, modifiedByUser: { @@ -404,43 +336,35 @@ export const fakeNodeWithOnlyLocally: any = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } }; export const fakeNodeToRemovePermission: any = { - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/Sites/testsite/documentLibrary', isComplete: true, elements: [ - { - id: '2be275a1-b00d-4e45-83d8-66af43ac2252', - name: 'Company Home' - }, - { - id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', - name: 'Sites' - }, - { - id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', - name: 'testsite' - }, - { - id: '71626fae-0c04-4d0c-a129-20fa4c178716', - name: 'documentLibrary' - } + { + id: '2be275a1-b00d-4e45-83d8-66af43ac2252', + name: 'Company Home' + }, + { + id: '1be10a97-6eb9-4b60-b6c6-1673900e9631', + name: 'Sites' + }, + { + id: 'e002c740-b8f9-482a-a554-8fff4e4c9dc0', + name: 'testsite' + }, + { + id: '71626fae-0c04-4d0c-a129-20fa4c178716', + name: 'documentLibrary' + } ] }, isFolder: true, @@ -468,13 +392,7 @@ export const fakeNodeToRemovePermission: any = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: true }, modifiedByUser: { @@ -487,22 +405,14 @@ export const fakeNodeToRemovePermission: any = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } }; export const fakeNodeWithoutPermissions: any = { - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/Sites/testsite/documentLibrary', @@ -548,9 +458,7 @@ export const fakeNodeWithoutPermissions: any = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } @@ -578,11 +486,7 @@ export const fakeSiteNodeResponse: any = { modifiedAt: '2018-03-22T15:40:10.093+0000', nodeType: 'st:site', parentId: '1be10a97-6eb9-4b60-b6c6-1673900e9631', - aspectNames: [ - 'cm:tagscope', - 'cm:titled', - 'cm:auditable' - ], + aspectNames: ['cm:tagscope', 'cm:titled', 'cm:auditable'], createdAt: '2018-03-22T15:39:50.821+0000', isFolder: true, search: { @@ -663,14 +567,8 @@ export const fakeEmptyResponse: any = { }; export const fakeNodeLocalSiteManager = { - allowableOperations: [ 'updatePermissions' ], - aspectNames: [ - 'cm:auditable', - 'cm:taggable', - 'cm:author', - 'cm:titled', - 'app:uifacets' - ], + allowableOperations: ['updatePermissions'], + aspectNames: ['cm:auditable', 'cm:taggable', 'cm:author', 'cm:titled', 'app:uifacets'], createdAt: '2017-11-16T16:29:38.638+0000', path: { name: '/Company Home/Sites/testsite/documentLibrary', @@ -715,13 +613,7 @@ export const fakeNodeLocalSiteManager = { accessStatus: 'ALLOWED' } ], - settable: [ - 'Contributor', - 'Collaborator', - 'Coordinator', - 'Editor', - 'Consumer' - ], + settable: ['Contributor', 'Collaborator', 'Coordinator', 'Editor', 'Consumer'], isInheritanceEnabled: false }, modifiedByUser: { @@ -734,9 +626,7 @@ export const fakeNodeLocalSiteManager = { properties: { 'cm:title': 'test', 'cm:author': 'yagud', - 'cm:taggable': [ - 'e8c8fbba-03ba-4fa6-86b1-f7ad7c296409' - ], + 'cm:taggable': ['e8c8fbba-03ba-4fa6-86b1-f7ad7c296409'], 'cm:description': 'sleepery', 'app:icon': 'space-icon-default' } diff --git a/lib/content-services/src/lib/mock/search-filter-mock.ts b/lib/content-services/src/lib/mock/search-filter-mock.ts index 83bb9c689c2..889504143eb 100644 --- a/lib/content-services/src/lib/mock/search-filter-mock.ts +++ b/lib/content-services/src/lib/mock/search-filter-mock.ts @@ -100,16 +100,11 @@ export const simpleCategories: SearchCategory[] = [ } } } - ]; export const searchFilter = { - 'app:fields': [ - 'cm:name' - ], - include: [ - 'allowableOperations' - ], + 'app:fields': ['cm:name'], + include: ['allowableOperations'], sorting: { options: [ { @@ -412,8 +407,10 @@ export const mockSearchResult = { label: 'SEARCH.FACET_QUERIES.MIMETYPE', filterQuery: 'content.mimetype:text/html', metrics: [{ type: 'count', value: { count: 13 } }] - }] - }, { + } + ] + }, + { type: 'query', label: 'Size facet queries', buckets: [ @@ -421,60 +418,75 @@ export const mockSearchResult = { label: 'my1', filterQuery: 'content.size:[111111 TO MAX]', metrics: [{ type: 'count', value: { count: 806 } }] - }, { + }, + { label: 'my3', filterQuery: 'content.size:[333333 TO MAX]', metrics: [{ type: 'count', value: { count: 669 } }] - }, { + }, + { label: 'my2', filterQuery: 'content.size:[222222 TO MAX]', metrics: [{ type: 'count', value: { count: 691 } }] - }, { + }, + { label: 'my5', filterQuery: 'content.size:[5555 TO MAX]', metrics: [{ type: 'count', value: { count: 1866 } }] - }, { + }, + { label: 'my4', filterQuery: 'content.size:[444444 TO MAX]', metrics: [{ type: 'count', value: { count: 665 } }] - }, { + }, + { label: 'my7', filterQuery: 'content.size:[777777 TO MAX]', metrics: [{ type: 'count', value: { count: 641 } }] - }, { + }, + { label: 'SEARCH.FACET_QUERIES.SMALL', filterQuery: 'content.size:[10240 TO 102400]', metrics: [{ type: 'count', value: { count: 526 } }] - }, { + }, + { label: 'my6', filterQuery: 'content.size:[666666 TO MAX]', metrics: [{ type: 'count', value: { count: 652 } }] - }, { + }, + { label: 'SEARCH.FACET_QUERIES.XTRALARGE', filterQuery: 'content.size:[16777216 TO 134217728]', metrics: [{ type: 'count', value: { count: 617 } }] - }, { + }, + { label: 'my8', filterQuery: 'content.size:[888888 TO MAX]', metrics: [{ type: 'count', value: { count: 641 } }] - }, { + }, + { label: 'SEARCH.FACET_QUERIES.XXTRALARGE', filterQuery: 'content.size:[134217728 TO MAX]', metrics: [{ type: 'count', value: { count: 0 } }] - }, { + }, + { label: 'SEARCH.FACET_QUERIES.MEDIUM', filterQuery: 'content.size:[102400 TO 1048576]', metrics: [{ type: 'count', value: { count: 630 } }] - }, { + }, + { label: 'SEARCH.FACET_QUERIES.LARGE', filterQuery: 'content.size:[1048576 TO 16777216]', metrics: [{ type: 'count', value: { count: 23 } }] - }, { + }, + { label: 'Extra Small', filterQuery: 'content.size:[0 TO 10240]', metrics: [{ type: 'count', value: { count: 10239 } }] - }] - }, { + } + ] + }, + { type: 'query', label: 'SEARCH.FACET_QUERIES.MY_FACET_QUERIES', buckets: [ @@ -482,37 +494,45 @@ export const mockSearchResult = { label: 'SEARCH.FACET_QUERIES.CREATED_THIS_YEAR', filterQuery: 'created:2019', metrics: [{ type: 'count', value: { count: 0 } }] - }] + } + ] }, { type: 'field', label: 'SEARCH.FACET_FIELDS.SIZE', buckets: [] - }, { + }, + { type: 'field', label: 'SEARCH.FACET_FIELDS.CREATED', buckets: [] - }, { + }, + { type: 'field', label: 'SEARCH.FACET_FIELDS.TYPE', buckets: [] - }, { + }, + { type: 'field', label: 'SEARCH.FACET_FIELDS.MODIFIER', buckets: [] - }, { + }, + { type: 'field', label: 'SEARCH.FACET_FIELDS.CREATOR', buckets: [] - }, { + }, + { type: 'interval', label: 'TheModified', buckets: [] - }, { + }, + { type: 'interval', label: 'The Created', buckets: [] - }] + } + ] } } }; @@ -609,29 +629,23 @@ export const sizeOptions = [ } ]; -export const filteredResult = [ - 'my1 (806)', - 'my2 (691)', - 'my3 (669)', - 'my4 (665)', - 'my5 (1866)' -]; +export const filteredResult = ['my1 (806)', 'my2 (691)', 'my3 (669)', 'my4 (665)', 'my5 (1866)']; export const mockContentSizeResponseBucket = { - label: '5875', - filterQuery: 'content.size:5875', - metrics: [ - { - type: 'count', - value: { - count: 364 - } + label: '5875', + filterQuery: 'content.size:5875', + metrics: [ + { + type: 'count', + value: { + count: 364 } - ] - }; + } + ] +}; export const getMockSearchResultWithResponseBucket = () => { - const cloneResult = JSON.parse(JSON.stringify( mockSearchResult)); + const cloneResult = JSON.parse(JSON.stringify(mockSearchResult)); cloneResult.list.context.facets[3].buckets.push(mockContentSizeResponseBucket); return cloneResult; }; diff --git a/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts b/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts index ba80d18eab7..454f50b0d7d 100644 --- a/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts +++ b/lib/content-services/src/lib/new-version-uploader/new-version-uploader.service.ts @@ -42,7 +42,6 @@ export class NewVersionUploaderService { * - a side by side comparison between the current target node (type, name, icon) and the new file that should update it's version * - the new version's minor/major changes and the optional comment of a node and the ability to upload a new file version * - if data.showVersionsOnly is set to true, displays the version history of a node, with the ability to restore, delete and view version of the current node - * * @param data data to pass to MatDialog * @param config allow to override default MatDialogConfig * @param selectorAutoFocusedOnClose element's selector which should be autofocused after closing modal diff --git a/lib/content-services/src/lib/node-comments/mocks/node-comments.mock.ts b/lib/content-services/src/lib/node-comments/mocks/node-comments.mock.ts index 168258cd840..6a416f3cfbc 100644 --- a/lib/content-services/src/lib/node-comments/mocks/node-comments.mock.ts +++ b/lib/content-services/src/lib/node-comments/mocks/node-comments.mock.ts @@ -46,31 +46,33 @@ export const fakeContentComments = { skipCount: 0, maxItems: 100 }, - entries: [{ - entry: { - createdAt: '2018-03-27T10:55:45.725+0000', - createdBy: fakeUser1, - edited: false, - modifiedAt: '2018-03-27T10:55:45.725+0000', - canEdit: true, - modifiedBy: fakeUser1, - canDelete: true, - id: '35a0cea7-b6d0-4abc-9030-f4e461dd1ac7', - content: 'fake-message-1' + entries: [ + { + entry: { + createdAt: '2018-03-27T10:55:45.725+0000', + createdBy: fakeUser1, + edited: false, + modifiedAt: '2018-03-27T10:55:45.725+0000', + canEdit: true, + modifiedBy: fakeUser1, + canDelete: true, + id: '35a0cea7-b6d0-4abc-9030-f4e461dd1ac7', + content: 'fake-message-1' + } + }, + { + entry: { + createdAt: '2018-03-27T10:55:45.725+0000', + createdBy: fakeUser2, + edited: false, + modifiedAt: '2018-03-27T10:55:45.725+0000', + canEdit: true, + modifiedBy: fakeUser2, + canDelete: true, + id: '35a0cea7-b6d0-4abc-9030-f4e461dd1ac7', + content: 'fake-message-2' + } } - }, { - entry: { - createdAt: '2018-03-27T10:55:45.725+0000', - createdBy: fakeUser2, - edited: false, - modifiedAt: '2018-03-27T10:55:45.725+0000', - canEdit: true, - modifiedBy: fakeUser2, - canDelete: true, - id: '35a0cea7-b6d0-4abc-9030-f4e461dd1ac7', - content: 'fake-message-2' - } - } ] } }; @@ -146,62 +148,62 @@ export const getDateXMinutesAgo = (minutes: number) => new Date(new Date().getTi export const commentsNodeData: CommentModel[] = [ new CommentModel({ - id: 1, - message: `I've done this component, is it cool?`, - created: getDateXMinutesAgo(30), - createdBy: new User(johnDoe), - isSelected: false + id: 1, + message: `I've done this component, is it cool?`, + created: getDateXMinutesAgo(30), + createdBy: new User(johnDoe), + isSelected: false }), new CommentModel({ - id: 2, - message: 'Yeah', - created: getDateXMinutesAgo(15), - createdBy: new User(janeEod), - isSelected: false + id: 2, + message: 'Yeah', + created: getDateXMinutesAgo(15), + createdBy: new User(janeEod), + isSelected: false }), new CommentModel({ - id: 3, - message: '+1', - created: getDateXMinutesAgo(12), - createdBy: new User(robertSmith), - isSelected: false + id: 3, + message: '+1', + created: getDateXMinutesAgo(12), + createdBy: new User(robertSmith), + isSelected: false }), new CommentModel({ - id: 4, - message: 'ty', - created: new Date(), - createdBy: new User(johnDoe), - isSelected: false + id: 4, + message: 'ty', + created: new Date(), + createdBy: new User(johnDoe), + isSelected: false }) ]; export const commentsTaskData: CommentModel[] = [ new CommentModel({ - id: 1, - message: `I've done this task, what's next?`, - created: getDateXMinutesAgo(30), - createdBy: new User(johnDoe), - isSelected: false + id: 1, + message: `I've done this task, what's next?`, + created: getDateXMinutesAgo(30), + createdBy: new User(johnDoe), + isSelected: false }), new CommentModel({ - id: 2, - message: `I've assigned you another one 🤠`, - created: getDateXMinutesAgo(15), - createdBy: new User(janeEod), - isSelected: false + id: 2, + message: `I've assigned you another one 🤠`, + created: getDateXMinutesAgo(15), + createdBy: new User(janeEod), + isSelected: false }), new CommentModel({ - id: 3, - message: '+1', - created: getDateXMinutesAgo(12), - createdBy: new User(robertSmith), - isSelected: false + id: 3, + message: '+1', + created: getDateXMinutesAgo(12), + createdBy: new User(robertSmith), + isSelected: false }), new CommentModel({ - id: 4, - message: 'Cheers', - created: new Date(), - createdBy: new User(johnDoe), - isSelected: false + id: 4, + message: 'Cheers', + created: new Date(), + createdBy: new User(johnDoe), + isSelected: false }) ]; diff --git a/lib/content-services/src/lib/node-comments/services/node-comments.service.ts b/lib/content-services/src/lib/node-comments/services/node-comments.service.ts index f2c7ea956f3..3fc0eae4820 100644 --- a/lib/content-services/src/lib/node-comments/services/node-comments.service.ts +++ b/lib/content-services/src/lib/node-comments/services/node-comments.service.ts @@ -37,7 +37,6 @@ export class NodeCommentsService implements CommentsService { /** * Gets all comments that have been added to a task. - * * @param id ID of the target task * @returns Details for each comment */ @@ -57,7 +56,6 @@ export class NodeCommentsService implements CommentsService { /** * Adds a comment to a task. - * * @param id ID of the target task * @param message Text for the comment * @returns Details about the comment diff --git a/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.service.ts b/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.service.ts index 36b2a1e7f82..2f6764544aa 100644 --- a/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.service.ts +++ b/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.service.ts @@ -33,7 +33,7 @@ import { AllowableOperationsEnum } from '../../../common/models/allowable-operat const SITE_MANAGER_ROLE = 'SiteManager'; @Injectable({ - providedIn: 'root' + providedIn: 'root' }) export class PermissionListService { updated = new EventEmitter(); @@ -43,7 +43,7 @@ export class PermissionListService { error$: Subject = new Subject(); nodeWithRoles$: Subject<{ node: Node; roles: RoleModel[] }> = new Subject(); data$: Observable = this.nodeWithRoles$.pipe( - map(({ node, roles}) => { + map(({ node, roles }) => { const nodeLocalPermissions = this.nodePermissionService.getLocalPermissions(node); const localPermissions = this.updateReadOnlyPermission(node, nodeLocalPermissions); return { @@ -68,7 +68,8 @@ export class PermissionListService { fetchPermission(nodeId: string) { this.loading$.next(true); - this.nodePermissionService.getNodeWithRoles(nodeId) + this.nodePermissionService + .getNodeWithRoles(nodeId) .pipe(finalize(() => this.loading$.next(false))) .subscribe( ({ node, roles }) => { @@ -91,26 +92,24 @@ export class PermissionListService { const authorityId = this.getManagerAuthority(this.node); if (authorityId) { - const permissions = [ - ...(this.node.permissions.locallySet || []), - { authorityId, name: SITE_MANAGER_ROLE, accessStatus: 'ALLOWED' } - ]; + const permissions = [...(this.node.permissions.locallySet || []), { authorityId, name: SITE_MANAGER_ROLE, accessStatus: 'ALLOWED' }]; updateLocalPermission$ = this.nodePermissionService.updatePermissions(this.node, permissions); } - updateLocalPermission$.pipe(switchMap(() => this.nodeService.updateNode(this.node.id, nodeBody, {include: ['permissions']}))) - .subscribe( - (nodeUpdated: Node) => { - const message = nodeUpdated.permissions.isInheritanceEnabled ? 'PERMISSION_MANAGER.MESSAGE.INHERIT-ENABLE-SUCCESS' : 'PERMISSION_MANAGER.MESSAGE.INHERIT-DISABLE-SUCCESS'; - this.notificationService.showInfo(message); - nodeUpdated.permissions.inherited = nodeUpdated.permissions?.inherited ?? []; - this.reloadNode(nodeUpdated); - }, - () => { - change.source.checked = this.node.permissions.isInheritanceEnabled; - this.notificationService.showWarning('PERMISSION_MANAGER.MESSAGE.TOGGLE-PERMISSION-FAILED'); - } - ); + updateLocalPermission$.pipe(switchMap(() => this.nodeService.updateNode(this.node.id, nodeBody, { include: ['permissions'] }))).subscribe( + (nodeUpdated: Node) => { + const message = nodeUpdated.permissions.isInheritanceEnabled + ? 'PERMISSION_MANAGER.MESSAGE.INHERIT-ENABLE-SUCCESS' + : 'PERMISSION_MANAGER.MESSAGE.INHERIT-DISABLE-SUCCESS'; + this.notificationService.showInfo(message); + nodeUpdated.permissions.inherited = nodeUpdated.permissions?.inherited ?? []; + this.reloadNode(nodeUpdated); + }, + () => { + change.source.checked = this.node.permissions.isInheritanceEnabled; + this.notificationService.showWarning('PERMISSION_MANAGER.MESSAGE.TOGGLE-PERMISSION-FAILED'); + } + ); } else { change.source.checked = this.node.permissions.isInheritanceEnabled; this.notificationService.showError('PERMISSION_MANAGER.ERROR.NOT-ALLOWED'); @@ -121,9 +120,9 @@ export class PermissionListService { this.nodePermissionDialogService .openAddPermissionDialog(this.node, this.roles, 'PERMISSION_MANAGER.ADD-PERMISSION.TITLE') .pipe( - switchMap(selection => { + switchMap((selection) => { const total = selection.length; - const group = selection.filter(({authorityId}) => this.isGroup(authorityId)).length; + const group = selection.filter(({ authorityId }) => this.isGroup(authorityId)).length; return forkJoin({ user: of(total - group), group: of(group), @@ -131,86 +130,86 @@ export class PermissionListService { }); }) ) - .subscribe(({ user, group, node}) => { - this.notificationService.showInfo( 'PERMISSION_MANAGER.MESSAGE.PERMISSION-ADD-SUCCESS', null, { user, group }); + .subscribe( + ({ user, group, node }) => { + this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-ADD-SUCCESS', null, { user, group }); this.reloadNode(node); }, () => { - this.notificationService.showError( 'PERMISSION_MANAGER.MESSAGE.PERMISSION-ADD-FAIL'); + this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-ADD-FAIL'); this.reloadNode(); } ); } deletePermissions(permissions: PermissionElement[]) { - this.nodePermissionService.removePermissions(this.node, permissions) - .subscribe((node) => { - const total = permissions.length; - const group = permissions.filter(({authorityId}) => this.isGroup(authorityId)).length; - this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-BULK-DELETE-SUCCESS', null, {user: total - group, group}); - this.reloadNode(node); - }, - () => { - this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-DELETE-FAIL'); - this.reloadNode(); - } - ); + this.nodePermissionService.removePermissions(this.node, permissions).subscribe( + (node) => { + const total = permissions.length; + const group = permissions.filter(({ authorityId }) => this.isGroup(authorityId)).length; + this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-BULK-DELETE-SUCCESS', null, { user: total - group, group }); + this.reloadNode(node); + }, + () => { + this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-DELETE-FAIL'); + this.reloadNode(); + } + ); } updateRole(role: string, permission: PermissionDisplayModel) { const updatedPermissionRole = this.buildUpdatedPermission(role, permission); - this.nodePermissionService.updatePermissionRole(this.node, updatedPermissionRole) - .subscribe((node) => { + this.nodePermissionService.updatePermissionRole(this.node, updatedPermissionRole).subscribe( + (node) => { this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-UPDATE-SUCCESS'); this.reloadNode(node); this.updated.emit(permission); - }, - () => { - this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-UPDATE-FAIL'); - this.reloadNode(); - this.errored.emit(permission); - } - ); + }, + () => { + this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-UPDATE-FAIL'); + this.reloadNode(); + this.errored.emit(permission); + } + ); } bulkRoleUpdate(role: string) { const permissions = [...this.node.permissions.locallySet].map((permission) => this.buildUpdatedPermission(role, permission)); - this.nodePermissionService.updatePermissions(this.node, permissions) - .subscribe((node) => { - const total = permissions.length; - const group = permissions.filter(({authorityId}) => this.isGroup(authorityId)).length; - this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-BULK-UPDATE-SUCCESS', null, {user: total - group, group}); - this.reloadNode(node); - }, - () => { - this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-UPDATE-FAIL'); - this.reloadNode(); - } - ); + this.nodePermissionService.updatePermissions(this.node, permissions).subscribe( + (node) => { + const total = permissions.length; + const group = permissions.filter(({ authorityId }) => this.isGroup(authorityId)).length; + this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-BULK-UPDATE-SUCCESS', null, { user: total - group, group }); + this.reloadNode(node); + }, + () => { + this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-UPDATE-FAIL'); + this.reloadNode(); + } + ); } deletePermission(permission: PermissionDisplayModel) { - const cloneNode = { ...this.node, permissions: { ...this.node.permissions, locallySet: [ ...this.node.permissions.locallySet ] } }; - this.nodePermissionService - .removePermission(cloneNode, permission) - .subscribe((node) => { - this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-DELETE-SUCCESS'); - if (!node.permissions.locallySet) { - node.permissions.locallySet = []; - } - this.reloadNode(node); - }, - () => { - this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-DELETE-FAIL'); - this.reloadNode(); + const cloneNode = { ...this.node, permissions: { ...this.node.permissions, locallySet: [...this.node.permissions.locallySet] } }; + this.nodePermissionService.removePermission(cloneNode, permission).subscribe( + (node) => { + this.notificationService.showInfo('PERMISSION_MANAGER.MESSAGE.PERMISSION-DELETE-SUCCESS'); + if (!node.permissions.locallySet) { + node.permissions.locallySet = []; } - ); + this.reloadNode(node); + }, + () => { + this.notificationService.showError('PERMISSION_MANAGER.MESSAGE.PERMISSION-DELETE-FAIL'); + this.reloadNode(); + } + ); } private buildUpdatedPermission(role: string, permission: PermissionElement): PermissionElement { return { accessStatus: permission.accessStatus, - name: this.canUpdateThePermission(this.node, permission) ? role : permission.name, + name: this.canUpdateThePermission(this.node, permission) ? role : permission.name, authorityId: permission.authorityId }; } @@ -228,7 +227,9 @@ export class PermissionListService { let authorityId: string; if (sitePath) { authorityId = `GROUP_site_${sitePath.name}_${SITE_MANAGER_ROLE}`; - hasLocalManagerPermission = !!node.permissions.locallySet?.find((permission) => permission.authorityId === authorityId && permission.name === SITE_MANAGER_ROLE); + hasLocalManagerPermission = !!node.permissions.locallySet?.find( + (permission) => permission.authorityId === authorityId && permission.name === SITE_MANAGER_ROLE + ); } if (!hasLocalManagerPermission && authorityId) { @@ -249,8 +250,8 @@ export class PermissionListService { canUpdateThePermission(node: Node, permission: PermissionElement): boolean { const sitePath = node.path.elements.find((path) => path.nodeType === 'st:site'); if (!node.permissions.isInheritanceEnabled && sitePath) { - const authorityId = `GROUP_site_${sitePath.name}_${SITE_MANAGER_ROLE}`; - return !(permission.authorityId === authorityId && permission.name === SITE_MANAGER_ROLE); + const authorityId = `GROUP_site_${sitePath.name}_${SITE_MANAGER_ROLE}`; + return !(permission.authorityId === authorityId && permission.name === SITE_MANAGER_ROLE); } return true; } diff --git a/lib/content-services/src/lib/permission-manager/services/node-permission-dialog.service.ts b/lib/content-services/src/lib/permission-manager/services/node-permission-dialog.service.ts index f489fd82a16..f1d2c2e074e 100644 --- a/lib/content-services/src/lib/permission-manager/services/node-permission-dialog.service.ts +++ b/lib/content-services/src/lib/permission-manager/services/node-permission-dialog.service.ts @@ -31,15 +31,10 @@ import { AllowableOperationsEnum } from '../../common/models/allowable-operation providedIn: 'root' }) export class NodePermissionDialogService { - - constructor(private dialog: MatDialog, - private nodePermissionService: NodePermissionService, - private contentService: ContentService) { - } + constructor(private dialog: MatDialog, private nodePermissionService: NodePermissionService, private contentService: ContentService) {} /** * Opens a dialog to add permissions to a node. - * * @param node target node * @param roles settable roles for the node * @param title Dialog title @@ -82,18 +77,19 @@ export class NodePermissionDialogService { /** * Opens a dialog to update permissions for a node. - * * @param nodeId ID of the target node * @param title Dialog title * @returns Node with updated permissions */ updateNodePermissionByDialog(nodeId?: string, title?: string): Observable { - return this.nodePermissionService.getNodeWithRoles(nodeId) + return this.nodePermissionService + .getNodeWithRoles(nodeId) .pipe( - switchMap(({node, roles}) => this.openAddPermissionDialog(node, roles, title) - .pipe( + switchMap(({ node, roles }) => + this.openAddPermissionDialog(node, roles, title).pipe( switchMap((selection) => this.nodePermissionService.updateNodePermissions(nodeId, selection)) - )) + ) + ) ); } } diff --git a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts index 4cf316bfa10..1e27a89fd99 100644 --- a/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts +++ b/lib/content-services/src/lib/permission-manager/services/node-permission.service.ts @@ -46,7 +46,6 @@ export class NodePermissionService { /** * Gets a list of roles for the current node. - * * @param node The target node * @returns Array of strings representing the roles */ @@ -66,7 +65,6 @@ export class NodePermissionService { /** * Get permissions for a given node - * * @param node Node to check permissions for * @returns list of permission models */ @@ -91,7 +89,6 @@ export class NodePermissionService { /** * Updates the permission role for a node. - * * @param node Target node * @param updatedPermissionRole Permission role to update or add * @returns Node with updated permission @@ -110,7 +107,6 @@ export class NodePermissionService { /** * Update permissions for a node. - * * @param nodeId ID of the target node * @param permissionList New permission settings * @returns Node with updated permissions @@ -121,7 +117,6 @@ export class NodePermissionService { /** * Updates the locally set permissions for a node. - * * @param node ID of the target node * @param permissions Permission settings * @returns Node with updated permissions @@ -164,7 +159,6 @@ export class NodePermissionService { /** * Removes a permission setting from a node. - * * @param node ID of the target node * @param permissionToRemove Permission setting to remove * @returns Node with modified permissions @@ -197,7 +191,6 @@ export class NodePermissionService { /** * Gets all members related to a group name. - * * @param groupName Name of group to look for members * @param opts Extra options supported by JS-API * @returns List of members @@ -258,7 +251,6 @@ export class NodePermissionService { /** * Removes permissions setting from a node. - * * @param node target node with permission * @param permissions Permissions to remove * @returns Node with modified permissions @@ -278,7 +270,6 @@ export class NodePermissionService { /** * updates permissions setting from a node. - * * @param node target node with permission * @param permissions Permissions to update * @returns Node with modified permissions @@ -291,7 +282,6 @@ export class NodePermissionService { /** * Gets all node detail for nodeId along with settable permissions. - * * @param nodeId Id of the node * @returns node and it's associated roles { node: Node; roles: RoleModel[] } */ diff --git a/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.spec.ts b/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.spec.ts index aae3f6db0cb..1f6335bb15d 100644 --- a/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.spec.ts +++ b/lib/content-services/src/lib/pipes/node-name-tooltip.pipe.spec.ts @@ -19,7 +19,6 @@ import { NodeEntry } from '@alfresco/js-api'; import { NodeNameTooltipPipe } from './node-name-tooltip.pipe'; describe('NodeNameTooltipPipe', () => { - const nodeName = 'node-name'; const nodeTitle = 'node-title'; const nodeDescription = 'node-description'; diff --git a/lib/content-services/src/lib/prediction/services/prediction.service.ts b/lib/content-services/src/lib/prediction/services/prediction.service.ts index e0011d78b28..bc1e8323fec 100644 --- a/lib/content-services/src/lib/prediction/services/prediction.service.ts +++ b/lib/content-services/src/lib/prediction/services/prediction.service.ts @@ -33,7 +33,6 @@ export class PredictionService { /** * Get predictions for a given node - * * @param nodeId The identifier of node. * @returns Observable */ @@ -43,7 +42,6 @@ export class PredictionService { /** * Review a prediction - * * @param predictionId The identifier of prediction. * @param reviewStatus Review status to apply. * @returns Observable diff --git a/lib/content-services/src/lib/search-ai/services/search-ai.service.ts b/lib/content-services/src/lib/search-ai/services/search-ai.service.ts index d301253ad37..70d4841bb1b 100644 --- a/lib/content-services/src/lib/search-ai/services/search-ai.service.ts +++ b/lib/content-services/src/lib/search-ai/services/search-ai.service.ts @@ -39,14 +39,10 @@ export class SearchAiService { toggleSearchAiInput$ = this.toggleSearchAiInput.asObservable(); - constructor( - private apiService: AlfrescoApiService, - private translateService: TranslateService - ) {} + constructor(private apiService: AlfrescoApiService, private translateService: TranslateService) {} /** * Update the state of the search AI input. - * * @param state The new state of the search AI input. */ updateSearchAiInputState(state: SearchAiInputState): void { @@ -55,7 +51,6 @@ export class SearchAiService { /** * Ask a question to the AI. - * * @param question The question to ask. * @returns QuestionModel object containing information about questions. */ @@ -65,7 +60,6 @@ export class SearchAiService { /** * Get an answer to specific question. - * * @param questionId The ID of the question to get an answer for. * @returns AiAnswerEntry object containing the answer. */ @@ -75,7 +69,6 @@ export class SearchAiService { /** * Get the knowledge retrieval configuration. - * * @returns KnowledgeRetrievalConfigEntry object containing the configuration. */ getConfig(): Observable { @@ -84,7 +77,6 @@ export class SearchAiService { /** * Check if using of search is possible (if all conditions are met). - * * @param selectedNodesState information about selected nodes. * @param maxSelectedNodes max number of selected nodes. Default 100. * @returns string with error if any condition is not met, empty string otherwise. diff --git a/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.spec.ts b/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.spec.ts index 32fedacd276..d5fae4994aa 100644 --- a/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.spec.ts +++ b/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.spec.ts @@ -49,7 +49,6 @@ describe('SearchChipAutocompleteInputComponent', () => { /** * Get the input element - * * @returns native element */ function getInput(): HTMLInputElement { @@ -58,7 +57,6 @@ describe('SearchChipAutocompleteInputComponent', () => { /** * Enter the new input value - * * @param value value to input */ function enterNewInputValue(value: string) { @@ -71,7 +69,6 @@ describe('SearchChipAutocompleteInputComponent', () => { /** * Add new option - * * @param value value to input */ function addNewOption(value: string) { @@ -84,7 +81,6 @@ describe('SearchChipAutocompleteInputComponent', () => { /** * Get material chip list - * * @returns list of chips */ async function getChipList(): Promise { @@ -94,7 +90,6 @@ describe('SearchChipAutocompleteInputComponent', () => { /** * Get chip value by specific index - * * @param index index of the chip * @returns chip value */ @@ -105,7 +100,6 @@ describe('SearchChipAutocompleteInputComponent', () => { /** * Get material option elements - * * @returns list of debug elements */ async function getOptionElements(): Promise { @@ -115,7 +109,6 @@ describe('SearchChipAutocompleteInputComponent', () => { /** * Get added options for auto-complete - * * @returns list of debug elements */ function getAddedOptionElements(): DebugElement[] { diff --git a/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.ts b/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.ts index 2a3f3a24ed4..03b02555b79 100644 --- a/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.ts +++ b/lib/content-services/src/lib/search/components/search-chip-autocomplete-input/search-chip-autocomplete-input.component.ts @@ -169,7 +169,6 @@ export class SearchChipAutocompleteInputComponent implements OnInit, OnDestroy, * This method checks if the provided `option` is present in the `selectedOptions` array. * If a custom comparison function (`compareOption`) is provided, it uses this function to determine equality. * Otherwise, it falls back to using strict equality comparison. - * * @param option - The option to check for selection. * @returns `true` if the option is selected, `false` otherwise. */ diff --git a/lib/content-services/src/lib/search/components/search-filter-autocomplete-chips/search-filter-autocomplete-chips.component.spec.ts b/lib/content-services/src/lib/search/components/search-filter-autocomplete-chips/search-filter-autocomplete-chips.component.spec.ts index 76cbf324d87..9b1ce6c3ee0 100644 --- a/lib/content-services/src/lib/search/components/search-filter-autocomplete-chips/search-filter-autocomplete-chips.component.spec.ts +++ b/lib/content-services/src/lib/search/components/search-filter-autocomplete-chips/search-filter-autocomplete-chips.component.spec.ts @@ -63,7 +63,6 @@ describe('SearchFilterAutocompleteChipsComponent', () => { /** * Add new auto-complete input - * * @param value value to add */ function addNewOption(value: string) { diff --git a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-chip-tabbed.component.spec.ts b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-chip-tabbed.component.spec.ts index 2563f8ff127..b688fcde414 100644 --- a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-chip-tabbed.component.spec.ts +++ b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-chip-tabbed.component.spec.ts @@ -57,7 +57,6 @@ describe('SearchFacetChipTabbedComponent', () => { /** * Get the filter display value - * * @returns filter value */ function getDisplayValue(): string { @@ -66,7 +65,6 @@ describe('SearchFacetChipTabbedComponent', () => { /** * Emit the event for the tabbed content - * * @param eventName event name to trigger * @param event event to trigger */ diff --git a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.spec.ts b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.spec.ts index 0997cd86f26..5622d13fb2b 100644 --- a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.spec.ts +++ b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.spec.ts @@ -64,7 +64,6 @@ describe('SearchFacetTabbedContentComponent', () => { /** * Get the tab label content - * * @returns list of native elements */ async function getTabs(): Promise { @@ -85,7 +84,6 @@ describe('SearchFacetTabbedContentComponent', () => { /** * Add new item to the bucket - * * @param field field name * @param displayValue value to display */ diff --git a/lib/content-services/src/lib/search/components/search-input/search-input.component.spec.ts b/lib/content-services/src/lib/search/components/search-input/search-input.component.spec.ts index d5c6c2d72df..3c1bc080a1c 100644 --- a/lib/content-services/src/lib/search/components/search-input/search-input.component.spec.ts +++ b/lib/content-services/src/lib/search/components/search-input/search-input.component.spec.ts @@ -31,7 +31,6 @@ describe('SearchInputComponent', () => { /** * Sets the search input value - * * @param value the value to set */ async function setInputValue(value: string) { diff --git a/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.spec.ts b/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.spec.ts index 9c03587f9c7..2243e486d88 100644 --- a/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.spec.ts +++ b/lib/content-services/src/lib/search/components/search-logical-filter/search-logical-filter.component.spec.ts @@ -47,7 +47,6 @@ describe('SearchLogicalFilterComponent', () => { /** * Get search input elements - * * @returns list of native elements */ function getInputs(): HTMLInputElement[] { @@ -56,7 +55,6 @@ describe('SearchLogicalFilterComponent', () => { /** * Get input label elements - * * @returns list of labels */ function getInputsLabels(): string[] { @@ -65,7 +63,6 @@ describe('SearchLogicalFilterComponent', () => { /** * Enters a new phrase - * * @param value new value * @param index value index */ diff --git a/lib/content-services/src/lib/search/components/search-text/search-text.component.ts b/lib/content-services/src/lib/search/components/search-text/search-text.component.ts index e12aeed9a11..01a5b64e00a 100644 --- a/lib/content-services/src/lib/search/components/search-text/search-text.component.ts +++ b/lib/content-services/src/lib/search/components/search-text/search-text.component.ts @@ -54,7 +54,7 @@ export class SearchTextComponent implements SearchWidget, OnInit, OnDestroy { private readonly destroy$ = new Subject(); ngOnInit() { - if (this.context && this.settings && this.settings.pattern) { + if (this.context && this.settings?.pattern) { const pattern = new RegExp(this.settings.pattern, 'g'); const match = pattern.exec(this.context.queryFragments[this.id] || ''); if (this.settings.allowUpdateOnChange !== undefined && this.settings.allowUpdateOnChange !== null) { diff --git a/lib/content-services/src/lib/search/forms/search-term-validator.ts b/lib/content-services/src/lib/search/forms/search-term-validator.ts index b55ffe2ff51..1cae04de9af 100644 --- a/lib/content-services/src/lib/search/forms/search-term-validator.ts +++ b/lib/content-services/src/lib/search/forms/search-term-validator.ts @@ -18,11 +18,12 @@ import { UntypedFormControl } from '@angular/forms'; export class SearchTermValidator { - static minAlphanumericChars(minChars: number) { - return (control: UntypedFormControl) => ('' + control.value).replace(/[^0-9a-zA-Z]+/g, '').length >= minChars ? null : { - hasMinAlphanumericChars: false - }; + return (control: UntypedFormControl) => + ('' + control.value).replace(/[^0-9a-zA-Z]+/g, '').length >= minChars + ? null + : { + hasMinAlphanumericChars: false + }; } - } diff --git a/lib/content-services/src/lib/search/models/search-filter-list.model.spec.ts b/lib/content-services/src/lib/search/models/search-filter-list.model.spec.ts index 5601f8e199b..cfdd518dc14 100644 --- a/lib/content-services/src/lib/search/models/search-filter-list.model.spec.ts +++ b/lib/content-services/src/lib/search/models/search-filter-list.model.spec.ts @@ -26,14 +26,13 @@ export class Payload { } describe('SearchFilterList', () => { - - const generateItems = (count: number): Payload[] => Array(count).fill(null).map((_, id) => new Payload(id)); + const generateItems = (count: number): Payload[] => + Array(count) + .fill(null) + .map((_, id) => new Payload(id)); it('should init with external items', () => { - const items = [ - new Payload(1), - new Payload(2) - ]; + const items = [new Payload(1), new Payload(2)]; const list = new SearchFilterList(items); expect(list.length).toBe(2); diff --git a/lib/content-services/src/lib/search/models/search-filter-list.model.ts b/lib/content-services/src/lib/search/models/search-filter-list.model.ts index 43ad5d04d43..977a9bfe125 100644 --- a/lib/content-services/src/lib/search/models/search-filter-list.model.ts +++ b/lib/content-services/src/lib/search/models/search-filter-list.model.ts @@ -18,7 +18,6 @@ const DEFAULT_PAGE_SIZE = 5; export class SearchFilterList implements Iterable { - private filteredItems: T[] = []; private _filterText: string = ''; @@ -41,7 +40,7 @@ export class SearchFilterList implements Iterable { return this._filter; } - set filter(value: (item: T) => boolean ) { + set filter(value: (item: T) => boolean) { this._filter = value; this.applyFilter(); } @@ -57,7 +56,6 @@ export class SearchFilterList implements Iterable { /** * Returns visible portion of the items. - * * @returns list of items */ get visibleItems(): T[] { @@ -66,7 +64,6 @@ export class SearchFilterList implements Iterable { /** * Get items length - * * @returns entire collection length including items not displayed on the page */ get length(): number { @@ -75,7 +72,6 @@ export class SearchFilterList implements Iterable { /** * Detect whether more items can be displayed. - * * @returns `true` if can show more items, otherwise `false` */ get canShowMoreItems(): boolean { @@ -84,7 +80,6 @@ export class SearchFilterList implements Iterable { /** * Detect whether less items can be displayed. - * * @returns `true` if can show less items, otherwise `false` */ get canShowLessItems(): boolean { @@ -93,7 +88,6 @@ export class SearchFilterList implements Iterable { /** * Detect whether content fits single page. - * * @returns `true` if content fits single page, otherwise `false`. */ get fitsPage(): boolean { diff --git a/lib/content-services/src/lib/search/services/search-configuration.service.ts b/lib/content-services/src/lib/search/services/search-configuration.service.ts index 8fb408e65a1..cc471e0fdcd 100644 --- a/lib/content-services/src/lib/search/services/search-configuration.service.ts +++ b/lib/content-services/src/lib/search/services/search-configuration.service.ts @@ -25,7 +25,6 @@ import { SearchConfigurationInterface } from '../../common/interfaces/search-con export class SearchConfigurationService implements SearchConfigurationInterface { /** * Generates a request object with custom search parameters. - * * @param searchTerm Term text to search for * @param maxResults Maximum number of search results to show in a page * @param skipCount The offset of the start of the page within the results list diff --git a/lib/content-services/src/lib/search/services/search-filter.service.ts b/lib/content-services/src/lib/search/services/search-filter.service.ts index f106c3635a7..9ed3498f68b 100644 --- a/lib/content-services/src/lib/search/services/search-filter.service.ts +++ b/lib/content-services/src/lib/search/services/search-filter.service.ts @@ -31,7 +31,6 @@ import { SearchDateRangeTabbedComponent } from '../components/search-date-range- providedIn: 'root' }) export class SearchFilterService { - /** * Contains string-to-type mappings for registered widgets. */ @@ -47,5 +46,4 @@ export class SearchFilterService { 'autocomplete-chips': SearchFilterAutocompleteChipsComponent, 'date-range': SearchDateRangeTabbedComponent }; - } diff --git a/lib/content-services/src/lib/search/services/search-header-query-builder.service.spec.ts b/lib/content-services/src/lib/search/services/search-header-query-builder.service.spec.ts index 72ab7f3d5e9..72ad3ac1e20 100644 --- a/lib/content-services/src/lib/search/services/search-header-query-builder.service.spec.ts +++ b/lib/content-services/src/lib/search/services/search-header-query-builder.service.spec.ts @@ -35,22 +35,14 @@ describe('SearchHeaderQueryBuilderService', () => { return config; }; - const createQueryBuilder = (searchSettings): SearchHeaderQueryBuilderService => { - let builder: SearchHeaderQueryBuilderService; - TestBed.runInInjectionContext(() => { - const alfrescoApiService = TestBed.inject(AlfrescoApiService); - builder = new SearchHeaderQueryBuilderService(buildConfig(searchSettings), alfrescoApiService, null); - }); - return builder; - }; - it('should load the configuration from app config', () => { const config: SearchConfiguration = { categories: [{ id: 'cat1', enabled: true } as any, { id: 'cat2', enabled: true } as any], filterQueries: [{ query: 'query1' }, { query: 'query2' }] }; - const builder = createQueryBuilder(config); + const alfrescoApiService = TestBed.inject(AlfrescoApiService); + const builder = new SearchHeaderQueryBuilderService(buildConfig(config), alfrescoApiService, null); builder.categories = []; builder.filterQueries = []; @@ -73,7 +65,8 @@ describe('SearchHeaderQueryBuilderService', () => { filterQueries: [{ query: 'query1' }, { query: 'query2' }] }; - const service = createQueryBuilder(config); + const alfrescoApiService = TestBed.inject(AlfrescoApiService); + const service = new SearchHeaderQueryBuilderService(buildConfig(config), alfrescoApiService, null); const category = service.getCategoryForColumn('fake-key-1'); expect(category).not.toBeNull(); @@ -82,7 +75,8 @@ describe('SearchHeaderQueryBuilderService', () => { }); it('should have empty user query by default', () => { - const builder = createQueryBuilder({}); + const alfrescoApiService = TestBed.inject(AlfrescoApiService); + const builder = new SearchHeaderQueryBuilderService(buildConfig({}), alfrescoApiService, null); expect(builder.userQuery).toBe(''); }); @@ -94,7 +88,8 @@ describe('SearchHeaderQueryBuilderService', () => { const expectedResult = [{ query: 'PARENT:"workspace://SpacesStore/fake-node-id"' }]; - const searchHeaderService = createQueryBuilder(config); + const alfrescoApiService = TestBed.inject(AlfrescoApiService); + const searchHeaderService = new SearchHeaderQueryBuilderService(buildConfig(config), alfrescoApiService, null); searchHeaderService.setCurrentRootFolderId('fake-node-id'); @@ -109,7 +104,9 @@ describe('SearchHeaderQueryBuilderService', () => { filterQueries: expectedResult }; - const searchHeaderService = createQueryBuilder(config); + const alfrescoApiService = TestBed.inject(AlfrescoApiService); + const searchHeaderService = new SearchHeaderQueryBuilderService(buildConfig(config), alfrescoApiService, null); + searchHeaderService.setCurrentRootFolderId('fake-node-id'); expect(searchHeaderService.filterQueries).toEqual(expectedResult, 'Filters are not as expected'); @@ -123,7 +120,8 @@ describe('SearchHeaderQueryBuilderService', () => { filterQueries: [{ query: 'PARENT:"workspace://SpacesStore/fake-node-id' }] }; - const searchHeaderService = createQueryBuilder(config); + const alfrescoApiService = TestBed.inject(AlfrescoApiService); + const searchHeaderService = new SearchHeaderQueryBuilderService(buildConfig(config), alfrescoApiService, null); expect(searchHeaderService.activeFilters.length).toBe(0); diff --git a/lib/content-services/src/lib/search/services/search.service.ts b/lib/content-services/src/lib/search/services/search.service.ts index bef7eb0faad..641e02626c0 100644 --- a/lib/content-services/src/lib/search/services/search.service.ts +++ b/lib/content-services/src/lib/search/services/search.service.ts @@ -44,7 +44,6 @@ export class SearchService { /** * Gets a list of nodes that match the given search criteria. - * * @param term Term to search for * @param options Options for delivery of the search results * @returns List of nodes resulting from the search @@ -61,7 +60,6 @@ export class SearchService { /** * Performs a search. - * * @param searchTerm Term to search for * @param maxResults Maximum number of items in the list of results * @param skipCount Number of higher-ranked items to skip over in the list @@ -80,7 +78,6 @@ export class SearchService { /** * Performs a search with its parameters supplied by a request object. - * * @param queryBody Object containing the search parameters * @returns List of search results */ diff --git a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts index deaf4d6419a..ddac7f58715 100644 --- a/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts +++ b/lib/content-services/src/lib/security/services/security-controls-groups-marks-security.service.ts @@ -79,7 +79,6 @@ export class SecurityControlsService { /** * Get All security groups - * * @param skipCount The number of entities that exist in the collection before those included in this list. * @param maxItems The maximum number of items to return in the list. Default is specified by UserPreferencesService. * @param include Additional information about the security group @@ -113,7 +112,6 @@ export class SecurityControlsService { /** * Create security group - * * @param input securityGroupBody. * @returns Observable */ @@ -132,7 +130,6 @@ export class SecurityControlsService { /** * Create security marks - * * @param securityGroupId The key for the security group id. * @param input securityMarkBody[]. * @returns Promise @@ -156,7 +153,6 @@ export class SecurityControlsService { /** * Get security mark value * Gets the value for a selected **securityGroupId**. - * * @param securityGroupId The key for the security group id. * @param skipCount The number of entities that exist in the collection before those included in this list. * @returns Promise @@ -183,7 +179,6 @@ export class SecurityControlsService { /** * Update a security groups information - * * @param securityGroupId The Key of Security Group id for which info is required * @param input SecurityGroupBody * @param opts additional information about the security group @@ -215,7 +210,6 @@ export class SecurityControlsService { /** * Updates Security Mark value - * * @param securityGroupId The key for the security group id. * @param securityMarkId The key for the security mark is in use or not. * @param input securityMarkBody. @@ -242,7 +236,6 @@ export class SecurityControlsService { /** * Delete security group - * * @param securityGroupId The key for the security group id. * @returns Observable */ @@ -255,7 +248,6 @@ export class SecurityControlsService { /** * Delete security mark - * * @param securityGroupId The key for the security group id. * @param securityMarkId The key for the security mark id. * @returns Promise @@ -278,7 +270,6 @@ export class SecurityControlsService { /** * Get the authority clearances for a single user/group - * * @param authorityName The name for the authority for which the clearance is to be fetched. Can be left blank in which case it will fetch it for all users with pagination * @param skipCount The number of entities that exist in the collection before those included in this list. * @param maxItems The maximum number of items to return in the list. Default is specified by UserPreferencesService. @@ -301,7 +292,6 @@ export class SecurityControlsService { /** * Updates the authority clearance. - * * @param authorityName The name for the authority for which the clearance is to be updated * @param securityMarksList NodeSecurityMarkBody[] * @returns Observable diff --git a/lib/content-services/src/lib/tag/services/tag.service.ts b/lib/content-services/src/lib/tag/services/tag.service.ts index 7216dc9cf3f..450bd71b877 100644 --- a/lib/content-services/src/lib/tag/services/tag.service.ts +++ b/lib/content-services/src/lib/tag/services/tag.service.ts @@ -44,7 +44,6 @@ export class TagService { /** * Gets a list of tags added to a node. - * * @param nodeId ID of the target node * @returns TagPaging object (defined in JS-API) containing the tags */ @@ -54,7 +53,6 @@ export class TagService { /** * Gets a list of all the tags already defined in the repository. - * * @param opts Options supported by JS-API * @param includedCounts True if count field should be included in response object for each tag, false otherwise. * @returns TagPaging object (defined in JS-API) containing the tags @@ -70,7 +68,6 @@ export class TagService { /** * Adds a tag to a node. - * * @param nodeId ID of the target node * @param tagName Name of the tag to add * @returns TagEntry object (defined in JS-API) with details of the new tag @@ -84,7 +81,6 @@ export class TagService { /** * Removes a tag from a node. - * * @param nodeId ID of the target node * @param tag Name of the tag to remove * @returns Null object when the operation completes @@ -95,7 +91,6 @@ export class TagService { /** * Creates tags. - * * @param tags list of tags to create. * @returns Created tags. */ @@ -105,7 +100,6 @@ export class TagService { /** * Update a tag - * * @param tagId The identifier of a tag. * @param tagBody The updated tag. * @returns Updated tag. @@ -116,7 +110,6 @@ export class TagService { /** * Find tags which name contains searched name. - * * @param name Value for name which should be used during searching tags. * @param sorting Object which configures sorting. OrderBy field specifies field used for sorting, direction specified ascending or descending direction. * Default sorting is ascending by tag field. @@ -147,7 +140,6 @@ export class TagService { /** * Find tag which name matches exactly to passed name. - * * @param name Value for name which should be used during finding exact tag. * @returns Found tag which name matches exactly to passed name. */ @@ -159,7 +151,6 @@ export class TagService { * Deletes a tag with tagId. * This will cause the tag to be removed from all nodes. * You must have admin rights to delete a tag. - * * @param tagId of the tag to be deleted * @returns Null object when the operation completes */ @@ -169,7 +160,6 @@ export class TagService { /** * Assign tags to node. If tag is new then tag is also created additionally, if tag already exists then it is just assigned. - * * @param nodeId Id of node to which tags should be assigned. * @param tags List of tags to create and assign or just assign if they already exist. * @returns Just linked tags to node or single tag if linked only one tag. @@ -180,7 +170,6 @@ export class TagService { /** * Checks if tags plugin is enabled. - * * @returns boolean true if tags plugin is enabled, false otherwise. */ areTagsEnabled(): boolean { diff --git a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts index 1cb0da42d08..4ee7c402d30 100644 --- a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts +++ b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.spec.ts @@ -72,7 +72,6 @@ describe('TagsCreatorComponent', () => { /** * Get name input element - * * @returns native element */ function getNameInput(): HTMLInputElement { @@ -81,7 +80,6 @@ describe('TagsCreatorComponent', () => { /** * Get the create tag label - * * @returns native element */ function getCreateTagLabel(): HTMLSpanElement { @@ -90,7 +88,6 @@ describe('TagsCreatorComponent', () => { /** * Get remove tag buttons - * * @returns list of native elements */ function getRemoveTagButtons(): HTMLButtonElement[] { @@ -100,7 +97,6 @@ describe('TagsCreatorComponent', () => { /** * Get newly added tags - * * @returns list of tags */ async function getAddedTags(): Promise { @@ -114,7 +110,6 @@ describe('TagsCreatorComponent', () => { /** * Adds tag to the added list - * * @param tagName tag name * @param addUsingEnter use Enter when adding * @param typingTimeout typing timeout in milliseconds (default 300) @@ -134,7 +129,6 @@ describe('TagsCreatorComponent', () => { /** * type a new tag - * * @param tagName tag name * @param timeout typing timeout in milliseconds (default 300) */ @@ -152,7 +146,6 @@ describe('TagsCreatorComponent', () => { /** * Get the existing tags label - * * @returns label */ function getExistingTagsLabel(): string { @@ -313,7 +306,6 @@ describe('TagsCreatorComponent', () => { describe('Errors', () => { /** * Get first error - * * @returns error text */ function getFirstError(): string { @@ -455,7 +447,6 @@ describe('TagsCreatorComponent', () => { describe('Existing tags panel', () => { /** * Get the existing tags panel - * * @returns debug element */ function getPanel(): DebugElement { @@ -545,7 +536,6 @@ describe('TagsCreatorComponent', () => { describe('Existing tags', () => { /** * Get the existing tags - * * @returns list of tags */ function getExistingTags(): string[] { @@ -739,7 +729,6 @@ describe('TagsCreatorComponent', () => { describe('Spinner', () => { /** * Get the material progress spinner - * * @returns debug element */ async function getSpinner(): Promise { diff --git a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts index b1fb1bcf2ac..05c20c0328e 100644 --- a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts +++ b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts @@ -85,7 +85,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy { /** * Default top list. - * * @param tags tags which should be displayed as default tags for top list. */ @Input() @@ -106,7 +105,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy { /** * Decides if input for tags creation/searching should be visible. When input is hidden then panel of existing tags is hidden as well. - * * @param tagNameControlVisible true if input should be visible, false otherwise. */ @Input() @@ -273,7 +271,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy { /** * Remove tag from top list. In case that tag was part of search result then that tag is moved to bottom list * (list of existing tags) after removing so user can reselect it again later. - * * @param tag tag's name which should be removed from top list. */ removeTag(tag: string): void { @@ -287,7 +284,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy { /** * Called when user selects any tag from list of existing tags. It moves tag from existing tags list to top list. - * * @param selectedTag changes */ addExistingTagToTagsToAssign(selectedTag: TagEntry): void { @@ -302,7 +298,6 @@ export class TagsCreatorComponent implements OnInit, OnDestroy { /** * Checks if component is in Create mode. - * * @returns `true` if `Create` mode, `false` otherwise. */ isOnlyCreateMode(): boolean { diff --git a/lib/content-services/src/lib/tree-view/models/tree-view.model.ts b/lib/content-services/src/lib/tree-view/models/tree-view.model.ts index c53ad04d888..a158568d4cd 100644 --- a/lib/content-services/src/lib/tree-view/models/tree-view.model.ts +++ b/lib/content-services/src/lib/tree-view/models/tree-view.model.ts @@ -18,7 +18,6 @@ import { NodeEntry } from '@alfresco/js-api'; export class TreeBaseNode { - name: string; nodeId: string; level: number; @@ -31,6 +30,5 @@ export class TreeBaseNode { this.level = level ? level : 0; this.expandable = expandable ? expandable : true; this.node = nodeEntry ? new NodeEntry(nodeEntry) : undefined; - } } diff --git a/lib/content-services/src/lib/tree/components/tree.component.ts b/lib/content-services/src/lib/tree/components/tree.component.ts index f220447f32a..e0813817418 100644 --- a/lib/content-services/src/lib/tree/components/tree.component.ts +++ b/lib/content-services/src/lib/tree/components/tree.component.ts @@ -169,7 +169,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Checks if node is LoadMoreNode node - * * @param _idx (unused) * @param node node to be checked * @returns `true` if there are more items to load, otherwise `false` @@ -180,7 +179,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Checks if tree is empty - * * @returns boolean */ public isEmpty(): boolean { @@ -189,7 +187,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Returns action icon based on expanded/collapsed node state. - * * @param node node to be checked * @returns collapse or expand icon */ @@ -199,7 +196,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Refreshes the tree, root nodes are reloaded, tree selection is cleared. - * * @param skipCount Number of root nodes to skip. * @param maxItems Maximum number of nodes returned from Observable. * @param searchTerm Specifies if categories should be filtered out by name or not. If not specified then returns categories without filtering. @@ -217,7 +213,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Collapses or expanding the node based on its current state - * * @param node node to be collapsed/expanded */ public expandCollapseNode(node: T): void { @@ -242,7 +237,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Loads more subnode for a given parent node - * * @param node parent node */ public loadMoreSubnodes(node: T): void { @@ -266,7 +260,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * When node is selected it selects all its descendants - * * @param node selected node */ public onNodeSelected(node: T): void { @@ -282,7 +275,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Checks if all descendants of a node are selected - * * @param node selected node * @returns boolean */ @@ -293,7 +285,6 @@ export class TreeComponent implements OnInit, OnDestroy { /** * Checks if some descendants of a node are selected - * * @param node selected node * @returns boolean */ diff --git a/lib/content-services/src/lib/tree/mock/tree-service.service.mock.ts b/lib/content-services/src/lib/tree/mock/tree-service.service.mock.ts index 4828d39961e..194ee33959e 100644 --- a/lib/content-services/src/lib/tree/mock/tree-service.service.mock.ts +++ b/lib/content-services/src/lib/tree/mock/tree-service.service.mock.ts @@ -23,10 +23,10 @@ import { TreeService } from '../services/tree.service'; import { treeNodesMockExpanded } from './tree-node.mock'; @Injectable({ providedIn: 'root' }) -export class TreeServiceMock extends TreeService { +export class TreeServiceMock extends TreeService { public getSubNodes(parentNodeId: string, skipCount?: number, maxItems?: number): Observable> { if (parentNodeId) { - return of({pagination: {skipCount, maxItems}, entries: Array.from(treeNodesMockExpanded)}); + return of({ pagination: { skipCount, maxItems }, entries: Array.from(treeNodesMockExpanded) }); } return of(); } diff --git a/lib/content-services/src/lib/tree/services/tree.service.ts b/lib/content-services/src/lib/tree/services/tree.service.ts index 026b2f9e9b4..a6f64f942b5 100644 --- a/lib/content-services/src/lib/tree/services/tree.service.ts +++ b/lib/content-services/src/lib/tree/services/tree.service.ts @@ -49,7 +49,6 @@ export abstract class TreeService extends DataSource { /** * Expands node applying subnodes to it. - * * @param nodeToExpand Node to be expanded * @param subNodes List of nodes that will be added as children of expanded node */ @@ -65,7 +64,6 @@ export abstract class TreeService extends DataSource { /** * Collapses a node removing all children from it. - * * @param nodeToCollapse Node to be collapsed */ public collapseNode(nodeToCollapse: T): void { @@ -81,7 +79,6 @@ export abstract class TreeService extends DataSource { /** * Append more child nodes to already expanded parent node - * * @param nodeToAppend Expanded parent node * @param subNodes List of nodes that will be added as children of expanded node */ @@ -98,7 +95,6 @@ export abstract class TreeService extends DataSource { /** * Removes provided node from the tree - * * @param node Node to be removed */ public removeNode(node: T): void { @@ -107,7 +103,6 @@ export abstract class TreeService extends DataSource { /** * Gets children of the node - * * @param parentNode Parent node * @returns children of parent node */ @@ -117,7 +112,6 @@ export abstract class TreeService extends DataSource { /** * Checks if tree is empty - * * @returns boolean */ public isEmpty(): boolean { @@ -126,7 +120,6 @@ export abstract class TreeService extends DataSource { /** * Gets parent node of given node. If node with parentNodeId is not found it returns undefined. - * * @param parentNodeId Id of a parent node to be found * @returns parent node or undefined when not found */ diff --git a/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts b/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts index fd1aaac2d7c..908a1c6633f 100644 --- a/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts +++ b/lib/content-services/src/lib/upload/components/base-upload/upload-base.ts @@ -88,9 +88,7 @@ export abstract class UploadBase implements OnInit, OnDestroy { protected onDestroy$ = new Subject(); ngOnInit() { - this.uploadService.fileUploadError - .pipe(takeUntil(this.onDestroy$)) - .subscribe(error => this.error.emit(error)); + this.uploadService.fileUploadError.pipe(takeUntil(this.onDestroy$)).subscribe((error) => this.error.emit(error)); } ngOnDestroy() { @@ -100,35 +98,29 @@ export abstract class UploadBase implements OnInit, OnDestroy { /** * Upload a list of file in the specified path - * * @param files files to upload */ uploadFiles(files: File[]): void { - const filteredFiles: FileModel[] = files - .map((file: File) => this.createFileModel(file, this.rootFolderId, ((file as any).webkitRelativePath || '').replace(/\/[^/]*$/, ''))); + const filteredFiles: FileModel[] = files.map((file: File) => + this.createFileModel(file, this.rootFolderId, ((file as any).webkitRelativePath || '').replace(/\/[^/]*$/, '')) + ); this.uploadQueue(filteredFiles); } uploadFilesInfo(files: FileInfo[]): void { - const filteredFiles: FileModel[] = files - .map((fileInfo: FileInfo) => this.createFileModel(fileInfo.file, this.rootFolderId, fileInfo.relativeFolder)); + const filteredFiles: FileModel[] = files.map((fileInfo: FileInfo) => + this.createFileModel(fileInfo.file, this.rootFolderId, fileInfo.relativeFolder) + ); this.uploadQueue(filteredFiles); } private uploadQueue(files: FileModel[]) { - const filteredFiles = files - .filter(this.isFileAcceptable.bind(this)) - .filter(this.isFileSizeAcceptable.bind(this)); + const filteredFiles = files.filter(this.isFileAcceptable.bind(this)).filter(this.isFileSizeAcceptable.bind(this)); this.ngZone.run(() => { - const event = new UploadFilesEvent( - [...filteredFiles], - this.uploadService, - this.success, - this.error - ); + const event = new UploadFilesEvent([...filteredFiles], this.uploadService, this.success, this.error); this.beginUpload.emit(event); if (!event.defaultPrevented) { @@ -142,7 +134,6 @@ export abstract class UploadBase implements OnInit, OnDestroy { /** * Checks if the given file is allowed by the extension filters - * * @param file FileModel * @returns `true` if file is acceptable, otherwise `false` */ @@ -151,16 +142,13 @@ export abstract class UploadBase implements OnInit, OnDestroy { return true; } - const allowedExtensions = this.acceptedFilesType - .split(',') - .map((ext) => ext.trim().replace(/^\./, '')); + const allowedExtensions = this.acceptedFilesType.split(',').map((ext) => ext.trim().replace(/^\./, '')); return allowedExtensions.indexOf(file.extension) !== -1; } /** * Creates FileModel from File - * * @param file file instance * @param parentId parent id * @param path upload path @@ -168,14 +156,18 @@ export abstract class UploadBase implements OnInit, OnDestroy { * @returns file model */ protected createFileModel(file: File, parentId: string, path: string, id?: string): FileModel { - return new FileModel(file, { - comment: this.comment, - majorVersion: this.majorVersion, - newVersion: this.versioning, - parentId, - path, - nodeType: this.nodeType - }, id); + return new FileModel( + file, + { + comment: this.comment, + majorVersion: this.majorVersion, + newVersion: this.versioning, + parentId, + path, + nodeType: this.nodeType + }, + id + ); } protected isFileSizeAllowed(file: FileModel) { @@ -197,7 +189,6 @@ export abstract class UploadBase implements OnInit, OnDestroy { /** * Checks if the given file is an acceptable size - * * @param file FileModel * @returns `true` if file size is acceptable, otherwise `false` */ @@ -207,15 +198,11 @@ export abstract class UploadBase implements OnInit, OnDestroy { if (!this.isFileSizeAllowed(file)) { acceptableSize = false; - const message = this.translationService.instant( - 'FILE_UPLOAD.MESSAGES.EXCEED_MAX_FILE_SIZE', - { fileName: file.name } - ); + const message = this.translationService.instant('FILE_UPLOAD.MESSAGES.EXCEED_MAX_FILE_SIZE', { fileName: file.name }); this.error.emit(message); } return acceptableSize; } - } diff --git a/lib/content-services/src/lib/upload/components/file-uploading-list.component.ts b/lib/content-services/src/lib/upload/components/file-uploading-list.component.ts index e34a14df09d..a82daa11bcb 100644 --- a/lib/content-services/src/lib/upload/components/file-uploading-list.component.ts +++ b/lib/content-services/src/lib/upload/components/file-uploading-list.component.ts @@ -44,7 +44,6 @@ export class FileUploadingListComponent { /** * Cancel file upload - * * @param file File model to cancel upload for. */ cancelFile(file: FileModel): void { @@ -57,7 +56,6 @@ export class FileUploadingListComponent { /** * Remove uploaded file - * * @param file File model to remove upload for. */ removeFile(file: FileModel): void { @@ -86,7 +84,6 @@ export class FileUploadingListComponent { /** * Checks if all the files are uploaded false if there is at least one file in Progress | Starting | Pending - * * @returns `true` if upload is complete, otherwise `false` */ isUploadCompleted(): boolean { @@ -101,7 +98,6 @@ export class FileUploadingListComponent { /** * Check if all the files are Cancelled | Aborted | Error. false if there is at least one file in uploading states - * * @returns `true` if upload is cancelled, otherwise `false` */ isUploadCancelled(): boolean { diff --git a/lib/content-services/src/lib/upload/components/upload-drag-area.component.ts b/lib/content-services/src/lib/upload/components/upload-drag-area.component.ts index f867157b4d0..a68c9d4952e 100644 --- a/lib/content-services/src/lib/upload/components/upload-drag-area.component.ts +++ b/lib/content-services/src/lib/upload/components/upload-drag-area.component.ts @@ -41,7 +41,6 @@ export class UploadDragAreaComponent extends UploadBase implements NodeAllowable /** * Method called when files are dropped in the drag area. - * * @param files - files dropped in the drag area. */ onFilesDropped(files: File[]): void { @@ -52,7 +51,6 @@ export class UploadDragAreaComponent extends UploadBase implements NodeAllowable /** * Called when a folder are dropped in the drag area - * * @param folder - name of the dropped folder */ onFolderEntityDropped(folder: any): void { @@ -65,7 +63,6 @@ export class UploadDragAreaComponent extends UploadBase implements NodeAllowable /** * Show undo notification bar. - * * @param latestFilesAdded - files in the upload queue enriched with status flag and xhr object. */ showUndoNotificationBar(latestFilesAdded: FileModel[]) { @@ -82,7 +79,6 @@ export class UploadDragAreaComponent extends UploadBase implements NodeAllowable /** * Check if content is droppable - * * @returns `true` or `false` considering the component options and node permissions */ isDroppable(): boolean { @@ -91,7 +87,6 @@ export class UploadDragAreaComponent extends UploadBase implements NodeAllowable /** * Handles 'upload-files' events raised by child components. - * * @param event DOM event */ onUploadFiles(event: CustomEvent) { diff --git a/lib/content-services/src/lib/upload/directives/file-draggable.directive.ts b/lib/content-services/src/lib/upload/directives/file-draggable.directive.ts index 18b222c01f6..4c6ed02980a 100644 --- a/lib/content-services/src/lib/upload/directives/file-draggable.directive.ts +++ b/lib/content-services/src/lib/upload/directives/file-draggable.directive.ts @@ -66,7 +66,6 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Method called when files is dropped in the drag and drop area. - * * @param event DOM event. */ onDropFiles(event: any): void { @@ -111,7 +110,6 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Change the style of the drag area when a file drag in. - * * @param event - DOM event. */ onDragEnter(event: DragEvent): void { @@ -128,7 +126,6 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Change the style of the drag area when a file drag out. - * * @param event - DOM event. */ onDragLeave(event: Event): void { @@ -140,7 +137,6 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Change the style of the drag area when a file is over the drag area. - * * @param event drag event */ onDragOver(event: DragEvent): void { @@ -157,7 +153,6 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Prevent default and stop propagation of the DOM event. - * * @param event DOM event */ preventDefault(event: Event): void { diff --git a/lib/content-services/src/lib/version-compatibility/version-compatibility-factory.ts b/lib/content-services/src/lib/version-compatibility/version-compatibility-factory.ts index ddfe20f11e3..1750b5a074c 100644 --- a/lib/content-services/src/lib/version-compatibility/version-compatibility-factory.ts +++ b/lib/content-services/src/lib/version-compatibility/version-compatibility-factory.ts @@ -19,7 +19,6 @@ import { VersionCompatibilityService } from './version-compatibility.service'; /** * Create a version compatibility factory - * * @param versionCompatibilityService service dependency * @returns factory function */ diff --git a/lib/content-services/src/lib/version-compatibility/version-compatibility.service.ts b/lib/content-services/src/lib/version-compatibility/version-compatibility.service.ts index c35c761b933..ec955df37fa 100644 --- a/lib/content-services/src/lib/version-compatibility/version-compatibility.service.ts +++ b/lib/content-services/src/lib/version-compatibility/version-compatibility.service.ts @@ -31,7 +31,7 @@ export class VersionCompatibilityService { constructor(private discoveryApiService: DiscoveryApiService) { this.discoveryApiService.ecmProductInfo$ - .pipe(filter(acsInfo => !!acsInfo)) + .pipe(filter((acsInfo) => !!acsInfo)) .subscribe((acsInfo: RepositoryInfo) => this.initializeAcsVersion(acsInfo.version)); } @@ -53,12 +53,13 @@ export class VersionCompatibilityService { if (currentVersion) { if (+currentVersion.major > +parsedRequiredVersion.major) { versionSupported = true; - } else if (currentVersion.major === parsedRequiredVersion.major && - +currentVersion.minor > +parsedRequiredVersion.minor) { + } else if (currentVersion.major === parsedRequiredVersion.major && +currentVersion.minor > +parsedRequiredVersion.minor) { versionSupported = true; - } else if (currentVersion.major === parsedRequiredVersion.major && + } else if ( + currentVersion.major === parsedRequiredVersion.major && currentVersion.minor === parsedRequiredVersion.minor && - +currentVersion.patch >= +parsedRequiredVersion.patch) { + +currentVersion.patch >= +parsedRequiredVersion.patch + ) { versionSupported = true; } } diff --git a/lib/content-services/src/lib/version-manager/content-version.service.ts b/lib/content-services/src/lib/version-manager/content-version.service.ts index 72ae3199996..226a2f556bf 100644 --- a/lib/content-services/src/lib/version-manager/content-version.service.ts +++ b/lib/content-services/src/lib/version-manager/content-version.service.ts @@ -35,7 +35,6 @@ export class ContentVersionService { /** * Get content URL for the given nodeId and specific version. - * * @param nodeId The ID of the node * @param versionId The ID of the version * @param attachment Retrieve content as an attachment for download diff --git a/lib/content-services/src/lib/viewer/components/alfresco-viewer.component.spec.ts b/lib/content-services/src/lib/viewer/components/alfresco-viewer.component.spec.ts index 3d2a07862df..416f7c7e795 100644 --- a/lib/content-services/src/lib/viewer/components/alfresco-viewer.component.spec.ts +++ b/lib/content-services/src/lib/viewer/components/alfresco-viewer.component.spec.ts @@ -69,6 +69,7 @@ class ViewerWithCustomToolbarComponent {} selector: 'adf-viewer-container-toolbar-actions', standalone: true, imports: [MatIconModule, MatButtonModule, ViewerToolbarActionsComponent, AlfrescoViewerComponent], + // eslint-disable-next-line @alfresco/eslint-angular/no-angular-material-selectors template: ` ` }) export class LoginDialogStorybookComponent { - @Output() executeSubmit = new EventEmitter(); @Output() error = new EventEmitter(); @Output() closed = new EventEmitter(); - constructor(private dialog: MatDialog) { } + constructor(private dialog: MatDialog) {} openLoginDialog() { const data: LoginDialogComponentData = { @@ -48,14 +45,11 @@ export class LoginDialogStorybookComponent { logged: new Subject() }; - this.dialog.open( - LoginDialogComponent, - { - data, - panelClass: 'adf-login-dialog', - width: '630px' - } - ); + this.dialog.open(LoginDialogComponent, { + data, + panelClass: 'adf-login-dialog', + width: '630px' + }); data.logged.subscribe( () => { diff --git a/lib/core/src/lib/login/components/login/login.component.stories.ts b/lib/core/src/lib/login/components/login/login.component.stories.ts index e1d2c358a9d..dc01b4dfd28 100644 --- a/lib/core/src/lib/login/components/login/login.component.stories.ts +++ b/lib/core/src/lib/login/components/login/login.component.stories.ts @@ -32,10 +32,7 @@ export default { providers: [{ provide: AuthenticationService, useClass: AuthenticationMock }] }), applicationConfig({ - providers: [ - importProvidersFrom(CoreStoryModule), - importProvidersFrom(RouterModule.forRoot([], { useHash: true })) - ] + providers: [importProvidersFrom(CoreStoryModule), importProvidersFrom(RouterModule.forRoot([], { useHash: true }))] }) ], parameters: { diff --git a/lib/core/src/lib/login/components/login/login.component.ts b/lib/core/src/lib/login/components/login/login.component.ts index 5e05209be0a..9291c267b57 100644 --- a/lib/core/src/lib/login/components/login/login.component.ts +++ b/lib/core/src/lib/login/components/login/login.component.ts @@ -209,7 +209,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * Method called on submit form - * * @param values login form values */ onSubmit(values: LoginFormValues): void { @@ -236,7 +235,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * The method check the error in the form and push the error in the formError object - * * @param data form data */ onValueChanged(data: any) { @@ -289,7 +287,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * Check and display the right error message in the UI - * * @param err error object */ private displayErrorMessage(err: any): void { @@ -306,7 +303,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * Add a custom form error for a field - * * @param field field * @param msg error message */ @@ -316,7 +312,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * Add a custom validation rule error for a field - * * @param field field * @param ruleId - i.e. required | minlength | maxlength * @param msg message @@ -333,7 +328,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * Display and hide the password value. - * * @param event input event */ toggleShowPassword(event: Event) { @@ -343,7 +337,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * The method return if a field is valid or not - * * @param field form field to check * @returns `true` if form field should display an error, otherwise `false` */ @@ -353,7 +346,6 @@ export class LoginComponent implements OnInit, OnDestroy { /** * Trim username - * * @param event event */ trimUsername(event: any) { diff --git a/lib/core/src/lib/login/directives/login-footer.directive.ts b/lib/core/src/lib/login/directives/login-footer.directive.ts index 04c3aab3eb5..4fcb0c25019 100644 --- a/lib/core/src/lib/login/directives/login-footer.directive.ts +++ b/lib/core/src/lib/login/directives/login-footer.directive.ts @@ -26,8 +26,7 @@ export class LoginFooterDirective implements AfterContentInit { @ContentChild(TemplateRef) template: any; - constructor(private alfrescoLoginComponent: LoginComponent) { - } + constructor(private alfrescoLoginComponent: LoginComponent) {} ngAfterContentInit() { this.alfrescoLoginComponent.footerTemplate = this.template; diff --git a/lib/core/src/lib/login/directives/login-header.directive.ts b/lib/core/src/lib/login/directives/login-header.directive.ts index 0c16f6e2839..842832b052e 100644 --- a/lib/core/src/lib/login/directives/login-header.directive.ts +++ b/lib/core/src/lib/login/directives/login-header.directive.ts @@ -26,8 +26,7 @@ export class LoginHeaderDirective implements AfterContentInit { @ContentChild(TemplateRef) template: any; - constructor(private alfrescoLoginComponent: LoginComponent) { - } + constructor(private alfrescoLoginComponent: LoginComponent) {} ngAfterContentInit() { this.alfrescoLoginComponent.headerTemplate = this.template; diff --git a/lib/core/src/lib/login/models/login-submit.event.ts b/lib/core/src/lib/login/models/login-submit.event.ts index 302b857b1ce..2ef0c0167af 100644 --- a/lib/core/src/lib/login/models/login-submit.event.ts +++ b/lib/core/src/lib/login/models/login-submit.event.ts @@ -16,7 +16,6 @@ */ export class LoginSubmitEvent { - private readonly _values: any; private _defaultPrevented: boolean = false; @@ -35,5 +34,4 @@ export class LoginSubmitEvent { preventDefault() { this._defaultPrevented = true; } - } diff --git a/lib/core/src/lib/login/models/login-success.event.ts b/lib/core/src/lib/login/models/login-success.event.ts index 4a88bbea310..3f10b1b4afe 100644 --- a/lib/core/src/lib/login/models/login-success.event.ts +++ b/lib/core/src/lib/login/models/login-success.event.ts @@ -16,9 +16,5 @@ */ export class LoginSuccessEvent { - constructor( - public token: any, - public username: string, - public password: string - ) {} + constructor(public token: any, public username: string, public password: string) {} } diff --git a/lib/core/src/lib/mock/cookie.service.mock.ts b/lib/core/src/lib/mock/cookie.service.mock.ts index 886387b3ce7..3186999021f 100644 --- a/lib/core/src/lib/mock/cookie.service.mock.ts +++ b/lib/core/src/lib/mock/cookie.service.mock.ts @@ -20,22 +20,18 @@ import { CookieService } from '../common/services/cookie.service'; @Injectable() export class CookieServiceMock extends CookieService { - /** @override */ isEnabled(): boolean { return true; } - /** @override */ getItem(key: string): string | null { return this[key]?.data || null; } - /** @override */ setItem(key: string, data: string, expiration: Date | null, path: string | null): void { this[key] = { data, expiration, path }; } - /** @override */ clear() { Object.keys(this).forEach((key) => { if (Object.prototype.hasOwnProperty.call(this, key) && typeof this[key] !== 'function') { diff --git a/lib/core/src/lib/mock/data-column.mock.ts b/lib/core/src/lib/mock/data-column.mock.ts index 7cf579dd7a0..b0a64966a54 100644 --- a/lib/core/src/lib/mock/data-column.mock.ts +++ b/lib/core/src/lib/mock/data-column.mock.ts @@ -18,9 +18,7 @@ import { DataColumn } from '../datatable/data/data-column.model'; import { mockPathInfos } from '../datatable/components/mocks/datatable.mock'; -export const getDataColumnMock = ( - column: Partial> = {} -): DataColumn => ({ +export const getDataColumnMock = (column: Partial> = {}): DataColumn => ({ id: 'columnId', key: 'key', type: 'text', @@ -42,12 +40,7 @@ export const getDataColumnMock = ( ...column }); -export const textColumnRows = [ - { firstname: 'John' }, - { firstname: 'Henry' }, - { firstname: 'David' }, - { firstname: 'Thomas' } -]; +export const textColumnRows = [{ firstname: 'John' }, { firstname: 'Henry' }, { firstname: 'David' }, { firstname: 'Thomas' }]; export const dateColumnRows = [ { createdOn: new Date(2016, 6, 1, 11, 8, 4) }, @@ -80,41 +73,14 @@ export const locationColumnRows = [ } ]; -export const booleanColumnRows = [ - { bool: 'true' }, - { bool: 'false' }, - { bool: true }, - { bool: false } -]; +export const booleanColumnRows = [{ bool: 'true' }, { bool: 'false' }, { bool: true }, { bool: false }]; -export const iconColumnRows = [ - { icon: 'alarm' }, - { icon: 'folder_open' }, - { icon: 'accessibility' } -]; +export const iconColumnRows = [{ icon: 'alarm' }, { icon: 'folder_open' }, { icon: 'accessibility' }]; -export const imageColumnRows = [ - { image: 'material-icons://image' }, - { image: 'material-icons://image' }, - { image: 'material-icons://image' } -]; +export const imageColumnRows = [{ image: 'material-icons://image' }, { image: 'material-icons://image' }, { image: 'material-icons://image' }]; -export const fileSizeColumnRows = [ - { size: 12313 }, - { size: 23 }, - { size: 42421412421 } -]; +export const fileSizeColumnRows = [{ size: 12313 }, { size: 23 }, { size: 42421412421 }]; -export const amountColumnRows = [ - { price: 1230 }, - { price: 422.55 }, - { price: 50000.7855332 }, - { price: 0.123 }, - { price: -2022.3321 } -]; +export const amountColumnRows = [{ price: 1230 }, { price: 422.55 }, { price: 50000.7855332 }, { price: 0.123 }, { price: -2022.3321 }]; -export const jsonColumnRows = [ - { rowInfo: { id: 1, name: 'row1' } }, - { rowInfo: { id: 2, name: 'row2' } }, - { rowInfo: { id: 3, name: 'row3' } } -]; +export const jsonColumnRows = [{ rowInfo: { id: 1, name: 'row1' } }, { rowInfo: { id: 2, name: 'row2' } }, { rowInfo: { id: 3, name: 'row3' } }]; diff --git a/lib/core/src/lib/mock/event.mock.ts b/lib/core/src/lib/mock/event.mock.ts index 18708104af0..44d551eb14f 100644 --- a/lib/core/src/lib/mock/event.mock.ts +++ b/lib/core/src/lib/mock/event.mock.ts @@ -16,7 +16,6 @@ */ export class EventMock { - static keyDown(key: any) { const event: any = document.createEvent('Event'); event.keyCode = key; diff --git a/lib/core/src/lib/mock/form/form-definition-readonly.mock.ts b/lib/core/src/lib/mock/form/form-definition-readonly.mock.ts index 8572592f474..a923b25946a 100644 --- a/lib/core/src/lib/mock/form/form-definition-readonly.mock.ts +++ b/lib/core/src/lib/mock/form/form-definition-readonly.mock.ts @@ -25,192 +25,192 @@ export const formReadonlyTwoTextFields: any = { taskDefinitionKey: 'sid-D941F49F-2B04-4FBB-9B49-9E95991993E8', tabs: [], fields: [ - { - fieldType: 'ContainerRepresentation', - id: '1507044399260', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [ - { - fieldType: 'FormFieldRepresentation', - id: 'firstname', - name: 'firstName', - type: 'readonly', - value: 'fakeFirstName', - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { - existingColspan: 1, - maxColspan: 2, - field: { - id: 'firstname', - name: 'firstName', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 0, - sizeY: 0, - row: 0, - col: 0, - visibilityCondition: null - } - }, - dateDisplayFormat: null, - layout: { - row: -1, - column: -1, - colspan: 1 - }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null + { + fieldType: 'ContainerRepresentation', + id: '1507044399260', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'firstname', + name: 'firstName', + type: 'readonly', + value: 'fakeFirstName', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { + existingColspan: 1, + maxColspan: 2, + field: { + id: 'firstname', + name: 'firstName', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 0, + sizeY: 0, + row: 0, + col: 0, + visibilityCondition: null + } + }, + dateDisplayFormat: null, + layout: { + row: -1, + column: -1, + colspan: 1 + }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'lastname', + name: 'lastName', + type: 'readonly', + value: 'fakeLastName', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { + existingColspan: 1, + maxColspan: 1, + field: { + id: 'lastname', + name: 'lastName', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 0, + sizeY: 0, + row: 0, + col: 0, + visibilityCondition: null + } + }, + dateDisplayFormat: null, + layout: { + row: -1, + column: -1, + colspan: 1 + }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ] } - ], - 2: [ - { - fieldType: 'FormFieldRepresentation', - id: 'lastname', - name: 'lastName', - type: 'readonly', - value: 'fakeLastName', - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { - existingColspan: 1, - maxColspan: 1, - field: { - id: 'lastname', - name: 'lastName', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 0, - sizeY: 0, - row: 0, - col: 0, - visibilityCondition: null - } - }, - dateDisplayFormat: null, - layout: { - row: -1, - column: -1, - colspan: 1 - }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - } - ] } - } ], outcomes: [], javascriptEvents: [], @@ -222,4 +222,4 @@ export const formReadonlyTwoTextFields: any = { customFieldsValueInfo: {}, gridsterForm: false, globalDateFormat: 'D-M-YYYY' - }; +}; diff --git a/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts b/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts index b7c9b4a858f..4644587b93b 100644 --- a/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts +++ b/lib/core/src/lib/mock/form/form-definition-visibility.mock.ts @@ -56,7 +56,7 @@ export const formDefVisibilityFieldDependsOnNextOne: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'RestFieldRepresentation', id: 'country', @@ -123,7 +123,7 @@ export const formDefVisibilityFieldDependsOnNextOne: any = { requestHeaders: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'name', @@ -222,7 +222,7 @@ export const formDefVisibilitiFieldDependsOnPreviousOne: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'name', @@ -265,7 +265,7 @@ export const formDefVisibilitiFieldDependsOnPreviousOne: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'RestFieldRepresentation', id: 'country', diff --git a/lib/core/src/lib/mock/form/form-definition.mock.ts b/lib/core/src/lib/mock/form/form-definition.mock.ts index f67d8a41f13..8faf4e48437 100644 --- a/lib/core/src/lib/mock/form/form-definition.mock.ts +++ b/lib/core/src/lib/mock/form/form-definition.mock.ts @@ -59,7 +59,7 @@ export const formDefinitionTwoTextFields: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'firstname', @@ -102,7 +102,7 @@ export const formDefinitionTwoTextFields: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'lastname', @@ -204,7 +204,7 @@ export const formDefinitionDropdownField: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'RestFieldRepresentation', id: 'country', @@ -266,7 +266,7 @@ export const formDefinitionDropdownField: any = { requestHeaders: null } ], - 2: [] + '2': [] } } ], @@ -326,7 +326,7 @@ export const formDefinitionRequiredField: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'RestFieldRepresentation', id: 'country', @@ -388,7 +388,7 @@ export const formDefinitionRequiredField: any = { requestHeaders: null } ], - 2: [] + '2': [] } } ], diff --git a/lib/core/src/lib/mock/form/form.component.mock.ts b/lib/core/src/lib/mock/form/form.component.mock.ts index e4891a89859..d553ed29c6e 100644 --- a/lib/core/src/lib/mock/form/form.component.mock.ts +++ b/lib/core/src/lib/mock/form/form.component.mock.ts @@ -59,7 +59,7 @@ export const fakeForm: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'RestFieldRepresentation', id: 'dropdownId', @@ -121,7 +121,7 @@ export const fakeForm: any = { requestHeaders: null } ], - 2: [ + '2': [ { fieldType: 'RestFieldRepresentation', id: 'radio', @@ -215,7 +215,7 @@ export const fakeForm: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'date', @@ -258,7 +258,7 @@ export const fakeForm: any = { visibilityCondition: null } ], - 2: [] + '2': [] } } ], diff --git a/lib/core/src/lib/mock/form/form.service.mock.ts b/lib/core/src/lib/mock/form/form.service.mock.ts index 279e6a29182..7a86a7ddd0f 100644 --- a/lib/core/src/lib/mock/form/form.service.mock.ts +++ b/lib/core/src/lib/mock/form/form.service.mock.ts @@ -27,48 +27,13 @@ export const formModelTabs: any = { stencilSetId: null, referenceId: null, formDefinition: { - tabs: [], - fields: [ - { - fieldType: 'ContainerRepresentation', - id: '1507037668653', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [ - { - fieldType: 'AmountFieldRepresentation', - id: 'label', + tabs: [], + fields: [ + { + fieldType: 'ContainerRepresentation', + id: '1507037668653', name: 'Label', - type: 'amount', + type: 'container', value: null, required: false, readOnly: false, @@ -89,110 +54,110 @@ export const formModelTabs: any = { restLabelProperty: null, tab: null, className: null, - params: { - existingColspan: 1, - maxColspan: 2 - }, dateDisplayFormat: null, - layout: { - row: -1, - column: -1, - colspan: 1 - }, - sizeX: 1, + layout: null, + sizeX: 2, sizeY: 1, row: -1, col: -1, visibilityCondition: null, - enableFractions: false, - currency: null - } - ], - 2: [ - { - fieldType: 'FormFieldRepresentation', - id: 'label1', - name: 'Label1', - type: 'date', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { - existingColspan: 1, - maxColspan: 1 - }, - dateDisplayFormat: null, - layout: { - row: -1, - column: -1, - colspan: 1 - }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - } - ] - } - }, - { - fieldType: 'ContainerRepresentation', - id: '1507037670167', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [ - { - fieldType: 'FormFieldRepresentation', - id: 'label2', - name: 'Label2', - type: 'boolean', + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'AmountFieldRepresentation', + id: 'label', + name: 'Label', + type: 'amount', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { + existingColspan: 1, + maxColspan: 2 + }, + dateDisplayFormat: null, + layout: { + row: -1, + column: -1, + colspan: 1 + }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + enableFractions: false, + currency: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label1', + name: 'Label1', + type: 'date', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { + existingColspan: 1, + maxColspan: 1 + }, + dateDisplayFormat: null, + layout: { + row: -1, + column: -1, + colspan: 1 + }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1507037670167', + name: 'Label', + type: 'container', value: null, required: false, readOnly: false, @@ -213,36 +178,71 @@ export const formModelTabs: any = { restLabelProperty: null, tab: null, className: null, - params: { - existingColspan: 1, - maxColspan: 2 - }, dateDisplayFormat: null, - layout: { - row: -1, - column: -1, - colspan: 1 - }, - sizeX: 1, + layout: null, + sizeX: 2, sizeY: 1, row: -1, col: -1, - visibilityCondition: null - } - ], - 2: [] - } - } - ], - outcomes: [], - javascriptEvents: [], - className: '', - style: '', - customFieldTemplates: {}, - metadata: {}, - variables: [], - customFieldsValueInfo: {}, - gridsterForm: false + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label2', + name: 'Label2', + type: 'boolean', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { + existingColspan: 1, + maxColspan: 2 + }, + dateDisplayFormat: null, + layout: { + row: -1, + column: -1, + colspan: 1 + }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [] + } + } + ], + outcomes: [], + javascriptEvents: [], + className: '', + style: '', + customFieldTemplates: {}, + metadata: {}, + variables: [], + customFieldsValueInfo: {}, + gridsterForm: false } } - }; +}; diff --git a/lib/core/src/lib/mock/form/widget-visibility-cloud.service.mock.ts b/lib/core/src/lib/mock/form/widget-visibility-cloud.service.mock.ts index 19d501894ce..26226fe3b3d 100644 --- a/lib/core/src/lib/mock/form/widget-visibility-cloud.service.mock.ts +++ b/lib/core/src/lib/mock/form/widget-visibility-cloud.service.mock.ts @@ -45,7 +45,7 @@ export const fakeFormJson: any = { value: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'FIELD_TEST', @@ -74,7 +74,7 @@ export const fakeFormJson: any = { isVisible: true } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'RIGHT_FORM_FIELD_ID', @@ -157,7 +157,7 @@ export const complexVisibilityJsonVisible: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'label', @@ -193,7 +193,7 @@ export const complexVisibilityJsonVisible: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'label1', @@ -265,7 +265,7 @@ export const complexVisibilityJsonVisible: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'label4', @@ -301,7 +301,7 @@ export const complexVisibilityJsonVisible: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'label3', @@ -373,7 +373,7 @@ export const complexVisibilityJsonVisible: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'label2', @@ -409,7 +409,7 @@ export const complexVisibilityJsonVisible: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'label5', @@ -538,7 +538,7 @@ export const complexVisibilityJsonNotVisible: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'label', @@ -574,7 +574,7 @@ export const complexVisibilityJsonNotVisible: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'label1', @@ -646,7 +646,7 @@ export const complexVisibilityJsonNotVisible: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'label4', @@ -682,7 +682,7 @@ export const complexVisibilityJsonNotVisible: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'label3', @@ -754,7 +754,7 @@ export const complexVisibilityJsonNotVisible: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'label2', @@ -790,7 +790,7 @@ export const complexVisibilityJsonNotVisible: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'label5', @@ -889,7 +889,7 @@ export const nextConditionForm: any = { tab: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { id: 'Text1', name: 'Text1', @@ -925,7 +925,7 @@ export const nextConditionForm: any = { value: 'one' } ], - 2: [ + '2': [ { id: 'Text2', name: 'Text2', @@ -1001,7 +1001,7 @@ export const headerVisibilityCond: any = { }, numberOfColumns: 1, fields: { - 1: [] + '1': [] }, visibilityCondition: { leftType: 'field', @@ -1020,7 +1020,7 @@ export const headerVisibilityCond: any = { tab: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { id: 'Text1', name: 'Text1', @@ -1038,7 +1038,7 @@ export const headerVisibilityCond: any = { } } ], - 2: [ + '2': [ { id: 'Text2', name: 'Text2', diff --git a/lib/core/src/lib/mock/form/widget-visibility.service.mock.ts b/lib/core/src/lib/mock/form/widget-visibility.service.mock.ts index 11979bfdd5f..6ab54ca9311 100644 --- a/lib/core/src/lib/mock/form/widget-visibility.service.mock.ts +++ b/lib/core/src/lib/mock/form/widget-visibility.service.mock.ts @@ -20,98 +20,98 @@ import { FormModel, FormValues } from '../../form/components/widgets/core'; export const formTest = new FormModel({}); export const fakeTaskProcessVariableModels = [ - { id: 'TEST_VAR_1', type: 'string', value: 'test_value_1' }, - { id: 'TEST_VAR_2', type: 'string', value: 'test_value_2' }, - { id: 'TEST_VAR_3', type: 'string', value: 'test_value_3' } + { id: 'TEST_VAR_1', type: 'string', value: 'test_value_1' }, + { id: 'TEST_VAR_2', type: 'string', value: 'test_value_2' }, + { id: 'TEST_VAR_3', type: 'string', value: 'test_value_3' } ]; export const formValues: FormValues = { - test_1: 'value_1', - test_2: 'value_2', - test_3: 'value_1', - test_4: 'dropdown_id', - test_5: 'dropdown_label', - dropdown: { id: 'dropdown_id', name: 'dropdown_label' } + test_1: 'value_1', + test_2: 'value_2', + test_3: 'value_1', + test_4: 'dropdown_id', + test_5: 'dropdown_label', + dropdown: { id: 'dropdown_id', name: 'dropdown_label' } }; export const fakeFormJson: any = { - id: '9999', - name: 'FORM_VISIBILITY', - processDefinitionId: 'PROCESS_TEST: 9: 9999', - processDefinitionName: 'PROCESS_TEST', - processDefinitionKey: 'PROCESS_TEST', - taskId: '999', - taskName: 'TEST', - fields: [ + id: '9999', + name: 'FORM_VISIBILITY', + processDefinitionId: 'PROCESS_TEST: 9: 9999', + processDefinitionName: 'PROCESS_TEST', + processDefinitionKey: 'PROCESS_TEST', + taskId: '999', + taskName: 'TEST', + fields: [ { - fieldType: 'ContainerRepresentation', - id: '000000000000000000', - name: 'Label', - type: 'container', - value: null, - numberOfColumns: 2, - fields: { - 1: [ + fieldType: 'ContainerRepresentation', + id: '000000000000000000', + name: 'Label', + type: 'container', + value: null, + numberOfColumns: 2, + fields: { + '1': [ { - fieldType: 'FormFieldRepresentation', - id: 'FIELD_TEST', - name: 'FIELD_TEST', - type: 'text', - value: 'RIGHT_FORM_FIELD_VALUE', - visibilityCondition: null, - isVisible: true + fieldType: 'FormFieldRepresentation', + id: 'FIELD_TEST', + name: 'FIELD_TEST', + type: 'text', + value: 'RIGHT_FORM_FIELD_VALUE', + visibilityCondition: null, + isVisible: true }, { - fieldType: 'FormFieldRepresentation', - id: 'FIELD_WITH_CONDITION', - name: 'FIELD_WITH_CONDITION', - type: 'text', - value: 'field_with_condition_value', - visibilityCondition: null, - isVisible: true + fieldType: 'FormFieldRepresentation', + id: 'FIELD_WITH_CONDITION', + name: 'FIELD_WITH_CONDITION', + type: 'text', + value: 'field_with_condition_value', + visibilityCondition: null, + isVisible: true }, { - fieldType: 'FormFieldRepresentation', - id: 'LEFT_FORM_FIELD_ID', - name: 'LEFT_FORM_FIELD_NAME', - type: 'text', - value: 'LEFT_FORM_FIELD_VALUE', - visibilityCondition: null, - isVisible: true + fieldType: 'FormFieldRepresentation', + id: 'LEFT_FORM_FIELD_ID', + name: 'LEFT_FORM_FIELD_NAME', + type: 'text', + value: 'LEFT_FORM_FIELD_VALUE', + visibilityCondition: null, + isVisible: true } ], - 2: [ + '2': [ { - fieldType: 'FormFieldRepresentation', - id: 'RIGHT_FORM_FIELD_ID', - name: 'RIGHT_FORM_FIELD_NAME', - type: 'text', - value: 'RIGHT_FORM_FIELD_VALUE', - visibilityCondition: null, - isVisible: true + fieldType: 'FormFieldRepresentation', + id: 'RIGHT_FORM_FIELD_ID', + name: 'RIGHT_FORM_FIELD_NAME', + type: 'text', + value: 'RIGHT_FORM_FIELD_VALUE', + visibilityCondition: null, + isVisible: true } ] } } ], - variables: [ + variables: [ { - id: 'e621e8ff-42a6-499c-8121-33c7c35d8641', - name: 'age', - type: 'integer', - value: 11 + id: 'e621e8ff-42a6-499c-8121-33c7c35d8641', + name: 'age', + type: 'integer', + value: 11 }, { - id: '4f8aa99e-8526-429c-9d99-809978489d96', - name: 'name', - type: 'string', - value: 'abc' + id: '4f8aa99e-8526-429c-9d99-809978489d96', + name: 'name', + type: 'string', + value: 'abc' }, { - id: '0207b649-ff07-4f3a-a589-d10afa507b9b', - name: 'dob', - type: 'date', - value: '2019-05-13' + id: '0207b649-ff07-4f3a-a589-d10afa507b9b', + name: 'dob', + type: 'date', + value: '2019-05-13' } ] }; @@ -156,7 +156,7 @@ export const fakeFormCheckBoxVisibilityJson: any = { visibilityCondition: 'null', numberOfColumns: '2', fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'a', @@ -199,7 +199,7 @@ export const fakeFormCheckBoxVisibilityJson: any = { visibilityCondition: 'null' } ], - 2: [ + '2': [ { fieldType: 'FormFieldRepresentation', id: 'b', @@ -278,7 +278,7 @@ export const fakeFormCheckBoxVisibilityJson: any = { visibilityCondition: 'null', numberOfColumns: '2', fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'c', @@ -319,8 +319,9 @@ export const fakeFormCheckBoxVisibilityJson: any = { row: '-1', col: '-1', visibilityCondition: 'null' - }], - 2: [ + } + ], + '2': [ { fieldType: 'FormFieldRepresentation', id: 'd', @@ -399,7 +400,7 @@ export const fakeFormCheckBoxVisibilityJson: any = { visibilityCondition: 'null', numberOfColumns: '2', fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'a_b_c_d', @@ -482,7 +483,7 @@ export const fakeFormCheckBoxVisibilityJson: any = { } } ], - 2: [] + '2': [] } } ], @@ -540,7 +541,7 @@ export const fakeFormChainedVisibilityJson: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'installments', @@ -583,7 +584,7 @@ export const fakeFormChainedVisibilityJson: any = { visibilityCondition: null } ], - 2: [ + '2': [ { fieldType: 'RestFieldRepresentation', id: 'schedule', @@ -681,7 +682,7 @@ export const fakeFormChainedVisibilityJson: any = { visibilityCondition: null, numberOfColumns: 2, fields: { - 1: [ + '1': [ { fieldType: 'FormFieldRepresentation', id: 'showtext', @@ -784,7 +785,7 @@ export const fakeFormChainedVisibilityJson: any = { } } ], - 2: [] + '2': [] } } ], @@ -811,746 +812,778 @@ export const fakeFormChainedVisibilityJson: any = { }; export const complexVisibilityJsonVisible: any = { - id: 47591, - name: 'Test-visibility', - description: '', - version: 4, - lastUpdatedBy: 13, - lastUpdatedByFullName: 'romano romano', - lastUpdated: '2019-06-11T11: 04: 36.870+0000', - stencilSetId: 0, - referenceId: null, - formDefinition: { - tabs: [], - fields: [{ - fieldType: 'ContainerRepresentation', - id: '1560246123312', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [{ - fieldType: 'FormFieldRepresentation', - id: 'label', - name: 'Label', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 2 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }], - 2: [{ - fieldType: 'FormFieldRepresentation', - id: 'label1', - name: 'Label1', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 1 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }] - } - }, { - fieldType: 'ContainerRepresentation', - id: '1560246128696', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [{ - fieldType: 'FormFieldRepresentation', - id: 'label4', - name: 'Label4', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 2 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }], - 2: [{ - fieldType: 'FormFieldRepresentation', - id: 'label3', - name: 'Label3', - type: 'text', - value: '', - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 1 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }] - } - }, { - fieldType: 'ContainerRepresentation', - id: '1560246126964', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [{ - fieldType: 'FormFieldRepresentation', - id: 'label2', - name: 'Label2', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 2 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }], - 2: [{ - fieldType: 'FormFieldRepresentation', - id: 'label5', - name: 'Label5', - type: 'boolean', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 1 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: { - leftFormFieldId: 'label', - leftRestResponseId: null, - operator: '==', - rightValue: 'aaa', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: 'and', - nextCondition: { - leftFormFieldId: 'label1', - leftRestResponseId: null, - operator: '!=', - rightValue: 'aaa', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: 'and', - nextCondition: { - leftFormFieldId: 'label2', - leftRestResponseId: null, - operator: '!empty', - rightValue: null, - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: 'or', - nextCondition: { - leftFormFieldId: 'label3', - leftRestResponseId: null, - operator: 'empty', - rightValue: null, - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: null, - nextCondition: null + id: 47591, + name: 'Test-visibility', + description: '', + version: 4, + lastUpdatedBy: 13, + lastUpdatedByFullName: 'romano romano', + lastUpdated: '2019-06-11T11: 04: 36.870+0000', + stencilSetId: 0, + referenceId: null, + formDefinition: { + tabs: [], + fields: [ + { + fieldType: 'ContainerRepresentation', + id: '1560246123312', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label', + name: 'Label', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label1', + name: 'Label1', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1560246128696', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label4', + name: 'Label4', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label3', + name: 'Label3', + type: 'text', + value: '', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1560246126964', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label2', + name: 'Label2', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label5', + name: 'Label5', + type: 'boolean', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: { + leftFormFieldId: 'label', + leftRestResponseId: null, + operator: '==', + rightValue: 'aaa', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: 'and', + nextCondition: { + leftFormFieldId: 'label1', + leftRestResponseId: null, + operator: '!=', + rightValue: 'aaa', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: 'and', + nextCondition: { + leftFormFieldId: 'label2', + leftRestResponseId: null, + operator: '!empty', + rightValue: null, + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: 'or', + nextCondition: { + leftFormFieldId: 'label3', + leftRestResponseId: null, + operator: 'empty', + rightValue: null, + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: null, + nextCondition: null + } + } } } } - } - }] + ] + } } - }], - outcomes: [], - javascriptEvents: [], - className: '', - style: '', - customFieldTemplates: {}, - metadata: {}, - variables: [], - customFieldsValueInfo: {}, - gridsterForm: false + ], + outcomes: [], + javascriptEvents: [], + className: '', + style: '', + customFieldTemplates: {}, + metadata: {}, + variables: [], + customFieldsValueInfo: {}, + gridsterForm: false } }; export const complexVisibilityJsonNotVisible: any = { - id: 47591, - name: 'Test-visibility', - description: '', - version: 4, - lastUpdatedBy: 13, - lastUpdatedByFullName: 'romano romano', - lastUpdated: '2019-06-11T11: 04: 36.870+0000', - stencilSetId: 0, - referenceId: null, - formDefinition: { - tabs: [], - fields: [{ - fieldType: 'ContainerRepresentation', - id: '1560246123312', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [{ - fieldType: 'FormFieldRepresentation', - id: 'label', - name: 'Label', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 2 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }], - 2: [{ - fieldType: 'FormFieldRepresentation', - id: 'label1', - name: 'Label1', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 1 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }] - } - }, { - fieldType: 'ContainerRepresentation', - id: '1560246128696', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [{ - fieldType: 'FormFieldRepresentation', - id: 'label4', - name: 'Label4', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 2 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }], - 2: [{ - fieldType: 'FormFieldRepresentation', - id: 'label3', - name: 'Label3', - type: 'text', - value: 'OPSSS', - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 1 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }] - } - }, { - fieldType: 'ContainerRepresentation', - id: '1560246126964', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [{ - fieldType: 'FormFieldRepresentation', - id: 'label2', - name: 'Label2', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 2 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - }], - 2: [{ - fieldType: 'FormFieldRepresentation', - id: 'label5', - name: 'Label5', - type: 'boolean', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: null, - className: null, - params: { existingColspan: 1, maxColspan: 1 }, - dateDisplayFormat: null, - layout: { row: -1, column: -1, colspan: 1 }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: { - leftFormFieldId: 'label', - leftRestResponseId: null, - operator: '==', - rightValue: 'aaa', - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: 'and', - nextCondition: { - leftFormFieldId: 'label1', - leftRestResponseId: null, - operator: '!=', - rightValue: 'aaa', - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: 'and', - nextCondition: { - leftFormFieldId: 'label2', - leftRestResponseId: null, - operator: '!empty', - rightValue: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: 'or', - nextCondition: { - leftFormFieldId: 'label3', - leftRestResponseId: null, - operator: 'empty', - rightValue: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: null, - nextCondition: null + id: 47591, + name: 'Test-visibility', + description: '', + version: 4, + lastUpdatedBy: 13, + lastUpdatedByFullName: 'romano romano', + lastUpdated: '2019-06-11T11: 04: 36.870+0000', + stencilSetId: 0, + referenceId: null, + formDefinition: { + tabs: [], + fields: [ + { + fieldType: 'ContainerRepresentation', + id: '1560246123312', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label', + name: 'Label', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label1', + name: 'Label1', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1560246128696', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label4', + name: 'Label4', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label3', + name: 'Label3', + type: 'text', + value: 'OPSSS', + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ] + } + }, + { + fieldType: 'ContainerRepresentation', + id: '1560246126964', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label2', + name: 'Label2', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 2 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label5', + name: 'Label5', + type: 'boolean', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: null, + className: null, + params: { existingColspan: 1, maxColspan: 1 }, + dateDisplayFormat: null, + layout: { row: -1, column: -1, colspan: 1 }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: { + leftFormFieldId: 'label', + leftRestResponseId: null, + operator: '==', + rightValue: 'aaa', + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: 'and', + nextCondition: { + leftFormFieldId: 'label1', + leftRestResponseId: null, + operator: '!=', + rightValue: 'aaa', + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: 'and', + nextCondition: { + leftFormFieldId: 'label2', + leftRestResponseId: null, + operator: '!empty', + rightValue: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: 'or', + nextCondition: { + leftFormFieldId: 'label3', + leftRestResponseId: null, + operator: 'empty', + rightValue: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: null, + nextCondition: null + } + } } } } - } - }] + ] + } } - }], - outcomes: [], - javascriptEvents: [], - className: '', - style: '', - customFieldTemplates: {}, - metadata: {}, - variables: [], - customFieldsValueInfo: {}, - gridsterForm: false + ], + outcomes: [], + javascriptEvents: [], + className: '', + style: '', + customFieldTemplates: {}, + metadata: {}, + variables: [], + customFieldsValueInfo: {}, + gridsterForm: false } }; @@ -1566,134 +1599,120 @@ export const tabVisibilityJsonMock: any = { referenceId: null, tabs: [ { - id: 'tab1', - title: 'tab1', - visibilityCondition: null + id: 'tab1', + title: 'tab1', + visibilityCondition: null }, { - id: 'tab2', - title: 'Tab2', - visibilityCondition: { - leftFormFieldId: 'label', - leftRestResponseId: null, - operator: '==', - rightValue: 'text', - rightType: null, - rightFormFieldId: '', - rightRestResponseId: '', - nextConditionOperator: '', - nextCondition: null - } + id: 'tab2', + title: 'Tab2', + visibilityCondition: { + leftFormFieldId: 'label', + leftRestResponseId: null, + operator: '==', + rightValue: 'text', + rightType: null, + rightFormFieldId: '', + rightRestResponseId: '', + nextConditionOperator: '', + nextCondition: null + } } - ], + ], formDefinition: { - fields: [ - { - fieldType: 'ContainerRepresentation', - id: '1566806229182', - name: 'Label', - type: 'container', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: 'tab1', - className: null, - dateDisplayFormat: null, - layout: null, - sizeX: 2, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null, - numberOfColumns: 2, - fields: { - 1: [ - { - fieldType: 'FormFieldRepresentation', - id: 'label', - name: 'Label', - type: 'text', - value: null, - required: false, - readOnly: false, - overrideId: false, - colspan: 1, - placeholder: null, - minLength: 0, - maxLength: 0, - minValue: null, - maxValue: null, - regexPattern: null, - optionType: null, - hasEmptyValue: null, - options: null, - restUrl: null, - restResponsePath: null, - restIdProperty: null, - restLabelProperty: null, - tab: 'tab1', - className: null, - params: { - existingColspan: 1, - maxColspan: 2 - }, - dateDisplayFormat: null, - layout: { - row: -1, - column: -1, - colspan: 1 - }, - sizeX: 1, - sizeY: 1, - row: -1, - col: -1, - visibilityCondition: null - } - ], - 2: [ - - ] - } - } - ], - outcomes: [ - - ], - javascriptEvents: [ - - ], - className: '', - style: '', - customFieldTemplates: { - - }, - metadata: { - - }, - variables: [ - - ], - customFieldsValueInfo: { - - }, - gridsterForm: false + fields: [ + { + fieldType: 'ContainerRepresentation', + id: '1566806229182', + name: 'Label', + type: 'container', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: 'tab1', + className: null, + dateDisplayFormat: null, + layout: null, + sizeX: 2, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null, + numberOfColumns: 2, + fields: { + '1': [ + { + fieldType: 'FormFieldRepresentation', + id: 'label', + name: 'Label', + type: 'text', + value: null, + required: false, + readOnly: false, + overrideId: false, + colspan: 1, + placeholder: null, + minLength: 0, + maxLength: 0, + minValue: null, + maxValue: null, + regexPattern: null, + optionType: null, + hasEmptyValue: null, + options: null, + restUrl: null, + restResponsePath: null, + restIdProperty: null, + restLabelProperty: null, + tab: 'tab1', + className: null, + params: { + existingColspan: 1, + maxColspan: 2 + }, + dateDisplayFormat: null, + layout: { + row: -1, + column: -1, + colspan: 1 + }, + sizeX: 1, + sizeY: 1, + row: -1, + col: -1, + visibilityCondition: null + } + ], + '2': [] + } + } + ], + outcomes: [], + javascriptEvents: [], + className: '', + style: '', + customFieldTemplates: {}, + metadata: {}, + variables: [], + customFieldsValueInfo: {}, + gridsterForm: false } - }; +}; export const tabInvalidFormVisibility: any = { id: 'form-0668939d-34b2-440c-ab4d-01ab8b05a881', @@ -1730,7 +1749,7 @@ export const tabInvalidFormVisibility: any = { tab: 'a8a4718d-5019-4852-9645-bba9b8253d86', numberOfColumns: 2, fields: { - 1: [ + '1': [ { id: 'Number1', name: 'Number1', @@ -1770,7 +1789,7 @@ export const tabInvalidFormVisibility: any = { } } ], - 2: [ + '2': [ { id: 'Text2', name: 'Text2', @@ -1797,7 +1816,7 @@ export const tabInvalidFormVisibility: any = { tab: 'bb9033ca-55ef-432a-8120-bffc8a179ebb', numberOfColumns: 2, fields: { - 1: [ + '1': [ { id: 'Text1', name: 'Text1', @@ -1815,7 +1834,7 @@ export const tabInvalidFormVisibility: any = { } } ], - 2: [] + '2': [] } } ], diff --git a/lib/core/src/lib/mock/language.service.mock.ts b/lib/core/src/lib/mock/language.service.mock.ts index 4454860c2ca..653be293c8b 100644 --- a/lib/core/src/lib/mock/language.service.mock.ts +++ b/lib/core/src/lib/mock/language.service.mock.ts @@ -22,31 +22,29 @@ import { LanguageItem } from '../common/services/language-item.interface'; @Injectable() export class LanguageServiceMock implements LanguageServiceInterface { - private languages = new BehaviorSubject([ - {key: 'de', label: 'Deutsch'}, - {key: 'en', label: 'English'}, - {key: 'es', label: 'Español'}, - {key: 'fr', label: 'Français'}, - {key: 'it', label: 'Italiano'}, - {key: 'ja', label: '日本語'}, - {key: 'nb', label: 'Bokmål'}, - {key: 'nl', label: 'Nederlands'}, - {key: 'pt-BR', label: 'Português (Brasil)'}, - {key: 'ru', label: 'Русский'}, - {key: 'zh-CN', label: '中文简体'}, - {key: 'cs', label: 'Čeština'}, - {key: 'da', label: 'Dansk'}, - {key: 'fi', label: 'Suomi'}, - {key: 'pl', label: 'Polski'}, - {key: 'sv', label: 'Svenska'}, - {key: 'ar', label: 'العربية', direction: 'rtl'} + { key: 'de', label: 'Deutsch' }, + { key: 'en', label: 'English' }, + { key: 'es', label: 'Español' }, + { key: 'fr', label: 'Français' }, + { key: 'it', label: 'Italiano' }, + { key: 'ja', label: '日本語' }, + { key: 'nb', label: 'Bokmål' }, + { key: 'nl', label: 'Nederlands' }, + { key: 'pt-BR', label: 'Português (Brasil)' }, + { key: 'ru', label: 'Русский' }, + { key: 'zh-CN', label: '中文简体' }, + { key: 'cs', label: 'Čeština' }, + { key: 'da', label: 'Dansk' }, + { key: 'fi', label: 'Suomi' }, + { key: 'pl', label: 'Polski' }, + { key: 'sv', label: 'Svenska' }, + { key: 'ar', label: 'العربية', direction: 'rtl' } ]); languages$ = this.languages.asObservable(); - changeLanguage(_language: LanguageItem): void { - } + changeLanguage(_language: LanguageItem): void {} setLanguages(items: LanguageItem[]): void { if (items?.length > 0) { diff --git a/lib/core/src/lib/models/pagination.model.ts b/lib/core/src/lib/models/pagination.model.ts index 102cf2c4640..7582006d810 100644 --- a/lib/core/src/lib/models/pagination.model.ts +++ b/lib/core/src/lib/models/pagination.model.ts @@ -16,7 +16,6 @@ */ export class PaginationModel { - merge?: boolean; count?: number; hasMoreItems?: boolean; diff --git a/lib/core/src/lib/models/request-pagination.model.ts b/lib/core/src/lib/models/request-pagination.model.ts index 5ad39280780..37734174100 100644 --- a/lib/core/src/lib/models/request-pagination.model.ts +++ b/lib/core/src/lib/models/request-pagination.model.ts @@ -16,7 +16,6 @@ */ export class RequestPaginationModel { - skipCount?: number; maxItems?: number; diff --git a/lib/core/src/lib/notifications/helpers/notification.factory.ts b/lib/core/src/lib/notifications/helpers/notification.factory.ts index 059c7af3e4d..aabbec0d74c 100644 --- a/lib/core/src/lib/notifications/helpers/notification.factory.ts +++ b/lib/core/src/lib/notifications/helpers/notification.factory.ts @@ -15,13 +15,9 @@ * limitations under the License. */ -import { - NotificationInitiator, - NOTIFICATION_TYPE, - NotificationModel -} from '../models/notification.model'; +import { NotificationInitiator, NOTIFICATION_TYPE, NotificationModel } from '../models/notification.model'; -export const rootInitiator: NotificationInitiator = { +export const rootInitiator: NotificationInitiator = { key: '*', displayName: 'SYSTEM' }; diff --git a/lib/core/src/lib/notifications/services/notification.service.ts b/lib/core/src/lib/notifications/services/notification.service.ts index f21538028cd..4e28134d007 100644 --- a/lib/core/src/lib/notifications/services/notification.service.ts +++ b/lib/core/src/lib/notifications/services/notification.service.ts @@ -21,7 +21,7 @@ import { TranslationService } from '../../translation/translation.service'; import { Subject } from 'rxjs'; import { NotificationModel } from '../models/notification.model'; import { info, warning, error } from '../helpers/notification.factory'; -import { SnackbarContentComponent } from '../../snackbar-content'; +import { SnackbarContentComponent } from '../../snackbar-content'; import { SnackBarData } from '../../snackbar-content/snack-bar-data'; const INFO_SNACK_CLASS = 'adf-info-snackbar'; @@ -34,38 +34,42 @@ const ERROR_SNACK_CLASS = 'adf-error-snackbar'; export class NotificationService { notifications$: Subject = new Subject(); - constructor(private snackBar: MatSnackBar, - private translationService: TranslationService) { - } + constructor(private snackBar: MatSnackBar, private translationService: TranslationService) {} /** * Opens a SnackBar notification to show a message. - * * @param message The message (or resource key) to show. * @param config Time before notification disappears after being shown or MatSnackBarConfig object * @param interpolateArgs The interpolation parameters to add for the translation * @returns Information/control object for the SnackBar */ - openSnackMessage(message: string, config?: number | MatSnackBarConfig>, interpolateArgs?: any): MatSnackBarRef { + openSnackMessage( + message: string, + config?: number | MatSnackBarConfig>, + interpolateArgs?: any + ): MatSnackBarRef { return this.dispatchNotification(message, null, config, interpolateArgs); } /** * Opens a SnackBar notification with a message and a response button. - * * @param message The message (or resource key) to show. * @param action Caption for the response button * @param config Time before notification disappears after being shown or MatSnackBarConfig object * @param interpolateArgs The interpolation parameters to add for the translation * @returns Information/control object for the SnackBar */ - openSnackMessageAction(message: string, action: string, config?: number | MatSnackBarConfig>, interpolateArgs?: any): MatSnackBarRef { + openSnackMessageAction( + message: string, + action: string, + config?: number | MatSnackBarConfig>, + interpolateArgs?: any + ): MatSnackBarRef { return this.dispatchNotification(message, action, config, interpolateArgs); } /** * Rase error message - * * @param message Text message or translation key for the message. * @param action Action name * @param interpolateArgs The interpolation parameters to add for the translation @@ -73,17 +77,21 @@ export class NotificationService { * @returns snackbar reference */ showError(message: string, action?: string, interpolateArgs?: any, showAction = true): MatSnackBarRef { - return this.dispatchNotification(message, action, { - panelClass: ERROR_SNACK_CLASS, - data: { - showAction - } - }, interpolateArgs); + return this.dispatchNotification( + message, + action, + { + panelClass: ERROR_SNACK_CLASS, + data: { + showAction + } + }, + interpolateArgs + ); } /** * Rase info message - * * @param message Text message or translation key for the message. * @param action Action name * @param interpolateArgs The interpolation parameters to add for the translation @@ -91,17 +99,21 @@ export class NotificationService { * @returns snackbar reference */ showInfo(message: string, action?: string, interpolateArgs?: any, showAction = true): MatSnackBarRef { - return this.dispatchNotification(message, action, { - panelClass: INFO_SNACK_CLASS, - data: { - showAction - } - }, interpolateArgs); + return this.dispatchNotification( + message, + action, + { + panelClass: INFO_SNACK_CLASS, + data: { + showAction + } + }, + interpolateArgs + ); } /** * Rase warning message - * * @param message Text message or translation key for the message. * @param action Action name * @param interpolateArgs The interpolation parameters to add for the translation @@ -109,12 +121,17 @@ export class NotificationService { * @returns snackbar reference */ showWarning(message: string, action?: string, interpolateArgs?: any, showAction = true): MatSnackBarRef { - return this.dispatchNotification(message, action, { - panelClass: WARN_SNACK_CLASS, - data: { - showAction - } - }, interpolateArgs); + return this.dispatchNotification( + message, + action, + { + panelClass: WARN_SNACK_CLASS, + data: { + showAction + } + }, + interpolateArgs + ); } /** @@ -126,32 +143,36 @@ export class NotificationService { /** * Push new notification to Notification History - * * @param notification - Notification model to be pushed. */ pushToNotificationHistory(notification: NotificationModel) { this.notifications$.next(notification); } - private dispatchNotification(message: string, action?: string, config?: number | MatSnackBarConfig>, interpolateArgs?: any): MatSnackBarRef { - const translatedMessage: string = this.translationService.instant(message, interpolateArgs); - const translatedAction: string = this.translationService.instant(action, interpolateArgs); - const createNotification = this.getNotificationCreator(config); - this.notifications$.next(createNotification(translatedMessage)); - return this.snackBar.openFromComponent(SnackbarContentComponent, { - ...(typeof config === 'number' && {duration: config}), - panelClass: INFO_SNACK_CLASS, - ...( (typeof config === 'object') ? config : {} ), - data: { - actionLabel: translatedAction, - actionIcon: 'close', - actionIconAriaLabel: 'CLOSE', - message: translatedMessage, - showAction: true, - callActionOnIconClick: false, - ...( (typeof config === 'object') ? config.data : {} ) - } - }); + private dispatchNotification( + message: string, + action?: string, + config?: number | MatSnackBarConfig>, + interpolateArgs?: any + ): MatSnackBarRef { + const translatedMessage: string = this.translationService.instant(message, interpolateArgs); + const translatedAction: string = this.translationService.instant(action, interpolateArgs); + const createNotification = this.getNotificationCreator(config); + this.notifications$.next(createNotification(translatedMessage)); + return this.snackBar.openFromComponent(SnackbarContentComponent, { + ...(typeof config === 'number' && { duration: config }), + panelClass: INFO_SNACK_CLASS, + ...(typeof config === 'object' ? config : {}), + data: { + actionLabel: translatedAction, + actionIcon: 'close', + actionIconAriaLabel: 'CLOSE', + message: translatedMessage, + showAction: true, + callActionOnIconClick: false, + ...(typeof config === 'object' ? config.data : {}) + } + }); } private getNotificationCreator(config?: number | MatSnackBarConfig>) { diff --git a/lib/core/src/lib/pipes/file-size.pipe.spec.ts b/lib/core/src/lib/pipes/file-size.pipe.spec.ts index e01952e28cb..cca97e3b80a 100644 --- a/lib/core/src/lib/pipes/file-size.pipe.spec.ts +++ b/lib/core/src/lib/pipes/file-size.pipe.spec.ts @@ -18,7 +18,6 @@ import { FileSizePipe } from './file-size.pipe'; describe('FileSizePipe', () => { - let pipe: FileSizePipe; beforeEach(() => { @@ -74,14 +73,14 @@ describe('FileSizePipe', () => { it('should convert value with custom precision', () => { const tests = [ - { size: 10, precision: 2, expectancy: '10 Bytes'}, - { size: 1023, precision: 1, expectancy: '1023 Bytes'}, - { size: 1025, precision: 2, expectancy: '1 KB'}, - { size: 1499, precision: 0, expectancy: '1.46 KB'}, - { size: 1999, precision: 0, expectancy: '1.95 KB'}, - { size: 2000, precision: 2, expectancy: '1.95 KB'}, - { size: 5000000, precision: 4, expectancy: '4.7684 MB'}, - { size: 12345678901234, precision: 3, expectancy: '11.228 TB'} + { size: 10, precision: 2, expectancy: '10 Bytes' }, + { size: 1023, precision: 1, expectancy: '1023 Bytes' }, + { size: 1025, precision: 2, expectancy: '1 KB' }, + { size: 1499, precision: 0, expectancy: '1.46 KB' }, + { size: 1999, precision: 0, expectancy: '1.95 KB' }, + { size: 2000, precision: 2, expectancy: '1.95 KB' }, + { size: 5000000, precision: 4, expectancy: '4.7684 MB' }, + { size: 12345678901234, precision: 3, expectancy: '11.228 TB' } ]; tests.forEach(({ size, precision, expectancy }) => { diff --git a/lib/core/src/lib/pipes/full-name.pipe.spec.ts b/lib/core/src/lib/pipes/full-name.pipe.spec.ts index f18caa9f88c..85349c386d0 100644 --- a/lib/core/src/lib/pipes/full-name.pipe.spec.ts +++ b/lib/core/src/lib/pipes/full-name.pipe.spec.ts @@ -18,7 +18,6 @@ import { FullNamePipe } from './full-name.pipe'; describe('FullNamePipe', () => { - let pipe: FullNamePipe; beforeEach(() => { @@ -31,27 +30,27 @@ describe('FullNamePipe', () => { }); it('should return only firstName as fullName when there is no lastName ', () => { - const user = {firstName : 'Abc'}; + const user = { firstName: 'Abc' }; expect(pipe.transform(user)).toBe('Abc'); }); it('should return only lastName as fullName when there is no firstName ', () => { - const user = {lastName : 'Xyz'}; + const user = { lastName: 'Xyz' }; expect(pipe.transform(user)).toBe('Xyz'); }); it('should return fullName when firstName and lastName are available', () => { - const user = {firstName : 'Abc', lastName : 'Xyz'}; + const user = { firstName: 'Abc', lastName: 'Xyz' }; expect(pipe.transform(user)).toBe('Abc Xyz'); }); it('should return username when firstName and lastName are not available', () => { - const user = {firstName : '', lastName : '', username: 'username'}; + const user = { firstName: '', lastName: '', username: 'username' }; expect(pipe.transform(user)).toBe('username'); }); it('should return user eamil when firstName, lastName and username are not available', () => { - const user = {firstName : '', lastName : '', username: '', email: 'abcXyz@gmail.com'}; + const user = { firstName: '', lastName: '', username: '', email: 'abcXyz@gmail.com' }; expect(pipe.transform(user)).toBe('abcXyz@gmail.com'); }); }); diff --git a/lib/core/src/lib/pipes/localized-date.pipe.ts b/lib/core/src/lib/pipes/localized-date.pipe.ts index 0592125fe2d..0364941dbda 100644 --- a/lib/core/src/lib/pipes/localized-date.pipe.ts +++ b/lib/core/src/lib/pipes/localized-date.pipe.ts @@ -28,7 +28,6 @@ import { takeUntil } from 'rxjs/operators'; pure: false }) export class LocalizedDatePipe implements PipeTransform, OnDestroy { - static DEFAULT_LOCALE = 'en-US'; static DEFAULT_DATE_FORMAT = 'mediumDate'; @@ -37,14 +36,12 @@ export class LocalizedDatePipe implements PipeTransform, OnDestroy { private onDestroy$ = new Subject(); - constructor(public userPreferenceService?: UserPreferencesService, - public appConfig?: AppConfigService) { - + constructor(public userPreferenceService?: UserPreferencesService, public appConfig?: AppConfigService) { if (this.userPreferenceService) { this.userPreferenceService .select(UserPreferenceValues.Locale) .pipe(takeUntil(this.onDestroy$)) - .subscribe(locale => { + .subscribe((locale) => { if (locale) { this.defaultLocale = locale; } @@ -67,5 +64,4 @@ export class LocalizedDatePipe implements PipeTransform, OnDestroy { this.onDestroy$.next(true); this.onDestroy$.complete(); } - } diff --git a/lib/core/src/lib/pipes/time-ago.pipe.ts b/lib/core/src/lib/pipes/time-ago.pipe.ts index df0eae8c348..5c30ba8bc2e 100644 --- a/lib/core/src/lib/pipes/time-ago.pipe.ts +++ b/lib/core/src/lib/pipes/time-ago.pipe.ts @@ -29,7 +29,6 @@ import * as Locales from 'date-fns/locale'; name: 'adfTimeAgo' }) export class TimeAgoPipe implements PipeTransform, OnDestroy { - static DEFAULT_LOCALE = 'en-US'; static DEFAULT_DATE_TIME_FORMAT = 'dd/MM/yyyy HH:mm'; @@ -38,28 +37,25 @@ export class TimeAgoPipe implements PipeTransform, OnDestroy { private onDestroy$ = new Subject(); - constructor( - public userPreferenceService: UserPreferencesService, - public appConfig: AppConfigService - ) { + constructor(public userPreferenceService: UserPreferencesService, public appConfig: AppConfigService) { this.userPreferenceService .select(UserPreferenceValues.Locale) .pipe(takeUntil(this.onDestroy$)) - .subscribe(locale => { + .subscribe((locale) => { this.defaultLocale = locale || TimeAgoPipe.DEFAULT_LOCALE; }); this.defaultDateTimeFormat = this.appConfig.get('dateValues.defaultDateTimeFormat', TimeAgoPipe.DEFAULT_DATE_TIME_FORMAT); } transform(value: Date, locale?: string) { - if (value !== null && value !== undefined ) { + if (value !== null && value !== undefined) { const actualLocale = locale || this.defaultLocale; const diff = differenceInDays(new Date(), new Date(value)); - if ( diff > 7) { + if (diff > 7) { const datePipe: DatePipe = new DatePipe(actualLocale); return datePipe.transform(value, this.defaultDateTimeFormat); } else { - return formatDistance(new Date(value) , new Date(), { addSuffix: true , locale: Locales[actualLocale] }); + return formatDistance(new Date(value), new Date(), { addSuffix: true, locale: Locales[actualLocale] }); } } return ''; diff --git a/lib/core/src/lib/pipes/user-initial.pipe.spec.ts b/lib/core/src/lib/pipes/user-initial.pipe.spec.ts index 1d2a5e01349..b2b74a3c08b 100644 --- a/lib/core/src/lib/pipes/user-initial.pipe.spec.ts +++ b/lib/core/src/lib/pipes/user-initial.pipe.spec.ts @@ -20,7 +20,6 @@ import { User } from '../models/general-user.model'; import { InitialUsernamePipe } from './user-initial.pipe'; class FakeSanitizer extends DomSanitizer { - constructor() { super(); } @@ -51,7 +50,6 @@ class FakeSanitizer extends DomSanitizer { } describe('UserInitialPipe', () => { - let pipe: InitialUsernamePipe; let fakeUser: User; diff --git a/lib/core/src/lib/pipes/user-like.interface.ts b/lib/core/src/lib/pipes/user-like.interface.ts index 4e6daf35bec..c7d0fc722c6 100644 --- a/lib/core/src/lib/pipes/user-like.interface.ts +++ b/lib/core/src/lib/pipes/user-like.interface.ts @@ -20,4 +20,4 @@ export interface UserLike { firstName?: string; lastName?: string; email?: string; -}; +} diff --git a/lib/core/src/lib/progress/progress.component.ts b/lib/core/src/lib/progress/progress.component.ts index 4aee6821189..72504dfa2d2 100644 --- a/lib/core/src/lib/progress/progress.component.ts +++ b/lib/core/src/lib/progress/progress.component.ts @@ -45,7 +45,6 @@ export class ProgressComponent { /** * The value of the progress bar or spinner. * Changes the mode to `determinate` if a value is provided. - * * @returns The progress value */ get value(): number | undefined { @@ -65,7 +64,6 @@ export class ProgressComponent { * * For progress spinner, the mode can be either `indeterminate` or `determinate`. * For progress bar, the mode can be either `determinate`, `indeterminate`, `buffer`, or `query`. - * * @returns The progress mode */ get mode(): ProgressMode { diff --git a/lib/core/src/lib/search-text/animations.ts b/lib/core/src/lib/search-text/animations.ts index 5d343c6cd83..c1bae5a6a16 100644 --- a/lib/core/src/lib/search-text/animations.ts +++ b/lib/core/src/lib/search-text/animations.ts @@ -18,16 +18,24 @@ import { trigger, transition, animate, style, state, AnimationTriggerMetadata } from '@angular/animations'; export const searchAnimation: AnimationTriggerMetadata = trigger('transitionMessages', [ - state('active', style({ - 'margin-left': '{{ margin-left }}px', - 'margin-right': '{{ margin-right }}px', - transform: '{{ transform }}' - }), { params: { 'margin-left': 0, 'margin-right': 0, transform: 'translateX(0%)' } }), - state('inactive', style({ - 'margin-left': '{{ margin-left }}px', - 'margin-right': '{{ margin-right }}px', - transform: '{{ transform }}' - }), { params: { 'margin-left': 0, 'margin-right': 0, transform: 'translateX(0%)' } }), + state( + 'active', + style({ + 'margin-left': '{{ margin-left }}px', + 'margin-right': '{{ margin-right }}px', + transform: '{{ transform }}' + }), + { params: { 'margin-left': 0, 'margin-right': 0, transform: 'translateX(0%)' } } + ), + state( + 'inactive', + style({ + 'margin-left': '{{ margin-left }}px', + 'margin-right': '{{ margin-right }}px', + transform: '{{ transform }}' + }), + { params: { 'margin-left': 0, 'margin-right': 0, transform: 'translateX(0%)' } } + ), state('no-animation', style({ transform: 'translateX(0%)', width: '100%' })), transition('active <=> inactive', animate('400ms cubic-bezier(0.25, 0.8, 0.25, 1)')) ]); diff --git a/lib/core/src/lib/search-text/search-text-input.component.spec.ts b/lib/core/src/lib/search-text/search-text-input.component.spec.ts index 0ff63642b93..5118b58dfeb 100644 --- a/lib/core/src/lib/search-text/search-text-input.component.spec.ts +++ b/lib/core/src/lib/search-text/search-text-input.component.spec.ts @@ -182,7 +182,6 @@ describe('SearchTextInputComponent', () => { /** * Runs a test for ltr/rtl margin values - * * @param isLtr sets ltr or rtl value to test */ function testMarginValue(isLtr: boolean): void { @@ -203,7 +202,6 @@ describe('SearchTextInputComponent', () => { /** * Runs a test for ltr/rtl transform values - * * @param isLtr sets ltr or rtl value to test */ function testTransformValue(isLtr: boolean): void { diff --git a/lib/core/src/lib/services/startup-service-factory.ts b/lib/core/src/lib/services/startup-service-factory.ts index ad603654827..e1ff18dc20a 100644 --- a/lib/core/src/lib/services/startup-service-factory.ts +++ b/lib/core/src/lib/services/startup-service-factory.ts @@ -20,7 +20,6 @@ import { StorageService } from '../common/services/storage.service'; /** * Loads application config file - * * @param appConfigService configuration service * @param storageService storage service * @returns a factory to load application config diff --git a/lib/core/src/lib/snackbar-content/snackbar-content.component.ts b/lib/core/src/lib/snackbar-content/snackbar-content.component.ts index 2130c135450..5bceba9da22 100644 --- a/lib/core/src/lib/snackbar-content/snackbar-content.component.ts +++ b/lib/core/src/lib/snackbar-content/snackbar-content.component.ts @@ -28,12 +28,9 @@ import { SnackBarData } from './snack-bar-data'; } }) export class SnackbarContentComponent { - constructor( - public snackBarRef: MatSnackBarRef, - @Inject(MAT_SNACK_BAR_DATA) public data: SnackBarData - ) { + constructor(public snackBarRef: MatSnackBarRef, @Inject(MAT_SNACK_BAR_DATA) public data: SnackBarData) { if (!data) { - this.data = {message: ''}; + this.data = { message: '' }; } } diff --git a/lib/core/src/lib/snackbar-content/snackbar-content.module.ts b/lib/core/src/lib/snackbar-content/snackbar-content.module.ts index 7ca0098ac38..0fc54673695 100644 --- a/lib/core/src/lib/snackbar-content/snackbar-content.module.ts +++ b/lib/core/src/lib/snackbar-content/snackbar-content.module.ts @@ -24,18 +24,8 @@ import { MatButtonModule } from '@angular/material/button'; import { TranslateModule } from '@ngx-translate/core'; @NgModule({ - imports: [ - CommonModule, - MatIconModule, - MatSnackBarModule, - MatButtonModule, - TranslateModule - ], - declarations: [ - SnackbarContentComponent - ], - exports: [ - SnackbarContentComponent - ] + imports: [CommonModule, MatIconModule, MatSnackBarModule, MatButtonModule, TranslateModule], + declarations: [SnackbarContentComponent], + exports: [SnackbarContentComponent] }) export class SnackbarContentModule {} diff --git a/lib/core/src/lib/sorting-picker/sorting-picker.component.spec.ts b/lib/core/src/lib/sorting-picker/sorting-picker.component.spec.ts index d8f07f7f0f8..4f60aec1100 100644 --- a/lib/core/src/lib/sorting-picker/sorting-picker.component.spec.ts +++ b/lib/core/src/lib/sorting-picker/sorting-picker.component.spec.ts @@ -18,7 +18,6 @@ import { SortingPickerComponent } from './sorting-picker.component'; describe('SortingPickerComponent', () => { - let component: SortingPickerComponent; beforeEach(() => { @@ -28,7 +27,7 @@ describe('SortingPickerComponent', () => { it('should raise changed event on changing value', (done) => { component.selected = 'key1'; - component.valueChange.subscribe((key: string) => { + component.valueChange.subscribe((key: string) => { expect(key).toBe('key2'); done(); }); @@ -38,7 +37,7 @@ describe('SortingPickerComponent', () => { it('should raise changed event on changing direction', (done) => { component.ascending = false; - component.sortingChange.subscribe((ascending: boolean) => { + component.sortingChange.subscribe((ascending: boolean) => { expect(ascending).toBeTruthy(); done(); }); diff --git a/lib/core/src/lib/translation/translation.service.spec.ts b/lib/core/src/lib/translation/translation.service.spec.ts index d53dba5fa05..11ee4cd8175 100644 --- a/lib/core/src/lib/translation/translation.service.spec.ts +++ b/lib/core/src/lib/translation/translation.service.spec.ts @@ -67,7 +67,7 @@ describe('TranslationService', () => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'application/json', - responseText: JSON.stringify({TEST: 'This is a test', TEST2: 'This is another test'}) + responseText: JSON.stringify({ TEST: 'This is a test', TEST2: 'This is another test' }) }); }); @@ -79,7 +79,7 @@ describe('TranslationService', () => { jasmine.Ajax.requests.mostRecent().respondWith({ status: 200, contentType: 'application/json', - responseText: JSON.stringify({TEST: 'This is a test', TEST2: 'This is another test'}) + responseText: JSON.stringify({ TEST: 'This is a test', TEST2: 'This is another test' }) }); }); diff --git a/lib/core/src/lib/translation/translation.service.ts b/lib/core/src/lib/translation/translation.service.ts index a105fa5c262..8fd786badbf 100644 --- a/lib/core/src/lib/translation/translation.service.ts +++ b/lib/core/src/lib/translation/translation.service.ts @@ -30,7 +30,6 @@ export interface TranslationProvider { /** * Generate translation provider - * * @param id Unique identifier * @param path Path to translation files * @returns Provider @@ -54,9 +53,11 @@ export class TranslationService { userLang: string; customLoader: TranslateLoaderService; - constructor(public translate: TranslateService, - userPreferencesService: UserPreferencesService, - @Optional() @Inject(TRANSLATION_PROVIDER) providers: TranslationProvider[]) { + constructor( + public translate: TranslateService, + userPreferencesService: UserPreferencesService, + @Optional() @Inject(TRANSLATION_PROVIDER) providers: TranslationProvider[] + ) { this.customLoader = this.translate.currentLoader as TranslateLoaderService; this.defaultLang = 'en'; @@ -79,7 +80,6 @@ export class TranslationService { /** * Adds a new folder of translation source files. - * * @param name Name for the translation provider * @param path Path to the folder */ @@ -97,7 +97,6 @@ export class TranslationService { /** * Loads a translation file. - * * @param lang Language code for the language to load * @param fallback Language code to fall back to if the first one was unavailable */ @@ -117,7 +116,6 @@ export class TranslationService { /** * Triggers a notification callback when the translation language changes. - * * @param lang The new language code */ onTranslationChanged(lang: string): void { @@ -129,7 +127,6 @@ export class TranslationService { /** * Sets the target language for translations. - * * @param lang Code name for the language * @returns Translations available for the language */ @@ -140,7 +137,6 @@ export class TranslationService { /** * Gets the translation for the supplied key. - * * @param key Key to translate * @param interpolateParams String(s) to be interpolated into the main message * @returns Translated text @@ -151,7 +147,6 @@ export class TranslationService { /** * Directly returns the translation for the supplied key. - * * @param key Key to translate * @param interpolateParams String(s) to be interpolated into the main message * @returns Translated text diff --git a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts index 1014f9ad190..53e97f13366 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer/pdf-viewer.component.ts @@ -292,7 +292,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Method to scale the page current support implementation - * * @param scaleMode - new scale mode */ scalePage(scaleMode: PdfScaleMode) { @@ -400,7 +399,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Update all the pages with the newScale scale - * * @param newScale - new scale page */ setScaleUpdatePages(newScale: number) { @@ -416,7 +414,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Check if the request scale of the page is the same for avoid useless re-rendering - * * @param oldScale - old scale page * @param newScale - new scale page * @returns `true` if the scale is the same, otherwise `false` @@ -427,7 +424,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Check if is a land scape view - * * @param width target width * @param height target height * @returns `true` if the target is in the landscape mode, otherwise `false` @@ -456,7 +452,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * zoom in page pdf - * * @param ticks number of ticks to zoom */ zoomIn(ticks?: number): void { @@ -472,7 +467,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * zoom out page pdf - * * @param ticks number of ticks to scale */ zoomOut(ticks?: number): void { @@ -512,7 +506,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * load the page in input - * * @param page to load */ inputPage(page: string) { @@ -529,7 +522,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Page Change Event - * * @param event event */ onPageChange(event: any) { @@ -572,7 +564,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Keyboard Event Listener - * * @param event KeyboardEvent */ @HostListener('document:keydown', ['$event']) diff --git a/lib/core/src/lib/viewer/components/viewer-render/viewer-render.component.ts b/lib/core/src/lib/viewer/components/viewer-render/viewer-render.component.ts index e3b49764dec..e7931344d73 100644 --- a/lib/core/src/lib/viewer/components/viewer-render/viewer-render.component.ts +++ b/lib/core/src/lib/viewer/components/viewer-render/viewer-render.component.ts @@ -142,7 +142,6 @@ export class ViewerRenderComponent implements OnChanges, OnInit, OnDestroy { /** * Returns a list of the active Viewer content extensions. - * * @returns list of extension references */ get viewerExtensions(): ViewerExtensionRef[] { @@ -151,7 +150,6 @@ export class ViewerRenderComponent implements OnChanges, OnInit, OnDestroy { /** * Provides a list of file extensions supported by external plugins. - * * @returns list of extensions */ get externalExtensions(): string[] { diff --git a/lib/core/src/lib/viewer/directives/viewer-extension.directive.ts b/lib/core/src/lib/viewer/directives/viewer-extension.directive.ts index 74db01c363f..05d81c37fac 100644 --- a/lib/core/src/lib/viewer/directives/viewer-extension.directive.ts +++ b/lib/core/src/lib/viewer/directives/viewer-extension.directive.ts @@ -60,7 +60,6 @@ export class ViewerExtensionDirective implements AfterContentInit, OnDestroy { /** * Check if the current extension in the viewer is compatible with this extension checking against `supportedExtensions` - * * @param fileExtension file extension to check * @returns `true` if file extension is compatible, otherwise `false` */ diff --git a/lib/core/src/lib/viewer/services/rendering-queue.services.ts b/lib/core/src/lib/viewer/services/rendering-queue.services.ts index 32f88a38659..257219d78e7 100644 --- a/lib/core/src/lib/viewer/services/rendering-queue.services.ts +++ b/lib/core/src/lib/viewer/services/rendering-queue.services.ts @@ -44,7 +44,6 @@ export class RenderingQueueServices { /** * Set the instance of the PDF Viewer - * * @param pdfViewer viewer instance */ setViewer(pdfViewer): void { @@ -53,7 +52,6 @@ export class RenderingQueueServices { /** * Sets the instance of the PDF Thumbnail Viewer - * * @param pdfThumbnailViewer viewer instance */ setThumbnailViewer(pdfThumbnailViewer): void { @@ -62,7 +60,6 @@ export class RenderingQueueServices { /** * Check if the view has highest rendering priority - * * @param view view to render * @returns `true` if the view has higher priority, otherwise `false` */ @@ -140,7 +137,6 @@ export class RenderingQueueServices { /** * Checks if the view rendering is finished - * * @param view the View instance to check * @returns `true` if rendering is finished, otherwise `false` */ @@ -152,7 +148,6 @@ export class RenderingQueueServices { * Render a page or thumbnail view. This calls the appropriate function * based on the views state. If the view is already rendered it will return * false. - * * @param view View instance to render * @returns the rendered state of the view */ diff --git a/lib/core/src/lib/viewer/services/view-util.service.ts b/lib/core/src/lib/viewer/services/view-util.service.ts index c9ee939b689..2fe560cdbce 100644 --- a/lib/core/src/lib/viewer/services/view-util.service.ts +++ b/lib/core/src/lib/viewer/services/view-util.service.ts @@ -40,7 +40,6 @@ export class ViewUtilService { /** * Returns a list of the active Viewer content extensions. - * * @returns list of extension references */ get viewerExtensions(): ViewerExtensionRef[] { @@ -49,7 +48,6 @@ export class ViewUtilService { /** * Provides a list of file extensions supported by external plugins. - * * @returns list of extensions */ get externalExtensions(): string[] { @@ -60,7 +58,6 @@ export class ViewUtilService { /** * get File name from url - * * @param url - url file * @returns file name portion of the url */ @@ -76,7 +73,6 @@ export class ViewUtilService { * Supports the URL formats like: * http://localhost/test.jpg?cache=1000 * http://localhost/test.jpg#cache=1000 - * * @param fileName - file name * @returns file extension */ diff --git a/lib/process-services-cloud/.eslintrc.json b/lib/process-services-cloud/.eslintrc.json index a49f042f37b..508bc5daa8a 100644 --- a/lib/process-services-cloud/.eslintrc.json +++ b/lib/process-services-cloud/.eslintrc.json @@ -10,7 +10,7 @@ "createDefaultProgram": true }, "rules": { - "jsdoc/newline-after-description": "warn", + "jsdoc/tag-lines": [1], "@typescript-eslint/naming-convention": "warn", "@typescript-eslint/consistent-type-assertions": "warn", "@typescript-eslint/prefer-for-of": "warn", diff --git a/lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts b/lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts index 04145244525..b85f874b273 100644 --- a/lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts +++ b/lib/process-services-cloud/src/lib/form/models/task-variable-cloud.model.ts @@ -28,6 +28,6 @@ export class TaskVariableCloud { } hasValue(obj: TaskVariableCloud): boolean { - return typeof obj.value !== undefined && obj.value !== null; + return obj.value !== undefined && obj.value !== null; } } diff --git a/lib/process-services-cloud/tsconfig.lib.json b/lib/process-services-cloud/tsconfig.lib.json index d35d16bd088..a9878d0d297 100644 --- a/lib/process-services-cloud/tsconfig.lib.json +++ b/lib/process-services-cloud/tsconfig.lib.json @@ -17,5 +17,6 @@ }, "target": "ES2022", "useDefineForClassFields": false - } + }, + "include": ["src/**/*.ts", "index.ts"] } diff --git a/lib/process-services-cloud/tsconfig.spec.json b/lib/process-services-cloud/tsconfig.spec.json index 453376cfd93..6af39a93533 100644 --- a/lib/process-services-cloud/tsconfig.spec.json +++ b/lib/process-services-cloud/tsconfig.spec.json @@ -6,5 +6,5 @@ "useDefineForClassFields": false }, "files": ["src/test.ts"], - "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] + "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts", "index.ts"] } diff --git a/lib/process-services/.eslintrc.json b/lib/process-services/.eslintrc.json index c90bbe7f8c7..0ac4be2c40f 100644 --- a/lib/process-services/.eslintrc.json +++ b/lib/process-services/.eslintrc.json @@ -10,7 +10,7 @@ "createDefaultProgram": true }, "rules": { - "jsdoc/newline-after-description": "warn", + "jsdoc/tag-lines": [1], "@typescript-eslint/naming-convention": "warn", "@typescript-eslint/consistent-type-assertions": "warn", "@typescript-eslint/prefer-for-of": "warn", diff --git a/lib/process-services/src/lib/form/start-form/start-form.component.ts b/lib/process-services/src/lib/form/start-form/start-form.component.ts index 0acb308d013..08ec2332be5 100644 --- a/lib/process-services/src/lib/form/start-form/start-form.component.ts +++ b/lib/process-services/src/lib/form/start-form/start-form.component.ts @@ -141,7 +141,6 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn this.onFormLoaded(this.form); } - /** @override */ isOutcomeButtonVisible(outcome: FormOutcomeModel, isFormReadOnly: boolean): boolean { if (outcome?.isSystem && (outcome.name === FormOutcomeModel.SAVE_ACTION || outcome.name === FormOutcomeModel.COMPLETE_ACTION)) { return false; @@ -151,12 +150,10 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn return super.isOutcomeButtonVisible(outcome, isFormReadOnly); } - /** @override */ saveTaskForm() { // do nothing } - /** @override */ onRefreshClicked() { if (this.processDefinitionId) { this.visibilityService.cleanProcessVariable(); diff --git a/lib/process-services/tsconfig.lib.json b/lib/process-services/tsconfig.lib.json index 44cefaec4b0..6cace1e66b5 100644 --- a/lib/process-services/tsconfig.lib.json +++ b/lib/process-services/tsconfig.lib.json @@ -16,5 +16,6 @@ }, "target": "ES2022", "useDefineForClassFields": false - } + }, + "include": ["src/**/*.ts", "index.ts"] } diff --git a/lib/process-services/tsconfig.spec.json b/lib/process-services/tsconfig.spec.json index 7d643cc4b89..a4222287d33 100644 --- a/lib/process-services/tsconfig.spec.json +++ b/lib/process-services/tsconfig.spec.json @@ -6,5 +6,5 @@ "useDefineForClassFields": false }, "files": ["src/test.ts"], - "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] + "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts", "index.ts"] }