From bb1de946031ce60dc334e1f8ee12398df6493b4b Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Tue, 4 Aug 2026 19:22:37 +0200 Subject: [PATCH 01/33] Story #16471: Clean code - stricter compiler options --- .../src/app/agency/agency-list/agency-list.component.ts | 3 ++- .../services/path-strategy-display-object.service.spec.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts index 4eb398dbd6f..753302ff2d5 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts @@ -43,14 +43,15 @@ import type { AdminUserProfile, Agency } from 'vitamui-library'; import { AgencyService, ApplicationId, - DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, PageRequest, Role, SecurityService, + DEFAULT_PAGE_SIZE, VitamUICommonModule, } from 'vitamui-library'; +import type { Agency, AdminUserProfile } from 'vitamui-library'; import { AgencyCreateModule } from '../agency-create/agency-create.module'; import { ImportDialogModule } from '../../shared/import-dialog/import-dialog.module'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts index 8554ea2f97a..6dade35e6c0 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts @@ -38,7 +38,7 @@ import { TestBed } from '@angular/core/testing'; import { LoggerModule } from '../../logger/logger.module'; import { Mode } from '../models/display-object.enum'; import { DisplayObject } from '../models/display-object.model'; -import { DisplayRule } from '../models/display-rule.model'; +import { DisplayRule, Mode } from '../models/display-rule.model'; import { DisplayObjectType } from '../types'; import { DataStructureService } from './data-structure.service'; import { DisplayObjectHelperService } from './display-object-helper.service'; From c16b13d541067671837396ee6cd0ea962be6f8eb Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Tue, 18 Aug 2026 14:28:01 +0200 Subject: [PATCH 02/33] Story #16471: Clean code - remove barrel files --- .../src/app/agency/agency-list/agency-list.component.ts | 3 +-- .../services/path-strategy-display-object.service.spec.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts index 753302ff2d5..4eb398dbd6f 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts @@ -43,15 +43,14 @@ import type { AdminUserProfile, Agency } from 'vitamui-library'; import { AgencyService, ApplicationId, + DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, PageRequest, Role, SecurityService, - DEFAULT_PAGE_SIZE, VitamUICommonModule, } from 'vitamui-library'; -import type { Agency, AdminUserProfile } from 'vitamui-library'; import { AgencyCreateModule } from '../agency-create/agency-create.module'; import { ImportDialogModule } from '../../shared/import-dialog/import-dialog.module'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts index 6dade35e6c0..8554ea2f97a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/services/path-strategy-display-object.service.spec.ts @@ -38,7 +38,7 @@ import { TestBed } from '@angular/core/testing'; import { LoggerModule } from '../../logger/logger.module'; import { Mode } from '../models/display-object.enum'; import { DisplayObject } from '../models/display-object.model'; -import { DisplayRule, Mode } from '../models/display-rule.model'; +import { DisplayRule } from '../models/display-rule.model'; import { DisplayObjectType } from '../types'; import { DataStructureService } from './data-structure.service'; import { DisplayObjectHelperService } from './display-object-helper.service'; From 22a2b27051f2dfd2bc375bd529a4bbe179cace55 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 19 Aug 2026 17:16:58 +0200 Subject: [PATCH 03/33] Story #16471: Clean code - use standalone components --- .../src/app/app.component.spec.ts | 3 +- .../archive-search/src/app/app.component.ts | 4 +- .../archive-search/src/app/app.module.ts | 82 ---- .../archive-preview.component.spec.ts | 14 +- .../archive-preview.component.ts | 44 ++- .../archive-unit-description-tab.component.ts | 9 +- ...ive-unit-information-tab.component.spec.ts | 14 +- .../archive-unit-information-tab.component.ts | 8 +- ...unit-objects-details-tab.component.spec.ts | 3 +- ...hive-unit-objects-details-tab.component.ts | 9 +- ...e-unit-rules-details-tab.component.spec.ts | 6 +- ...rchive-unit-rules-details-tab.component.ts | 5 +- ...t-rules-informations-tab.component.spec.ts | 8 +- ...e-unit-rules-informations-tab.component.ts | 9 +- .../dip-request-create.component.spec.ts | 3 +- .../dip-request-create.component.ts | 37 +- .../add-management-rules.component.spec.ts | 3 +- .../add-management-rules.component.ts | 27 +- .../add-update-property.component.spec.ts | 6 +- .../add-update-property.component.ts | 7 +- .../archive-unit-rules.component.spec.ts | 3 +- .../archive-unit-rules.component.ts | 21 +- ...ock-category-inheritance.component.spec.ts | 6 +- .../block-category-inheritance.component.ts | 6 +- .../block-rules-inheritance.component.spec.ts | 6 +- .../block-rules-inheritance.component.ts | 18 +- .../delete-unit-rules.component.spec.ts | 3 +- .../delete-unit-rules.component.ts | 19 +- ...ock-category-inheritance.component.spec.ts | 6 +- .../unlock-category-inheritance.component.ts | 16 +- ...unlock-rules-inheritance.component.spec.ts | 3 +- .../unlock-rules-inheritance.component.ts | 19 +- .../update-unit-rules.component.spec.ts | 3 +- .../update-unit-rules.component.ts | 27 +- .../management-rules.component.spec.ts | 6 +- .../management-rules.component.ts | 25 +- .../reassignment-dialog.service.spec.ts | 3 +- .../preservation-dialog.service.spec.ts | 3 +- .../preservation-dialog.service.ts | 3 +- .../transfer-request-modal.component.spec.ts | 6 +- .../transfer-request-modal.component.ts | 35 +- .../archive-search-rules-facets.component.ts | 19 +- .../search-access-rules-facets.component.ts | 7 +- ...search-appraisal-rules-facets.component.ts | 7 +- ...ch-dissemination-rules-facets.component.ts | 7 +- .../search-reuse-rules-facets.component.ts | 7 +- .../search-storage-rules-facets.component.ts | 7 +- .../archive-search.component.spec.ts | 3 +- .../archive-search.component.ts | 85 +++- .../confirm-action.component.ts | 14 +- .../confirm-action/confirm-action.module.ts | 49 --- .../search-criteria-list.component.spec.ts | 8 +- .../search-criteria-list.component.ts | 9 +- .../search-criteria-saver.component.spec.ts | 8 +- .../search-criteria-saver.component.ts | 9 +- .../simple-criteria-search.component.spec.ts | 3 +- .../simple-criteria-search.component.ts | 71 +++- ...cription-criteria-search.component.spec.ts | 6 +- ...d-description-criteria-search.component.ts | 62 ++- .../transfer-acknowledgment.component.spec.ts | 11 +- .../src/app/archive/archive.component.spec.ts | 2 +- .../src/app/archive/archive.component.ts | 26 +- .../src/app/archive/archive.module.ts | 5 +- .../src/app/archive/archive.service.spec.ts | 3 +- .../archive-facets.service.spec.ts | 3 +- .../archive-unit-elimination.service.ts | 3 +- .../update-unit-management-rule.service.ts | 3 +- .../criteria-search.component.spec.ts | 2 +- .../criteria-search.component.ts | 9 +- .../classification-tree.component.ts | 27 +- .../filing-holding-scheme.component.spec.ts | 5 +- .../filing-holding-scheme.component.ts | 7 +- .../leaves-tree/leaves-tree.component.spec.ts | 2 +- .../leaves-tree/leaves-tree.component.ts | 20 +- .../found-object-modal.component.spec.ts | 6 +- .../found-object-modal.component.ts | 6 +- ...istent-identifier-search.component.spec.ts | 3 +- .../persistent-identifier-search.component.ts | 12 +- .../persistent-identifier-search.module.ts | 4 +- ...sistent-identifier-modal.component.spec.ts | 3 +- ...d-persistent-identifier-modal.component.ts | 7 +- .../archive-unit-validator.service.ts | 3 +- .../app/core/api/archive-api.service.spec.ts | 3 +- .../src/app/core/core.module.ts | 3 +- .../projects/archive-search/src/main.ts | 45 ++- .../collect/src/app/app.component.spec.ts | 3 +- .../projects/collect/src/app/app.component.ts | 4 +- .../projects/collect/src/app/app.module.ts | 83 ---- .../add-units/add-units.component.spec.ts | 6 +- .../add-units/add-units.component.ts | 48 ++- .../archive-preview.component.spec.ts | 14 +- .../archive-preview.component.ts | 43 +- .../archive-unit-description-tab.component.ts | 17 +- .../archive-unit-information-tab.component.ts | 8 +- ...e-unit-rules-details-tab.component.spec.ts | 6 +- ...rchive-unit-rules-details-tab.component.ts | 5 +- ...t-rules-informations-tab.component.spec.ts | 8 +- ...e-unit-rules-informations-tab.component.ts | 9 +- ...object-group-details-tab.component.spec.ts | 10 +- ...lect-object-group-details-tab.component.ts | 18 +- .../archive-search-collect.component.spec.ts | 4 +- .../archive-search-collect.component.ts | 99 ++++- .../archive-search-collect.module.ts | 5 +- .../archive-search-rules-facets.component.ts | 19 +- .../search-access-rules-facets.component.ts | 7 +- ...search-appraisal-rules-facets.component.ts | 7 +- ...ch-dissemination-rules-facets.component.ts | 7 +- .../search-reuse-rules-facets.component.ts | 7 +- .../search-storage-rules-facets.component.ts | 7 +- .../criteria-search.component.ts | 9 +- .../classification-tree.component.ts | 27 +- .../filing-holding-scheme.component.spec.ts | 5 +- .../filing-holding-scheme.component.ts | 7 +- .../leaves-tree/leaves-tree.component.spec.ts | 3 +- .../leaves-tree/leaves-tree.component.ts | 28 +- .../confirm-action.component.ts | 14 +- .../confirm-action/confirm-action.module.ts | 50 --- .../search-criteria-list.component.spec.ts | 15 +- .../search-criteria-list.component.ts | 9 +- .../search-criteria-saver.component.spec.ts | 15 +- .../search-criteria-saver.component.ts | 18 +- .../simple-criteria-search.component.ts | 68 +++- ...-criteria-search-collect.component.spec.ts | 12 +- ...ption-criteria-search-collect.component.ts | 62 ++- .../update-units-metadata.component.spec.ts | 6 +- .../update-units-metadata.component.ts | 30 +- .../core/api/project-api.service.spec.ts | 3 +- .../src/app/collect/core/core.module.ts | 3 +- .../create-project.component.spec.ts | 15 +- .../create-project.component.ts | 64 ++- .../project-list/project-list.component.ts | 29 +- .../app/collect/projects/project.module.ts | 4 +- .../collect/projects/projects.component.ts | 25 +- .../transaction-list.component.spec.ts | 13 +- .../transaction-list.component.ts | 17 +- .../transactions/transaction.module.ts | 3 +- .../transactions/transactions.component.ts | 16 +- ui/ui-frontend/projects/collect/src/main.ts | 45 ++- .../src/app/app.component.spec.ts | 3 +- .../design-system/src/app/app.component.ts | 37 +- .../design-system/src/app/app.module.ts | 8 +- ...ign-system-information-detail.component.ts | 3 +- .../atoms/tooltip/tooltip.component.ts | 4 +- .../design-system/design-system.component.ts | 1 - .../design-system/design-system.module.ts | 45 --- .../breadcrumbs/breadcrumbs.component.ts | 4 +- .../design-system-datepicker.component.ts | 3 +- .../design-system-old-inputs.component.ts | 3 +- ...esign-system-select-with-tree.component.ts | 3 +- .../design-system-discussion.component.ts | 4 +- .../organisms/snackbar/snackbar.component.ts | 3 +- .../tokens/typography/typography.component.ts | 6 +- .../translation/translation.component.ts | 8 +- .../translation/translation.module.ts | 50 --- .../app/components/upload/upload.component.ts | 3 +- .../projects/design-system/src/main.ts | 23 +- .../identity/src/app/app.component.spec.ts | 3 +- .../identity/src/app/app.component.ts | 4 +- .../projects/identity/src/app/app.module.ts | 76 ---- .../app/core/api/customer-api.service.spec.ts | 3 +- .../identity/src/app/core/core.module.ts | 3 +- .../src/app/core/customer.service.spec.ts | 3 +- .../identity/src/app/core/customer.service.ts | 3 +- .../customer-alerting.component.spec.ts | 3 +- .../customer-alerting.component.ts | 5 +- .../customer-colors-input.component.ts | 10 +- .../customer-colors-input.module.ts | 73 ---- .../input-color/input-color.component.ts | 8 +- .../customer-create.component.spec.ts | 41 +- .../customer-create.component.ts | 44 ++- .../customer-create/customer-create.module.ts | 75 ---- .../customer-list.component.spec.ts | 18 +- .../customer-list/customer-list.component.ts | 31 +- .../customer-list/customer-list.module.ts | 64 --- .../customer-list.service.spec.ts | 3 +- .../customer-list/customer-list.service.ts | 3 +- .../owner-list/owner-list.component.ts | 7 +- .../customer-popup.component.ts | 3 +- .../customer-preview.component.spec.ts | 16 +- .../customer-preview.component.ts | 27 +- .../customer-preview.module.ts | 106 ----- .../graphic-identity-tab.component.ts | 8 +- .../graphic-identity-update.component.spec.ts | 15 +- .../graphic-identity-update.component.ts | 6 +- .../graphic-identity-form.component.ts | 7 +- .../graphic-identity.component.ts | 10 +- .../homepage-message-tab.component.ts | 7 +- .../homepage-message-update.component.ts | 6 +- .../homepage-message-translation.ts | 6 +- .../homepage-message.component.ts | 21 +- .../information-tab.component.spec.ts | 335 ---------------- .../information-tab.component.ts | 69 +++- ...identity-provider-create.component.spec.ts | 15 +- .../identity-provider-create.component.ts | 44 ++- ...dentity-provider-details.component.spec.ts | 298 -------------- .../identity-provider-details.component.ts | 74 +++- .../sso-tab/identity-provider.service.ts | 3 +- .../sso-tab/sso-tab.component.spec.ts | 268 ------------- .../sso-tab/sso-tab.component.ts | 6 +- .../customer-resolver.service.spec.ts | 3 +- .../app/customer/customer.component.spec.ts | 23 +- .../src/app/customer/customer.component.ts | 26 +- .../src/app/customer/customer.module.ts | 19 +- .../owner-create.component.spec.ts | 14 +- .../owner-create/owner-create.component.ts | 36 +- .../owner-create/owner-create.module.ts | 65 ---- .../owner-form/owner-form.component.spec.ts | 234 ----------- .../owner-form/owner-form.component.ts | 9 +- .../customer/owner-form/owner-form.module.ts | 60 --- .../information-tab.component.spec.ts | 306 --------------- .../information-tab.component.ts | 67 +++- ...er-operation-history-tab.component.spec.ts | 3 +- .../owner-operation-history-tab.component.ts | 6 +- .../owner-preview/owner-popup.component.ts | 3 +- .../owner-preview.component.spec.ts | 16 +- .../owner-preview/owner-preview.component.ts | 22 +- .../owner-preview/owner-preview.module.ts | 70 ---- .../src/app/customer/owner.service.spec.ts | 3 +- .../src/app/customer/owner.service.ts | 3 +- .../tenant-create.component.spec.ts | 11 +- .../tenant-create/tenant-create.component.ts | 18 +- .../tenant-create/tenant-create.module.ts | 63 --- .../src/app/customer/tenant.service.spec.ts | 3 +- .../src/app/customer/tenant.service.ts | 3 +- ...nal-param-profile-create.component.spec.ts | 10 +- ...external-param-profile-create.component.ts | 42 +- ...nal-param-profile-detail.component.spec.ts | 17 +- ...external-param-profile-detail.component.ts | 25 +- .../information-tab.component.ts | 64 ++- .../thresholds-tab.component.ts | 10 +- ...ernal-param-profile-list.component.spec.ts | 14 +- .../external-param-profile-list.component.ts | 7 +- ...rnal-param-profile-service.service.spec.ts | 3 +- .../external-param-profile.component.spec.ts | 2 +- .../external-param-profile.component.ts | 22 +- .../external-param-profile.module.ts | 25 +- .../group-create.component.spec.ts | 21 +- .../group-create/group-create.component.ts | 44 ++- .../group/group-create/group-create.module.ts | 71 ---- .../group-list/group-criteria-builder.util.ts | 3 +- .../group-list/group-list.component.spec.ts | 6 +- .../group/group-list/group-list.component.ts | 26 +- .../app/group/group-list/group-list.module.ts | 53 --- .../group-preview/group-popup.component.ts | 3 +- .../group-preview/group-preview.component.ts | 31 +- .../group-preview/group-preview.module.ts | 82 ---- .../information-tab.component.spec.ts | 177 --------- .../information-tab.component.ts | 67 +++- .../units-edit/units-edit.component.spec.ts | 12 +- .../units-edit/units-edit.component.ts | 18 +- .../profiles-edit.component.spec.ts | 12 +- .../profiles-edit/profiles-edit.component.ts | 18 +- .../profiles-tab.component.spec.ts | 277 ------------- .../profiles-tab/profiles-tab.component.ts | 6 +- .../src/app/group/group.component.spec.ts | 12 +- .../identity/src/app/group/group.component.ts | 23 +- .../identity/src/app/group/group.module.ts | 11 +- .../src/app/group/group.service.spec.ts | 3 +- .../identity/src/app/group/group.service.ts | 3 +- .../group/units-form/units-form.component.ts | 14 +- .../app/group/units-form/units-form.module.ts | 51 --- .../hierarchy-create.component.spec.ts | 21 +- .../hierarchy-create.component.ts | 34 +- .../hierarchy-create.module.ts | 69 ---- .../hierarchy-detail.component.spec.ts | 172 -------- .../hierarchy-detail.component.ts | 29 +- .../hierarchy-detail.module.spec.ts | 49 --- .../hierarchy-detail.module.ts | 54 --- .../hierarchy-popup.component.ts | 3 +- .../information-tab.component.spec.ts | 175 --------- .../information-tab.component.ts | 66 +++- .../hierarchy-list.component.spec.ts | 3 +- .../hierarchy-list.component.ts | 8 +- .../hierarchy-list.module.spec.ts | 49 --- .../hierarchy-list/hierarchy-list.module.ts | 51 --- .../src/app/hierarchy/hierarchy.component.ts | 15 +- .../src/app/hierarchy/hierarchy.module.ts | 11 +- .../app/hierarchy/hierarchy.service.spec.ts | 3 +- .../profile-create.component.ts | 39 +- .../profile-create/profile-create.module.ts | 73 ---- .../information-tab.component.ts | 72 +++- .../profile-detail.component.spec.ts | 189 --------- .../profile-detail.component.ts | 30 +- .../profile-detail.module.spec.ts | 49 --- .../profile-detail/profile-detail.module.ts | 64 --- .../profile-detail/profile-popup.component.ts | 3 +- .../profile-list/profile-list.component.ts | 8 +- .../profile-list/profile-list.module.ts | 51 --- .../src/app/profile/profile.component.ts | 15 +- .../src/app/profile/profile.module.ts | 19 +- .../src/app/profile/profile.service.spec.ts | 3 +- .../custom-params/custom-params.component.ts | 7 +- .../custom-params/custom-params.module.ts | 50 --- .../domains-input.component.spec.ts | 10 +- .../domains-input/domains-input.component.ts | 6 +- .../domains-input/domains-input.module.ts | 51 --- .../editable-custom-params.component.ts | 17 +- .../editable-domain-input.component.spec.ts | 341 ---------------- .../editable-domain-input.component.ts | 9 +- .../editable-field/editable-field.module.ts | 44 ++- .../editable-keystore.component.spec.ts | 289 -------------- .../editable-keystore.component.ts | 9 +- .../editable-patterns.component.spec.ts | 280 ------------- .../editable-patterns.component.ts | 9 +- .../profiles-form.component.spec.ts | 350 ----------------- .../profiles-form/profiles-form.component.ts | 17 +- .../profiles-form/profiles-form.module.ts | 60 --- .../identity/src/app/shared/shared.module.ts | 42 +- .../customer-select.service.spec.ts | 3 +- .../subrogation/customer-select.service.ts | 3 +- .../subrogate-user-list.component.ts | 7 +- .../subrogate-user.component.ts | 14 +- .../src/app/subrogation/subrogation.module.ts | 6 +- .../group-attribution.component.ts | 7 +- .../group-attribution.module.ts | 19 +- .../group-detail/group-detail.component.ts | 7 +- .../group-list/group-list.component.ts | 23 +- .../user/user-create/user-create.component.ts | 35 +- .../user/user-create/user-create.module.ts | 68 ---- .../user-list/user-criteria-builder.util.ts | 3 +- .../app/user/user-list/user-list.component.ts | 33 +- .../app/user/user-list/user-list.module.ts | 54 --- .../user-group-tab.component.ts | 7 +- .../user-information-tab.component.spec.ts | 367 ------------------ .../user-information-tab.component.ts | 72 +++- .../user/user-preview/user-popup.component.ts | 3 +- .../user-preview/user-preview.component.ts | 45 ++- .../user/user-preview/user-preview.module.ts | 72 ---- .../identity/src/app/user/user.component.ts | 16 +- .../identity/src/app/user/user.module.ts | 12 +- ui/ui-frontend/projects/identity/src/main.ts | 39 +- .../ingest/src/app/app.component.spec.ts | 7 +- .../projects/ingest/src/app/app.component.ts | 4 +- .../projects/ingest/src/app/app.module.ts | 86 ---- .../app/core/api/ingest-api.service.spec.ts | 3 +- .../src/app/core/api/ingest-api.service.ts | 3 +- .../app/core/common/upload.component.spec.ts | 6 +- .../src/app/core/common/upload.component.ts | 18 +- .../src/app/core/common/upload.module.ts | 68 ---- .../ingest/src/app/core/core.module.ts | 3 +- .../holding-filling-scheme.component.spec.ts | 17 +- .../holding-filling-scheme.component.ts | 14 +- .../holding-filling-scheme.module.ts | 6 +- .../ingest-list/ingest-list.component.spec.ts | 3 +- .../ingest-list/ingest-list.component.ts | 9 +- .../ingest/ingest-list/ingest-list.module.ts | 50 --- ...ngest-errors-details-tab.component.spec.ts | 3 +- .../ingest-errors-details-tab.component.ts | 14 +- .../event-display.component.spec.ts | 3 +- .../event-display/event-display.component.ts | 6 +- .../ingest-event-detail.component.spec.ts | 3 +- .../ingest-event-detail.component.ts | 3 +- .../ingest-information-tab.component.spec.ts | 3 +- .../ingest-information-tab.component.ts | 8 +- .../ingest-preview.component.spec.ts | 16 +- .../ingest-preview.component.ts | 32 +- .../ingest-preview/ingest-preview.module.ts | 83 ---- .../src/app/ingest/ingest.component.spec.ts | 11 +- .../ingest/src/app/ingest/ingest.component.ts | 39 +- .../ingest/src/app/ingest/ingest.module.ts | 10 +- .../ingest/src/app/ingest/ingest.service.ts | 3 +- .../upload-tracking.component.spec.ts | 3 +- .../upload-tracking.component.ts | 6 +- .../upload-tracking/upload-tracking.module.ts | 67 ---- ui/ui-frontend/projects/ingest/src/main.ts | 49 ++- .../pastis/src/app/app.component.spec.ts | 3 +- .../projects/pastis/src/app/app.component.ts | 5 +- .../projects/pastis/src/app/app.module.ts | 69 +--- .../pastis/src/app/core/core.module.ts | 4 +- .../pastis/src/app/main/main.component.ts | 16 +- .../pastis/src/app/material.module.ts | 120 ------ .../pastis/src/app/pastis/pastis.module.ts | 8 +- .../create-profil-notice.component.ts | 11 +- .../create-profile.component.ts | 23 +- .../edit-profile/edit-profile.component.ts | 6 +- .../attributes/attributes.component.ts | 88 ++++- .../file-tree-metadata.component.spec.ts | 6 +- .../file-tree-metadata.component.ts | 129 +++++- .../file-tree/file-tree.component.ts | 34 +- .../file-tree/file-tree.module.ts | 57 ++- .../list-profile/list-profile.component.ts | 54 ++- .../pipes/filterByStringName.pipe.ts | 5 +- .../list-profile/pipes/filterByType.pipe.ts | 5 +- .../profile-information-tab.component.ts | 9 +- .../profile-preview.component.ts | 28 +- .../profile-preview/profile-preview.module.ts | 76 ---- .../pastis/src/app/profile/profile.module.ts | 14 +- .../seda-visualizer.component.ts | 1 - .../modify-text-button.component.ts | 3 +- .../pastis-breadcrumb.component.ts | 3 +- .../pastis-title-breadcrumb.component.ts | 3 +- .../pastis-dialog-confirm.component.ts | 8 +- ...-popup-metadata-language.component.spec.ts | 3 +- ...astis-popup-metadata-language.component.ts | 4 +- .../pastis-popup-option.component.spec.ts | 3 +- .../pastis-popup-option.component.ts | 6 +- ...astis-under-construction.component.spec.ts | 2 +- .../pastis-under-construction.component.ts | 1 - .../pastis/src/app/shared/shared.module.ts | 121 ------ .../standalone/standalone-startup.service.ts | 3 +- .../add-metadata/add-metadata.component.ts | 24 +- .../add-pua-control.component.ts | 8 +- ...ow-additional-properties.component.spec.ts | 3 +- .../allow-additional-properties.component.ts | 4 +- .../download-doc.component.spec.ts | 2 +- .../download-doc/download-doc.component.ts | 1 - .../duplicate-metadata.component.ts | 1 - .../remove-metadata.component.ts | 1 - .../save-profile-popup.component.ts | 9 +- .../save-profile.component.spec.ts | 6 +- .../save-profile/save-profile.component.ts | 4 +- .../select-notice/select-notice.component.ts | 9 +- .../app/user-actions/user-actions.module.ts | 21 +- ui/ui-frontend/projects/pastis/src/main.ts | 71 +++- .../portal/src/app/app-routing.module.ts | 3 +- .../portal/src/app/app.component.spec.ts | 15 +- .../projects/portal/src/app/app.component.ts | 4 +- .../projects/portal/src/app/app.module.ts | 59 +-- .../content-list/content-list.component.ts | 3 +- ui/ui-frontend/projects/portal/src/main.ts | 61 ++- .../access-contract-create.component.ts | 4 +- .../access-contract-list.component.spec.ts | 3 +- .../access-contract-list.component.ts | 33 +- ...tract-authorizations-tab.component.spec.ts | 6 +- ...s-contract-authorizations-tab.component.ts | 9 +- ...ct-authorizations-update.component.spec.ts | 6 +- ...ontract-authorizations-update.component.ts | 29 +- ...contract-information-tab.component.spec.ts | 2 +- ...cess-contract-information-tab.component.ts | 9 +- ...ccess-contract-nodes-tab.component.spec.ts | 3 +- .../access-contract-nodes-tab.component.ts | 6 +- ...ess-contract-node-update.component.spec.ts | 3 +- .../access-contract-node-update.component.ts | 39 +- .../access-contract-preview.component.ts | 30 +- .../access-contract-preview.module.ts | 96 ----- ...ontract-write-access-tab.component.spec.ts | 3 +- ...ess-contract-write-access-tab.component.ts | 18 +- .../access-contract.component.spec.ts | 11 +- .../access-contract.component.ts | 21 +- .../access-contract/access-contract.module.ts | 8 +- ...sion-register-advanced-search.component.ts | 9 +- .../accession-register-facets.component.ts | 5 +- .../accession-register-list.component.spec.ts | 6 +- .../accession-register-list.component.ts | 32 +- .../accession-register-detail.component.ts | 5 +- ...register-operations-list.component.spec.ts | 5 +- ...sion-register-operations-list.component.ts | 15 +- ...cession-register-preview.component.spec.ts | 8 +- .../accession-register-preview.component.ts | 24 +- .../accession-register.component.ts | 31 +- .../accession-register.module.ts | 11 +- .../app/admin-dsl/admin-dsl.component.spec.ts | 5 +- .../src/app/admin-dsl/admin-dsl.component.ts | 27 +- .../src/app/admin-dsl/admin-dsl.module.ts | 2 +- .../src/app/admin-dsl/admin-dsl.service.ts | 3 +- .../agency-create.component.spec.ts | 17 +- .../agency-create/agency-create.component.ts | 19 +- .../agency-create/agency-create.module.ts | 71 ---- .../agency-list/agency-list.component.spec.ts | 3 +- .../agency-list/agency-list.component.ts | 6 +- .../agency-information-tab.component.ts | 6 +- .../agency-preview.component.ts | 4 +- .../src/app/agency/agency.component.spec.ts | 3 +- .../src/app/agency/agency.component.ts | 6 +- .../src/app/agency/agency.schema.ts | 3 +- .../agency/edit-agency/edit-agency.guard.ts | 3 +- .../referential/src/app/app.component.spec.ts | 5 +- .../referential/src/app/app.component.ts | 4 +- .../referential/src/app/app.module.ts | 91 ----- .../audit-create.component.spec.ts | 2 +- .../audit-list/audit-list.component.spec.ts | 3 +- .../audit/audit-list/audit-list.component.ts | 40 +- .../audit-information-tab.component.ts | 2 +- .../audit-preview.component.spec.ts | 12 +- .../audit-preview/audit-preview.component.ts | 5 +- .../src/app/audit/audit.component.spec.ts | 5 +- .../src/app/audit/audit.component.ts | 28 +- .../referential/src/app/audit/audit.module.ts | 6 +- .../context-create.component.spec.ts | 17 +- .../context-create.component.ts | 7 +- .../context-edit-permission.component.ts | 7 +- .../context-edit-permission.module.ts | 67 ---- .../context-edit/context-edit.component.ts | 20 +- .../context-edit/context-edit.module.ts | 71 ---- .../context-list.component.spec.ts | 5 +- .../context-list/context-list.component.ts | 31 +- .../context-information-tab.component.spec.ts | 3 +- .../context-information-tab.component.ts | 9 +- .../context-permission-tab.component.spec.ts | 13 +- .../context-permission-tab.component.ts | 9 +- .../context-preview.component.spec.ts | 3 +- .../context-preview.component.ts | 27 +- .../context-preview/context-preview.module.ts | 83 ---- .../src/app/context/context.component.spec.ts | 11 +- .../src/app/context/context.component.ts | 23 +- .../src/app/context/context.module.ts | 8 +- .../src/app/context/context.service.ts | 3 +- .../app/core/api/context-api.service.spec.ts | 3 +- .../app/core/api/customer-api.service.spec.ts | 3 +- .../api/ingest-contract-api.service.spec.ts | 3 +- ...k-management-operation-api.service.spec.ts | 3 +- .../management-contracts-api.service.spec.ts | 3 +- .../app/core/api/ontology-api.service.spec.ts | 3 +- .../core/api/operation-api.service.spec.ts | 3 +- .../src/app/core/api/operation-api.service.ts | 3 +- .../api/security-profile-api.service.spec.ts | 3 +- .../referential/src/app/core/core.module.ts | 3 +- .../file-format-create.component.spec.ts | 2 +- .../file-format-create.component.ts | 20 +- .../file-format-create.module.ts | 70 ---- .../file-format-list.component.spec.ts | 3 +- .../file-format-list.component.ts | 32 +- ...e-format-information-tab.component.spec.ts | 3 +- .../file-format-information-tab.component.ts | 13 +- .../file-format-preview.component.spec.ts | 3 +- .../file-format-preview.component.ts | 26 +- .../file-format-preview.module.ts | 75 ---- .../file-format/file-format.component.spec.ts | 11 +- .../app/file-format/file-format.component.ts | 29 +- .../src/app/file-format/file-format.module.ts | 12 +- .../app/file-format/file-format.service.ts | 3 +- .../ingest-contract-list.component.spec.ts | 3 +- .../ingest-contract-list.component.ts | 32 +- ...-contract-attachment-tab.component.spec.ts | 3 +- ...ngest-contract-attachment-tab.component.ts | 6 +- ...est-contract-node-update.component.spec.ts | 26 +- .../ingest-contract-node-update.component.ts | 47 ++- ...gest-contract-format-tab.component.spec.ts | 3 +- .../ingest-contract-format-tab.component.ts | 9 +- ...st-contract-heritage-tab.component.spec.ts | 3 +- .../ingest-contract-heritage-tab.component.ts | 9 +- ...gest-contract-information-tab.component.ts | 9 +- ...gest-contract-object-tab.component.spec.ts | 10 +- .../ingest-contract-object-tab.component.ts | 9 +- .../ingest-contract-preview.component.spec.ts | 3 +- .../ingest-contract-preview.component.ts | 31 +- .../ingest-contract-preview.module.ts | 98 ----- ...t-contract-signature-tab.component.spec.ts | 9 +- ...ingest-contract-signature-tab.component.ts | 9 +- .../ingest-contract.component.spec.ts | 6 +- .../ingest-contract.component.ts | 23 +- .../ingest-contract/ingest-contract.module.ts | 8 +- .../ingest-contract.service.ts | 3 +- ...anagement-operation-list.component.spec.ts | 8 +- ...ook-management-operation-list.component.ts | 32 +- ...peration-information-tab.component.spec.ts | 8 +- ...ent-operation-information-tab.component.ts | 7 +- ...gement-operation-preview.component.spec.ts | 8 +- ...-management-operation-preview.component.ts | 45 ++- ...ook-management-operation.component.spec.ts | 13 +- .../logbook-management-operation.component.ts | 34 +- .../logbook-management-operation.module.ts | 10 +- ...logbook-operation-detail.component.spec.ts | 12 +- .../logbook-operation-detail.component.ts | 30 +- .../logbook-operation-popup.component.ts | 3 +- .../logbook-operation-list.component.spec.ts | 10 +- .../logbook-operation-list.component.ts | 38 +- .../logbook-operation.component.spec.ts | 14 +- .../logbook-operation.component.ts | 26 +- .../logbook-operation.module.ts | 8 +- ...istent-identifier-policy-form.component.ts | 21 +- ...ersistent-identifier-policy-form.module.ts | 72 ---- ...istent-identifier-policy-form.component.ts | 21 +- ...ersistent-identifier-policy-form.module.ts | 72 ---- .../management-contract-create.component.ts | 4 +- ...management-contract-list.component.spec.ts | 5 +- .../management-contract-list.component.ts | 30 +- ...t-contract-identification-tab.component.ts | 19 +- ...contract-information-tab.component.spec.ts | 19 +- ...ment-contract-information-tab.component.ts | 10 +- ...agement-contract-preview.component.spec.ts | 20 +- .../management-contract-preview.component.ts | 35 +- .../management-contract-preview.module.ts | 83 ---- ...ent-contract-storage-tab.component.spec.ts | 13 +- ...nagement-contract-storage-tab.component.ts | 10 +- .../management-contract.component.spec.ts | 5 +- .../management-contract.component.ts | 25 +- .../management-contract.module.ts | 6 +- .../management-contract.service.ts | 3 +- .../ontology-create.component.spec.ts | 3 +- .../ontology-create.component.ts | 3 +- .../schema-delete-dialog.component.ts | 3 +- .../schema-list/schema-list.component.ts | 4 +- ...ontology-information-tab.component.spec.ts | 3 +- .../ontology-information-tab.component.ts | 2 +- .../ontology-preview.component.ts | 3 +- .../schema-information-tab.component.spec.ts | 3 +- .../schema-information-tab.component.ts | 4 +- .../app/ontology/ontology.component.spec.ts | 11 +- .../src/app/ontology/ontology.component.ts | 24 +- .../src/app/ontology/ontology.module.ts | 5 +- .../griffin-list.component.spec.ts | 3 +- ...eservation-scenario-list.component.spec.ts | 3 +- ...tion-scenario-information-tab.component.ts | 3 +- .../preservation.component.spec.ts | 3 +- .../probative-value-create.component.spec.ts | 2 +- .../probative-value-create.component.ts | 23 +- .../probative-value-create.module.ts | 67 ---- .../probative-value-list.component.spec.ts | 3 +- .../probative-value-list.component.ts | 31 +- .../probative-value-preview.component.spec.ts | 11 +- .../probative-value-preview.component.ts | 20 +- .../probative-value-preview.module.ts | 74 ---- .../probative-value.component.spec.ts | 7 +- .../probative-value.component.ts | 28 +- .../probative-value/probative-value.module.ts | 10 +- .../probative-value.service.ts | 3 +- .../rule-create/rule-create.component.spec.ts | 5 +- .../rule/rule-create/rule-create.component.ts | 29 +- .../rule/rule-create/rule-create.module.ts | 69 ---- .../rule-list/rule-list.component.spec.ts | 3 +- .../app/rule/rule-list/rule-list.component.ts | 39 +- .../rule-information-tab.component.spec.ts | 3 +- .../rule-information-tab.component.ts | 10 +- .../rule-preview.component.spec.ts | 3 +- .../rule-preview/rule-preview.component.ts | 26 +- .../rule/rule-preview/rule-preview.module.ts | 74 ---- .../src/app/rule/rule.component.spec.ts | 34 +- .../src/app/rule/rule.component.ts | 34 +- .../referential/src/app/rule/rule.module.ts | 12 +- .../securisation-list.component.spec.ts | 3 +- .../securisation-list.component.ts | 37 +- .../securisation-list.module.ts | 50 --- .../securisation-check-tab.component.spec.ts | 6 +- .../securisation-check-tab.component.ts | 8 +- ...risation-information-tab.component.spec.ts | 3 +- .../securisation-information-tab.component.ts | 6 +- .../securisation-preview.component.spec.ts | 11 +- .../securisation-preview.component.ts | 36 +- .../securisation-preview.module.ts | 76 ---- .../securisation.component.spec.ts | 5 +- .../securisation/securisation.component.ts | 28 +- .../app/securisation/securisation.module.ts | 7 +- .../app/securisation/securisation.service.ts | 3 +- .../security-profile-create.component.spec.ts | 27 +- .../security-profile-create.component.ts | 6 +- ...urity-profile-edit-permission.component.ts | 6 +- ...security-profile-edit-permission.module.ts | 65 ---- .../security-profile-list.component.spec.ts | 3 +- .../security-profile-list.component.ts | 9 +- ...-profile-information-tab.component.spec.ts | 3 +- ...urity-profile-information-tab.component.ts | 9 +- ...-profile-permissions-tab.component.spec.ts | 3 +- ...urity-profile-permissions-tab.component.ts | 10 +- ...security-profile-preview.component.spec.ts | 3 +- .../security-profile-preview.component.ts | 27 +- .../security-profile-preview.module.ts | 77 ---- .../security-profile.component.spec.ts | 11 +- .../security-profile.component.ts | 23 +- .../security-profile.module.ts | 6 +- .../import-dialog/import-dialog.component.ts | 29 +- .../import-dialog/import-dialog.module.ts | 58 --- .../referential-import-api.service.spec.ts | 3 +- .../referential-import.service.ts | 3 +- .../pipes/event-type-color-class.pipe.ts | 5 +- .../src/app/shared/pipes/last-event.pipe.ts | 5 +- .../src/app/shared/pipes/pipes.module.ts | 48 --- .../projects/referential/src/main.ts | 53 ++- .../account-application-tab.component.spec.ts | 2 +- .../account-application-tab.component.ts | 1 - .../account-information-tab.component.spec.ts | 5 +- .../account-information-tab.component.ts | 6 +- .../modules/account/account.component.spec.ts | 17 +- .../app/modules/account/account.component.ts | 7 +- .../modules/account/account.module.spec.ts | 49 --- .../src/app/modules/account/account.module.ts | 68 ---- .../archive-unit/archive-unit.module.ts | 7 +- .../archive-unit-count.component.spec.ts | 3 +- .../archive-unit-count.component.ts | 6 +- .../archive-unit-editor.component.ts | 4 +- .../editor-banner/editor-banner.component.ts | 3 +- .../archive-unit-viewer.component.spec.ts | 3 +- .../archive-unit-viewer.component.ts | 3 +- .../physical-archive-viewer.component.ts | 6 +- .../collapse/collapse.component.spec.ts | 99 ----- .../components/collapse/collapse.component.ts | 4 +- .../collapse/collapse.module.spec.ts | 49 --- .../components/collapse/collapse.module.ts | 47 --- .../close-popup-dialog.component.spec.ts | 3 +- .../close-popup-dialog.component.ts | 4 +- .../common-confirm-dialog.component.spec.ts | 3 +- .../common-confirm-dialog.component.ts | 6 +- .../confirm-dialog.module.ts | 51 --- .../common-tooltip.component.ts | 3 +- .../common-tooltip/common-tooltip.module.ts | 47 --- .../common-tooltip/tooltip.directive.ts | 5 +- .../modules/components/data/data.component.ts | 6 +- .../download-snack-bar.component.spec.ts | 15 +- .../download-snack-bar.component.ts | 8 +- .../download-snack-bar.module.ts | 49 --- .../editable-email-input.component.spec.ts | 7 +- .../editable-email-input.component.ts | 18 +- .../editable-field.component.ts | 1 - .../editable-field/editable-field.module.ts | 102 ----- .../editable-file.component.spec.ts | 308 --------------- .../editable-file/editable-file.component.ts | 5 +- .../editable-input.component.spec.ts | 287 -------------- .../editable-input.component.ts | 7 +- .../editable-level-input.component.spec.ts | 5 +- .../editable-level-input.component.ts | 8 +- .../editable-level-input/sub-level.pipe.ts | 5 +- .../editable-textarea.component.spec.ts | 280 ------------- .../editable-textarea.component.ts | 6 +- .../editable-button-toggle.component.ts | 1 - .../editable-toggle-group.component.spec.ts | 249 ------------ .../editable-toggle-group.component.ts | 15 +- .../level-input/level-input.component.spec.ts | 3 +- .../level-input/level-input.component.ts | 6 +- .../level-input/level-input.module.spec.ts | 49 --- .../level-input/level-input.module.ts | 49 --- .../components/elements/elements.component.ts | 5 +- .../display-file/display-file.component.ts | 5 +- .../components/header/header.component.ts | 24 +- .../components/header/header.module.ts | 12 +- .../item-select/item-select.component.ts | 4 +- .../header/item-select/item-select.module.ts | 48 --- .../menu-application-tile.component.ts | 5 +- .../components/header/menu/menu.component.ts | 25 +- .../components/header/menu/menu.module.ts | 6 +- .../select-language.component.ts | 7 +- .../select-language/select-language.module.ts | 50 --- .../select-site/select-site.component.ts | 3 +- .../header/select-site/select-site.module.ts | 51 --- .../select-tenant-dialog.component.ts | 5 +- .../header/user-photo/user-photo.component.ts | 3 +- .../header/user-photo/user-photo.module.ts | 46 --- .../role-toggle/role-toggle.component.spec.ts | 128 ------ .../role-toggle/role-toggle.component.ts | 1 - .../role-toggle/role-toggle.module.ts | 49 --- .../role-toggle/role.component.spec.ts | 4 +- .../components/role-toggle/role.component.ts | 4 +- .../stepper/stepper.component.spec.ts | 82 ---- .../vitamui-interval-date-picker.component.ts | 7 +- .../vitamui-multi-inputs.component.ts | 8 +- .../vitamui-multi-inputs.module.ts | 5 +- .../vitamui-sidenav-header.component.ts | 5 +- .../vitamui-sidenav-header.module.ts | 49 --- .../vitamui-tree-node.component.ts | 5 +- .../autocomplete-position.directive.module.ts | 46 --- .../autocomplete-position.directive.ts | 5 +- .../collapse/collapse-container.directive.ts | 5 +- .../collapse-trigger-for.directive.ts | 5 +- .../collapse.directive.module.spec.ts | 49 --- .../collapse/collapse.directive.module.ts | 49 --- .../collapse/collapse.directive.spec.ts | 166 -------- .../directives/collapse/collapse.directive.ts | 1 - .../ellipsis/ellipsis.directive.module.ts | 47 --- .../ellipsis/ellipsis.directive.spec.ts | 84 ---- .../directives/ellipsis/ellipsis.directive.ts | 5 +- .../infinite-scroll.directive.ts | 5 +- .../infinite-scroll.module.spec.ts | 49 --- .../infinite-scroll/infinite-scroll.module.ts | 47 --- .../resize-sidebar.directive.spec.ts | 5 +- .../resize-sidebar.directive.ts | 5 +- .../resize-sidebar/resize-sidebar.module.ts | 47 --- .../resize-vertical.directive.spec.ts | 5 +- .../resize-vertical.directive.ts | 5 +- .../row-collapse-container.directive.ts | 5 +- .../row-collapse-trigger-for.directive.ts | 5 +- .../row-collapse.directive.spec.ts | 166 -------- .../row-collapse/row-collapse.directive.ts | 1 - .../row-collapse/row-collapse.module.spec.ts | 49 --- .../row-collapse/row-collapse.module.ts | 49 --- .../modules/logbook/history/history.module.ts | 2 - .../multi-operation-history-tab.component.ts | 5 +- .../operation-history-tab.component.ts | 5 +- .../group-editor.component.spec.ts | 3 +- .../group-editor/group-editor.component.ts | 28 +- .../list-editor/list-editor.component.spec.ts | 3 +- .../list-editor/list-editor.component.ts | 30 +- .../primitive-editor.component.spec.ts | 3 +- .../primitive-editor.component.ts | 21 +- .../object-editor.component.spec.ts | 3 +- .../object-editor/object-editor.component.ts | 7 +- .../object-editor/object-editor.module.ts | 5 +- .../components/group/group.component.ts | 9 +- .../components/list/list.component.ts | 6 +- .../primitive/primitive.component.ts | 4 +- .../object-viewer.component.spec.ts | 3 +- .../object-viewer/object-viewer.component.ts | 6 +- .../object-viewer/object-viewer.module.ts | 14 +- .../src/app/modules/pipes/bytes.pipe.ts | 5 +- .../src/app/modules/pipes/datetime.pipe.ts | 5 +- .../src/app/modules/pipes/empty.pipe.ts | 5 +- .../src/app/modules/pipes/filesize.pipe.ts | 5 +- .../src/app/modules/pipes/highlight.pipe.ts | 5 +- .../src/app/modules/pipes/pipes.module.ts | 3 +- .../src/app/modules/pipes/plural.pipe.ts | 5 +- .../src/app/modules/pipes/safe-style.pipe.ts | 5 +- .../src/app/modules/pipes/strongify.pipe.ts | 5 +- .../src/app/modules/pipes/truncate.pipe.ts | 5 +- .../src/app/modules/pipes/unitI18n.pipe.ts | 5 +- .../src/app/modules/pipes/yes-no.pipe.ts | 5 +- .../security/has-any-role.directive.spec.ts | 5 +- .../security/has-any-role.directive.ts | 5 +- .../security/has-role.directive.spec.ts | 5 +- .../modules/security/has-role.directive.ts | 5 +- .../modules/security/security.module.spec.ts | 49 --- .../app/modules/security/security.module.ts | 47 --- .../subrogation-banner.component.spec.ts | 3 +- .../subrogation-banner.component.ts | 4 +- .../subrogation-modal.component.ts | 27 +- .../subrogation-snack-bar.component.spec.ts | 3 +- .../subrogation-snack-bar.component.ts | 3 +- .../modules/subrogation/subrogation.module.ts | 6 +- .../src/app/modules/vitamui-common.module.ts | 158 +++++--- .../confirm-action.component.ts | 5 +- .../confirm-dialog.component.ts | 5 +- .../discussion-list.component.ts | 5 +- .../discussion-title.component.ts | 4 +- .../discussion/message/message.component.ts | 5 +- .../filing-plan/filing-plan.component.spec.ts | 5 +- .../filing-plan/filing-plan.component.ts | 23 +- .../filing-plan/filing-plan.module.spec.ts | 49 --- .../filing-plan/filing-plan.module.ts | 54 --- .../filing-plan/node.component.spec.ts | 2 +- .../components/filing-plan/node.component.ts | 5 +- .../components/input/input.component.spec.ts | 4 +- .../lib/components/input/input.component.ts | 5 +- .../management-rule-search.component.ts | 12 +- .../pattern/pattern.component.spec.ts | 287 -------------- .../reclassification-dialog.component.ts | 5 +- .../select-with-tree.component.ts | 10 +- .../lib/components/select/select.component.ts | 12 +- .../slide-toggle.component.spec.ts | 124 ------ .../vitamui-radio-group.component.spec.ts | 2 +- .../vitamui-radio-group.component.ts | 1 - .../vitamui-radio-group.module.ts | 48 --- .../vitamui-radio.component.spec.ts | 2 +- .../vitamui-radio/vitamui-radio.component.ts | 3 +- .../vitamui-radio/vitamui-radio.module.ts | 47 --- .../src/lib/vitamui-library.module.ts | 6 - .../vitamui-library/src/public-api.ts | 38 +- ui/ui-frontend/test.ts | 17 +- ui/ui-frontend/tsconfig.json | 1 - 835 files changed, 7081 insertions(+), 14465 deletions(-) delete mode 100644 ui/ui-frontend/projects/archive-search/src/app/app.module.ts delete mode 100644 ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.module.ts delete mode 100644 ui/ui-frontend/projects/collect/src/app/app.module.ts delete mode 100644 ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.module.ts delete mode 100644 ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.module.ts delete mode 100644 ui/ui-frontend/projects/design-system/src/app/components/translation/translation.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/app.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.module.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.spec.ts delete mode 100644 ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.module.ts delete mode 100644 ui/ui-frontend/projects/ingest/src/app/app.module.ts delete mode 100644 ui/ui-frontend/projects/ingest/src/app/core/common/upload.module.ts delete mode 100644 ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.module.ts delete mode 100644 ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.module.ts delete mode 100644 ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.module.ts delete mode 100644 ui/ui-frontend/projects/pastis/src/app/material.module.ts delete mode 100644 ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.module.ts delete mode 100644 ui/ui-frontend/projects/pastis/src/app/shared/shared.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/app.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.module.ts delete mode 100644 ui/ui-frontend/projects/referential/src/app/shared/pipes/pipes.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/confirm-dialog.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/lib/components/pattern/pattern.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/lib/components/slide-toggle/slide-toggle.component.spec.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.module.ts delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.module.ts diff --git a/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts index 6431bde1b7e..b23aa0f0199 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts @@ -61,8 +61,7 @@ describe('AppComponent', () => { beforeEach(async () => { const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {} }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent], - declarations: [AppComponent], + imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/app.component.ts b/ui/ui-frontend/projects/archive-search/src/app/app.component.ts index 2c892fd775d..b895a21460e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/app.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/app.component.ts @@ -35,12 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; +import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [HeaderModule, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule], }) export class AppComponent { title = 'Archive Search Application'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/app.module.ts b/ui/ui-frontend/projects/archive-search/src/app/app.module.ts deleted file mode 100644 index 3ed49f630f5..00000000000 --- a/ui/ui-frontend/projects/archive-search/src/app/app.module.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { DatePipe, registerLocaleData } from '@angular/common'; -import { default as localeFr } from '@angular/common/locales/fr'; -import { LOCALE_ID, NgModule } from '@angular/core'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { CoreModule } from './core/core.module'; -import { provideNativeDateAdapter } from '@angular/material/core'; - -registerLocaleData(localeFr, 'fr'); - -@NgModule({ - declarations: [AppComponent], - imports: [ - AuthenticationModule.forRoot(), - CoreModule, - BrowserAnimationsModule, - BrowserModule, - VitamUICommonModule.forRoot(), - AppRoutingModule, - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ], - providers: [ - provideI18n(), - provideNativeDateAdapter(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { - provide: WINDOW_LOCATION, - useValue: window.location, - }, - DatePipe, - BytesPipe, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index e0b2bec7e30..33d46e65f6f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -67,20 +67,14 @@ describe('ArchivePreviewComponent', () => { let component: ArchivePreviewComponent; let fixture: ComponentFixture; - @Pipe({ - name: 'truncate', - standalone: false, - }) + @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; } } - @Pipe({ - name: 'unitI18n', - standalone: false, - }) + @Pipe({ name: 'unitI18n' }) class MockUnitI18nPipe implements PipeTransform { transform(value: number): number { return value; @@ -100,7 +94,6 @@ describe('ArchivePreviewComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [ArchivePreviewComponent, MockTruncatePipe, MockUnitI18nPipe], schemas: [NO_ERRORS_SCHEMA], imports: [ MatMenuModule, @@ -115,6 +108,9 @@ describe('ArchivePreviewComponent', () => { VitamUICommonModule, InjectorModule, LoggerModule.forRoot(), + ArchivePreviewComponent, + MockTruncatePipe, + MockUnitI18nPipe, ], providers: [ { provide: ArchiveService, useValue: archiveServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts index a1c7ed5c3b4..ad667574e2e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts @@ -49,17 +49,53 @@ import { } from '@angular/core'; import { MatTab, MatTabChangeEvent, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import type { Unit } from 'vitamui-library'; -import { AccessContract, AccessContractService, unitToVitamuiIcon } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Unit, AccessContract, AccessContractService } from 'vitamui-library'; +import { + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, + unitToVitamuiIcon, + VitamuiMenuButtonComponent, + ClickOutsideDirective, + PipesModule, +} from 'vitamui-library'; import { ArchiveUnitDescriptionTabComponent } from './archive-unit-description-tab/archive-unit-description-tab.component'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; +import { MatMenuItem } from '@angular/material/menu'; +import { NgClass, CommonModule } from '@angular/common'; +import { ArchiveUnitInformationTabComponent } from './archive-unit-information-tab/archive-unit-information-tab.component'; +import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab/archive-unit-rules-details-tab.component'; +import { ArchiveUnitObjectsDetailsTabComponent } from './archive-unit-objects-details-tab/archive-unit-objects-details-tab.component'; +import { AddManagementRulesComponent } from '../archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @Component({ selector: 'app-archive-preview', templateUrl: './archive-preview.component.html', styleUrls: ['./archive-preview.component.scss'], - standalone: false, + imports: [ + VitamuiMenuButtonComponent, + MatMenuItem, + TooltipDirective, + MatTabGroup, + NgClass, + MatTab, + ArchiveUnitInformationTabComponent, + ArchiveUnitDescriptionTabComponent, + ClickOutsideDirective, + ArchiveUnitRulesDetailsTabComponent, + ArchiveUnitObjectsDetailsTabComponent, + AddManagementRulesComponent, + PipesModule, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + VitamuiSidenavHeaderComponent, + ], }) export class ArchivePreviewComponent implements OnChanges, OnInit, AfterViewInit { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts index 9c09de6be76..9ceca9d9c30 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts @@ -48,9 +48,9 @@ import { input, Input, } from '@angular/core'; -import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { MatDialog, MatDialogConfig, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { merge, Observable, pipe, Subscription, UnaryFunction } from 'rxjs'; import { filter, map, startWith, switchMap, tap } from 'rxjs/operators'; import { @@ -63,14 +63,17 @@ import { OperationId, SpinnerOverlayService, SnackBarService, + ArchiveUnitModule, + DialogHeaderComponent, } from 'vitamui-library'; import { ArchiveUnitService } from './archive-unit.service'; +import { NgClass } from '@angular/common'; @Component({ selector: 'app-archive-unit-description-tab', templateUrl: './archive-unit-description-tab.component.html', styleUrls: ['./archive-unit-description-tab.component.scss'], - standalone: false, + imports: [ArchiveUnitModule, NgClass, DialogHeaderComponent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class ArchiveUnitDescriptionTabComponent implements OnChanges, OnDestroy { private logger = inject(Logger); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts index d4a5850b956..aeb96b830b4 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts @@ -73,20 +73,14 @@ describe('ArchiveUnitInformationTabComponent', () => { let component: ArchiveUnitInformationTabComponent; let fixture: ComponentFixture; - @Pipe({ - name: 'unitI18n', - standalone: false, - }) + @Pipe({ name: 'unitI18n' }) class UnitI18nStubPipe implements PipeTransform { transform(value: any, _attribute: string): string { return value?.Title ?? ''; } } - @Pipe({ - name: 'dateTime', - standalone: false, - }) + @Pipe({ name: 'dateTime' }) class DateTimeStubPipe implements PipeTransform { transform(value: string = ''): string { return value; @@ -141,8 +135,10 @@ describe('ArchiveUnitInformationTabComponent', () => { BrowserAnimationsModule, DataComponent, PipesModule, + ArchiveUnitInformationTabComponent, + UnitI18nStubPipe, + DateTimeStubPipe, ], - declarations: [ArchiveUnitInformationTabComponent, UnitI18nStubPipe, DateTimeStubPipe], providers: [ FormBuilder, { provide: ArchiveService, useValue: archiveServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts index 11e3716dafb..9751253b43a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts @@ -36,16 +36,18 @@ */ import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, inject } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; -import type { Unit, VersionWithQualifierDto } from 'vitamui-library'; -import { AccessContract, AccessContractService, ObjectQualifierType } from 'vitamui-library'; +import { Unit, VersionWithQualifierDto, AccessContract, AccessContractService } from 'vitamui-library'; +import { ObjectQualifierType, DataComponent, PipesModule } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; +import { AsyncPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-archive-unit-information-tab', templateUrl: './archive-unit-information-tab.component.html', styleUrls: ['./archive-unit-information-tab.component.css'], - standalone: false, + imports: [DataComponent, AsyncPipe, PipesModule, TranslatePipe], }) export class ArchiveUnitInformationTabComponent implements OnInit, OnChanges, OnDestroy { private archiveService = inject(ArchiveService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts index 47860c9f7e4..1f95c2edb43 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts @@ -87,8 +87,7 @@ describe('ArchiveUnitObjectsDetailsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [ArchiveUnitObjectsDetailsTabComponent], + imports: [ArchiveUnitObjectsDetailsTabComponent], providers: [ { provide: ArchiveService, useValue: archiveServiceSpy }, { provide: TenantSelectionService, useValue: tenantSelectionServiceSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts index 6b76114a827..7c67b0aa7d6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts @@ -37,7 +37,7 @@ import { Clipboard } from '@angular/cdk/clipboard'; import { HttpHeaders } from '@angular/common/http'; import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; -import type { Unit, VersionWithQualifierDto } from 'vitamui-library'; +import { Unit, VersionWithQualifierDto } from 'vitamui-library'; import { AccessContract, AccessContractService, @@ -45,16 +45,21 @@ import { qualifiersToVersionsWithQualifier, TenantSelectionService, VitamuiHttpHeaders, + ArchiveUnitModule, + TooltipDirective, + PipesModule, } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { Subscription } from 'rxjs'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; +import { NgClass } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-archive-unit-objects-details-tab', templateUrl: './archive-unit-objects-details-tab.component.html', styleUrls: ['./archive-unit-objects-details-tab.component.scss'], - standalone: false, + imports: [ArchiveUnitModule, NgClass, TooltipDirective, PipesModule, TranslatePipe], }) export class ArchiveUnitObjectsDetailsTabComponent implements OnChanges, OnInit, OnDestroy { private archiveService = inject(ArchiveService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 0ede209f72c..547405c2aab 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -39,7 +39,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, Unit, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, Unit, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -70,9 +71,8 @@ describe('ArchiveUnitRulesDetailsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ArchiveUnitRulesDetailsTabComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [InjectorModule], + imports: [InjectorModule, ArchiveUnitRulesDetailsTabComponent], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts index 5649b0f665c..4dd34b992ca 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts @@ -37,9 +37,10 @@ import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import type { SearchCriteriaEltDto, Unit } from 'vitamui-library'; +import { SearchCriteriaEltDto, Unit } from 'vitamui-library'; import { CriteriaDataType, CriteriaOperator, SearchCriteriaTypeEnum } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; +import { ArchiveUnitRulesInformationsTabComponent } from './archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component'; const PAGE_SIZE = 10; const CURRENT_PAGE = 0; @@ -48,7 +49,7 @@ const CURRENT_PAGE = 0; selector: 'app-archive-unit-rules-details-tab', templateUrl: './archive-unit-rules-details-tab.component.html', styleUrls: ['./archive-unit-rules-details-tab.component.css'], - standalone: false, + imports: [ArchiveUnitRulesInformationsTabComponent], }) export class ArchiveUnitRulesDetailsTabComponent implements OnChanges, OnDestroy { private archiveSearchService = inject(ArchiveService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 6c7845b0b23..85185ba6c14 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -75,10 +75,7 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { @Input() vitamuiCommonCollapse: any; } - @Pipe({ - name: 'dateTime', - standalone: false, - }) + @Pipe({ name: 'dateTime' }) class DateTimeStubPipe implements PipeTransform { transform(value: string = ''): string { return value; @@ -121,7 +118,6 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe], imports: [ CollapseStubDirective, CollapseTriggerForStubDirective, @@ -130,6 +126,8 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { LoggerModule.forRoot(), NoopAnimationsModule, VitamUICommonTestModule, + ArchiveUnitRulesInformationsTabComponent, + DateTimeStubPipe, ], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts index 7daea522529..8df43b365f9 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts @@ -35,15 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import type { InheritedPropertyDto, RuleActionDetails, Unit, UnitRuleDto } from 'vitamui-library'; -import { Logger } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { InheritedPropertyDto, RuleActionDetails, Unit, UnitRuleDto, Logger } from 'vitamui-library'; +import { PipesModule } from 'vitamui-library'; +import { NgClass } from '@angular/common'; @Component({ selector: 'app-archive-unit-rules-informations-tab', templateUrl: './archive-unit-rules-informations-tab.component.html', styleUrls: ['./archive-unit-rules-informations-tab.component.css'], - standalone: false, + imports: [NgClass, PipesModule, TranslatePipe], }) export class ArchiveUnitRulesInformationsTabComponent implements OnChanges { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts index c15faac90b1..a538d07f7a8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts @@ -87,8 +87,7 @@ describe('DipRequestCreateComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [DipRequestCreateComponent], - imports: [InjectorModule, MatButtonToggleModule, LoggerModule.forRoot()], + imports: [InjectorModule, MatButtonToggleModule, LoggerModule.forRoot(), DipRequestCreateComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts index b94020b7334..1ac0c22138c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, ResourceRef, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { finalize, Subscription } from 'rxjs'; import * as uuid from 'uuid'; import { @@ -51,17 +51,46 @@ import { SnackBarService, UsageVersionEnum, VitamuiSelectOptions, + DialogHeaderComponent, + StepperComponent, + InputComponent, + SelectComponent, + NextStepComponent, + SlideToggleComponent, + PreviousStepComponent, } from 'vitamui-library'; import { ArchiveService } from '../../../archive.service'; import { ExportDIPRequestDto, QualifierVersion } from '../../../models/dip.interface'; import { distinctUntilChanged, map } from 'rxjs/operators'; import { rxResource } from '@angular/core/rxjs-interop'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; @Component({ selector: 'app-dip-request-create', templateUrl: './dip-request-create.component.html', styleUrls: ['./dip-request-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + StepperComponent, + CdkStep, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + InputComponent, + SelectComponent, + MatDialogActions, + NextStepComponent, + MatButtonToggleGroup, + MatButtonToggle, + MatRadioGroup, + MatRadioButton, + SlideToggleComponent, + PreviousStepComponent, + TranslatePipe, + ], }) export class DipRequestCreateComponent implements OnInit, OnDestroy { private translate = inject(TranslateService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts index 8370de803c1..42b8843d212 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts @@ -215,8 +215,7 @@ describe('AddManagementRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AddManagementRulesComponent], - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, AddManagementRulesComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts index 4691a5ffdca..8eeb823911f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { merge, Observable, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; @@ -51,6 +51,10 @@ import { SearchCriteriaDto, SearchCriteriaEltDto, VitamTenantConfigService, + SelectComponent, + DatepickerComponent, + InputComponent, + DialogHeaderComponent, VitamuiSelectOptions, } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../../../core/management-rules-shared-data.service'; @@ -59,6 +63,9 @@ import { UpdateUnitManagementRuleService } from '../../../../../common-services/ import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum'; import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service'; +import { MatMiniFabButton } from '@angular/material/button'; +import { NgStyle } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; const MANAGEMENT_RULE_IDENTIFIER = 'MANAGEMENT_RULE_IDENTIFIER'; const MANAGEMENT_RULE_START_DATE = 'MANAGEMENT_RULE_START_DATE'; @@ -68,7 +75,19 @@ const ORIGIN_HAS_AT_LEAST_ONE = 'ORIGIN_HAS_AT_LEAST_ONE'; selector: 'app-add-management-rules', templateUrl: './add-management-rules.component.html', styleUrls: ['./add-management-rules.component.css'], - standalone: false, + imports: [ + ReactiveFormsModule, + SelectComponent, + DatepickerComponent, + MatMiniFabButton, + NgStyle, + InputComponent, + MatProgressSpinner, + DialogHeaderComponent, + MatDialogActions, + MatDialogClose, + TranslatePipe, + ], }) export class AddManagementRulesComponent implements OnDestroy, OnInit { private managementRulesSharedDataService = inject(ManagementRulesSharedDataService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index 26b2e0445b0..c7b3d245321 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -42,7 +42,8 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { AddUpdatePropertyComponent } from './add-update-property.component'; @@ -135,8 +136,7 @@ describe('AddUpdatePropertyComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AddUpdatePropertyComponent], - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, AddUpdatePropertyComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts index a5b7212966f..d3d49298707 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts @@ -35,18 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnDestroy, OnInit, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { ManagementRulesSharedDataService } from '../../../../../../core/management-rules-shared-data.service'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; +import { SelectComponent, DialogHeaderComponent } from 'vitamui-library'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-add-update-property', templateUrl: './add-update-property.component.html', styleUrls: ['./add-update-property.component.css'], - standalone: false, + imports: [SelectComponent, ReactiveFormsModule, FormsModule, DialogHeaderComponent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class AddUpdatePropertyComponent implements OnInit, OnDestroy { private managementRulesSharedDataService = inject(ManagementRulesSharedDataService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index ad23f7614e5..3ecbe658e54 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -205,8 +205,7 @@ describe('ArchiveUnitRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ArchiveUnitRulesComponent], - imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ArchiveUnitRulesComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts index 5c89084ce91..be703858538 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts @@ -39,12 +39,31 @@ import { Observable, Subscription } from 'rxjs'; import { ManagementRulesSharedDataService } from '../../../../../core/management-rules-shared-data.service'; import { ActionsRules, ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../models/ruleAction.interface'; import { Rule } from 'vitamui-library'; +import { AddManagementRulesComponent } from './add-management-rules/add-management-rules.component'; +import { DeleteUnitRulesComponent } from './delete-unit-rules/delete-unit-rules.component'; +import { AddUpdatePropertyComponent } from './add-update-property/add-update-property.component'; +import { UpdateUnitRulesComponent } from './update-unit-rules/update-unit-rules.component'; +import { BlockCategoryInheritanceComponent } from './block-category-inheritance/block-category-inheritance.component'; +import { UnlockCategoryInheritanceComponent } from './unlock-category-inheritance/unlock-category-inheritance.component'; +import { BlockRulesInheritanceComponent } from './block-rules-inheritance/block-rules-inheritance.component'; +import { UnlockRulesInheritanceComponent } from './unlock-rules-inheritance/unlock-rules-inheritance.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-archive-unit-rules', templateUrl: './archive-unit-rules.component.html', styleUrls: ['./archive-unit-rules.component.css'], - standalone: false, + imports: [ + AddManagementRulesComponent, + DeleteUnitRulesComponent, + AddUpdatePropertyComponent, + UpdateUnitRulesComponent, + BlockCategoryInheritanceComponent, + UnlockCategoryInheritanceComponent, + BlockRulesInheritanceComponent, + UnlockRulesInheritanceComponent, + TranslatePipe, + ], }) export class ArchiveUnitRulesComponent implements OnDestroy { private managementRulesSharedDataService = inject(ManagementRulesSharedDataService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index 5cd9eb624df..1141eecf94b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -42,7 +42,8 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; @@ -134,8 +135,7 @@ describe('BlockCategoryInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [BlockCategoryInheritanceComponent], - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockCategoryInheritanceComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts index bbe9d376614..8b588f78581 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts @@ -35,17 +35,19 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnDestroy, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; +import { DialogHeaderComponent } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-block-category-inheritance', templateUrl: './block-category-inheritance.component.html', styleUrls: ['./block-category-inheritance.component.css'], - standalone: false, + imports: [DialogHeaderComponent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class BlockCategoryInheritanceComponent implements OnDestroy { private managementRulesSharedDataService = inject(ManagementRulesSharedDataService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index 475a0421259..f633c9bf32a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -43,7 +43,8 @@ import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, Rule, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, Rule, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { BlockRulesInheritanceComponent } from './block-rules-inheritance.component'; @@ -156,8 +157,7 @@ describe('BlockRulesInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [BlockRulesInheritanceComponent], - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockRulesInheritanceComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts index 1ccd6d9dce1..72d0e914da6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts @@ -35,21 +35,31 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { merge, Observable, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; -import { diff, ManagementRuleValidators, Rule, RuleService, SearchCriteriaDto, VitamuiSelectOptions } from 'vitamui-library'; +import { + diff, + ManagementRuleValidators, + Rule, + RuleService, + SearchCriteriaDto, + VitamuiSelectOptions, + SelectComponent, + DialogHeaderComponent, +} from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum'; import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-block-rules-inheritance', templateUrl: './block-rules-inheritance.component.html', styleUrls: ['./block-rules-inheritance.component.css'], - standalone: false, + imports: [ReactiveFormsModule, SelectComponent, DialogHeaderComponent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class BlockRulesInheritanceComponent implements OnDestroy, OnInit { private managementRulesValidatorService = inject(ManagementRulesValidatorService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts index a59118b677a..d4154088fc0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts @@ -215,8 +215,7 @@ describe('DeleteUnitRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [DeleteUnitRulesComponent], - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, DeleteUnitRulesComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts index 0410a2f5fff..cf601403bff 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { merge, Subscription, Observable } from 'rxjs'; @@ -53,12 +53,15 @@ import { VitamuiSelectOptions, diff, VitamTenantConfigService, + SelectComponent, + DialogHeaderComponent, } from 'vitamui-library'; import { ArchiveService } from '../../../../../archive.service'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum'; import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; const MANAGEMENT_RULE_IDENTIFIER = 'MANAGEMENT_RULE_IDENTIFIER'; const ORIGIN_HAS_AT_LEAST_ONE = 'ORIGIN_HAS_AT_LEAST_ONE'; @@ -67,7 +70,15 @@ const ORIGIN_HAS_AT_LEAST_ONE = 'ORIGIN_HAS_AT_LEAST_ONE'; selector: 'app-delete-unit-rules', templateUrl: './delete-unit-rules.component.html', styleUrls: ['./delete-unit-rules.component.css'], - standalone: false, + imports: [ + ReactiveFormsModule, + SelectComponent, + MatProgressSpinner, + DialogHeaderComponent, + MatDialogActions, + MatDialogClose, + TranslatePipe, + ], }) export class DeleteUnitRulesComponent implements OnDestroy, OnInit { private managementRulesValidatorService = inject(ManagementRulesValidatorService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index 457731d6e35..64831be6b7d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -42,7 +42,8 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; @@ -256,8 +257,7 @@ describe('UnlockCategoryInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [UnlockCategoryInheritanceComponent], - imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, UnlockCategoryInheritanceComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts index 28bfd61c1c8..0c37e6dba52 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts @@ -35,16 +35,24 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnDestroy, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { CriteriaDataType, CriteriaOperator, SearchCriteriaDto, SearchCriteriaEltDto, VitamTenantConfigService } from 'vitamui-library'; +import { + CriteriaDataType, + CriteriaOperator, + SearchCriteriaDto, + SearchCriteriaEltDto, + VitamTenantConfigService, + DialogHeaderComponent, +} from 'vitamui-library'; import { ArchiveService } from '../../../../../archive.service'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; const ORIGIN_HAS_AT_LEAST_ONE = 'ORIGIN_HAS_AT_LEAST_ONE'; const MANAGEMENT_RULE_INHERITED_CRITERIA = 'MANAGEMENT_RULE_INHERITED_CRITERIA'; @@ -52,7 +60,7 @@ const MANAGEMENT_RULE_INHERITED_CRITERIA = 'MANAGEMENT_RULE_INHERITED_CRITERIA'; selector: 'app-unlock-category-inheritance', templateUrl: './unlock-category-inheritance.component.html', styleUrls: ['./unlock-category-inheritance.component.css'], - standalone: false, + imports: [MatProgressSpinner, DialogHeaderComponent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class UnlockCategoryInheritanceComponent implements OnDestroy { private managementRulesSharedDataService = inject(ManagementRulesSharedDataService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts index 7141bc28afb..b2718dcb300 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts @@ -215,8 +215,7 @@ describe('UnlockRulesInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [UnlockRulesInheritanceComponent], - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UnlockRulesInheritanceComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts index 437c443acb9..463ed425dd3 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; @@ -54,11 +54,14 @@ import { SearchCriteriaEltDto, VitamuiSelectOptions, VitamTenantConfigService, + SelectComponent, + DialogHeaderComponent, } from 'vitamui-library'; import { ArchiveService } from '../../../../../archive.service'; import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum'; import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; const ORIGIN_HAS_AT_LEAST_ONE = 'ORIGIN_HAS_AT_LEAST_ONE'; const APPRAISAL_PREVENT_RULE_IDENTIFIER = 'APPRAISAL_PREVENT_RULE_IDENTIFIER'; @@ -68,7 +71,15 @@ const APPRAISAL_RULE_INHERITED_CRITERIA = 'APPRAISAL_RULE_INHERITED_CRITERIA'; selector: 'app-unlock-rules-inheritance', templateUrl: './unlock-rules-inheritance.component.html', styleUrls: ['./unlock-rules-inheritance.component.css'], - standalone: false, + imports: [ + ReactiveFormsModule, + SelectComponent, + MatProgressSpinner, + DialogHeaderComponent, + MatDialogActions, + MatDialogClose, + TranslatePipe, + ], }) export class UnlockRulesInheritanceComponent implements OnDestroy, OnInit { private managementRulesValidatorService = inject(ManagementRulesValidatorService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts index a55dbe4b5e2..841a3aa715f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts @@ -215,8 +215,7 @@ describe('UpdateUnitRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [UpdateUnitRulesComponent], - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UpdateUnitRulesComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts index f83abf149a0..3c45136c139 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, ValidationErrors, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { AbstractControl, FormBuilder, FormGroup, ValidationErrors, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { finalize, merge, Observable, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; @@ -52,6 +52,10 @@ import { SearchCriteriaEltDto, VitamuiSelectOptions, VitamTenantConfigService, + SelectComponent, + SlideToggleComponent, + DatepickerComponent, + DialogHeaderComponent, } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../../../archive.service'; @@ -59,6 +63,9 @@ import { UpdateUnitManagementRuleService } from '../../../../../common-services/ import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum'; import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { ManagementRulesValidatorService } from '../../../../../validators/management-rules-validator.service'; +import { MatMiniFabButton } from '@angular/material/button'; +import { NgStyle } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; const MANAGEMENT_RULE_IDENTIFIER = 'MANAGEMENT_RULE_IDENTIFIER'; const ORIGIN_HAS_AT_LEAST_ONE = 'ORIGIN_HAS_AT_LEAST_ONE'; @@ -85,7 +92,19 @@ const LocalValidators = { selector: 'app-update-unit-rules', templateUrl: './update-unit-rules.component.html', styleUrls: ['./update-unit-rules.component.css'], - standalone: false, + imports: [ + ReactiveFormsModule, + SelectComponent, + SlideToggleComponent, + DatepickerComponent, + MatMiniFabButton, + NgStyle, + MatProgressSpinner, + DialogHeaderComponent, + MatDialogActions, + MatDialogClose, + TranslatePipe, + ], }) export class UpdateUnitRulesComponent implements OnDestroy, OnInit { private archiveService = inject(ArchiveService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index 7fe49f6a6b7..e1e2813da33 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -42,7 +42,8 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, SearchCriteriaDto, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, SearchCriteriaDto, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../archive.service'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../models/ruleAction.interface'; @@ -149,8 +150,7 @@ describe('ManagementRulesComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [ManagementRulesComponent], - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule], + imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ManagementRulesComponent], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts index 2ef474d21c7..2f16e3447bf 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Observable, Subscription } from 'rxjs'; import { filter, map, shareReplay } from 'rxjs/operators'; import { @@ -52,6 +52,8 @@ import { SelectComponent, SnackBarService, VitamTenantConfigService, + VitamuiTitleBreadcrumbComponent, + DialogHeaderComponent, } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../archive.service'; @@ -64,6 +66,10 @@ import { RuleSearchCriteriaDto, } from '../../../models/ruleAction.interface'; import { Location } from '@angular/common'; +import { MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; +import { MatRadioButton } from '@angular/material/radio'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { ArchiveUnitRulesComponent } from './archive-unit-rules/archive-unit-rules.component'; const ARCHIVE_UNIT_HOLDING_UNIT = 'ARCHIVE_UNIT_HOLDING_UNIT'; @@ -71,7 +77,20 @@ const ARCHIVE_UNIT_HOLDING_UNIT = 'ARCHIVE_UNIT_HOLDING_UNIT'; selector: 'app-management-rules', templateUrl: './management-rules.component.html', styleUrls: ['./management-rules.component.css'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + MatRadioButton, + SelectComponent, + MatTabGroup, + MatTab, + ArchiveUnitRulesComponent, + DialogHeaderComponent, + MatDialogActions, + MatDialogClose, + TranslatePipe, + ], }) export class ManagementRulesComponent implements OnInit, OnChanges, OnDestroy { private archiveService = inject(ArchiveService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts index e6914d1266f..015260afe8a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts @@ -40,7 +40,8 @@ import { of, throwError } from 'rxjs'; import { HttpErrorResponse } from '@angular/common/http'; import { ReassignmentDialogService } from './reassignment-dialog.service'; import { ArchiveService } from '../../../archive.service'; -import { SnackBarService, SearchCriteriaEltDto, CriteriaOperator, CriteriaDataType, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { SearchCriteriaEltDto } from 'vitamui-library'; +import { SnackBarService, CriteriaOperator, CriteriaDataType, SearchCriteriaTypeEnum } from 'vitamui-library'; import { ReassignmentMode } from '../../../models/reassign-request.interface'; describe('ReassignmentDialogService', () => { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts index d161c28c743..49433232d46 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts @@ -40,7 +40,8 @@ import { of, throwError } from 'rxjs'; import { HttpErrorResponse } from '@angular/common/http'; import { PreservationDialogService } from './preservation-dialog.service'; import { ArchiveService } from '../../../archive.service'; -import { SnackBarService, SearchCriteriaEltDto, CriteriaOperator, CriteriaDataType, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { SearchCriteriaEltDto } from 'vitamui-library'; +import { SnackBarService, CriteriaOperator, CriteriaDataType, SearchCriteriaTypeEnum } from 'vitamui-library'; import { PreservationUsage, PreservationVersion } from '../../../models/preservation-request.interface'; describe('PreservationDialogService', () => { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts index 14ae3ff12c5..8f3d04d47d6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts @@ -39,7 +39,8 @@ import { MatDialog } from '@angular/material/dialog'; import { HttpErrorResponse } from '@angular/common/http'; import { catchError, filter, switchMap } from 'rxjs/operators'; import { EMPTY } from 'rxjs'; -import { ApplicationId, SearchCriteriaDto, SearchCriteriaEltDto, SnackBarService } from 'vitamui-library'; +import { SearchCriteriaDto, SearchCriteriaEltDto, SnackBarService } from 'vitamui-library'; +import { ApplicationId } from 'vitamui-library'; import { ArchiveService } from '../../../archive.service'; import { PreservationDialogComponent } from './preservation-dialog.component'; import { PreservationRequestDto } from '../../../models/preservation-request.interface'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts index 1ef9f567afa..38f3f61e422 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts @@ -41,7 +41,8 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService, InjectorModule, LoggerModule, UsageVersionEnum, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ConfirmDialogService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, UsageVersionEnum } from 'vitamui-library'; import { ArchiveApiService } from '../../../../core/api/archive-api.service'; import { TransferRequestModalComponent } from './transfer-request-modal.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -73,8 +74,7 @@ describe('TransferRequestModalComponent tests', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [TransferRequestModalComponent], - imports: [InjectorModule, MatButtonToggleModule, LoggerModule.forRoot()], + imports: [InjectorModule, MatButtonToggleModule, LoggerModule.forRoot(), TransferRequestModalComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts index a60a160355c..d9486f392af 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { ApplicationId, @@ -49,16 +49,43 @@ import { UsageVersionEnum, VitamuiSelectOptions, SnackBarService, + DialogHeaderComponent, + StepperComponent, + InputComponent, + NextStepComponent, + SelectComponent, + PreviousStepComponent, } from 'vitamui-library'; import { ArchiveService } from '../../../archive.service'; import { QualifierVersion, TransferRequestDto } from '../../../models/dip.interface'; import { delay, distinctUntilChanged, map } from 'rxjs/operators'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; @Component({ selector: 'app-transfer-request-modal', templateUrl: './transfer-request-modal.component.html', styleUrls: ['./transfer-request-modal.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + StepperComponent, + CdkStep, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + InputComponent, + MatDialogActions, + NextStepComponent, + MatButtonToggleGroup, + MatButtonToggle, + SelectComponent, + MatRadioGroup, + MatRadioButton, + PreviousStepComponent, + TranslatePipe, + ], }) export class TransferRequestModalComponent implements OnInit, OnDestroy { private translate = inject(TranslateService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts index e3bb33235c7..897488686ce 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts @@ -37,12 +37,29 @@ import { Component, Input } from '@angular/core'; import { RuleFacets } from 'vitamui-library'; +import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { SearchStorageRulesFacetsComponent } from './search-storage-rules-facets/search-storage-rules-facets.component'; +import { SearchAppraisalRulesFacetsComponent } from './search-appraisal-rules-facets/search-appraisal-rules-facets.component'; +import { SearchAccessRulesFacetsComponent } from './search-access-rules-facets/search-access-rules-facets.component'; +import { SearchDisseminationRulesFacetsComponent } from './search-dissemination-rules-facets/search-dissemination-rules-facets.component'; +import { SearchReuseRulesFacetsComponent } from './search-reuse-rules-facets/search-reuse-rules-facets.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-archive-search-rules-facets', templateUrl: './archive-search-rules-facets.component.html', styleUrls: ['./archive-search-rules-facets.component.css'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + MatTabLabel, + SearchStorageRulesFacetsComponent, + SearchAppraisalRulesFacetsComponent, + SearchAccessRulesFacetsComponent, + SearchDisseminationRulesFacetsComponent, + SearchReuseRulesFacetsComponent, + TranslatePipe, + ], }) export class ArchiveSearchRulesFacetsComponent { @Input() diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts index d42d956faf9..aaef01d21b1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; @@ -46,7 +47,7 @@ import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-e selector: 'app-search-access-rules-facets', templateUrl: './search-access-rules-facets.component.html', styleUrls: ['./search-access-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchAccessRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts index 918478d2818..083d6f0c378 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; @@ -46,7 +47,7 @@ import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-e selector: 'app-search-appraisal-rules-facets', templateUrl: './search-appraisal-rules-facets.component.html', styleUrls: ['./search-appraisal-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchAppraisalRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts index ea54543f646..4f9cfdf3f23 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts @@ -36,8 +36,9 @@ */ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; @@ -45,7 +46,7 @@ import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-e selector: 'app-search-dissemination-rules-facets', templateUrl: './search-dissemination-rules-facets.component.html', styleUrls: ['./search-dissemination-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchDisseminationRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts index 1928c6918a1..34be5127393 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts @@ -36,8 +36,9 @@ */ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; @@ -45,7 +46,7 @@ import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-e selector: 'app-search-reuse-rules-facets', templateUrl: './search-reuse-rules-facets.component.html', styleUrls: ['./search-reuse-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchReuseRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts index 969fc25dab4..164cf061d18 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; @@ -46,7 +47,7 @@ import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-e selector: 'app-search-storage-rules-facets', templateUrl: './search-storage-rules-facets.component.html', styleUrls: ['./search-storage-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchStorageRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index 3f82ec0dcc5..c3faf244435 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -191,7 +191,6 @@ describe('ArchiveSearchComponent', () => { vi.spyOn(archiveServiceStub, 'searchArchiveUnitsByCriteria'); await TestBed.configureTestingModule({ - declarations: [ArchiveSearchComponent, SimpleCriteriaSearchComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ InjectorModule, @@ -201,6 +200,8 @@ describe('ArchiveSearchComponent', () => { MatSidenavModule, MatTreeModule, RouterTestingModule, + ArchiveSearchComponent, + SimpleCriteriaSearchComponent, ], providers: [ ArchiveSearchHelperService, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts index 82b36087394..4dbf83080d7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts @@ -50,9 +50,9 @@ import { ViewChild, inject, } from '@angular/core'; -import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { MatDialog, MatDialogConfig, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { merge, Observable, Subject, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; import { @@ -108,6 +108,17 @@ import { VitamuiRoles, WAITING_RECALCULATE, VitamTenantConfigService, + VitamuiMenuButtonComponent, + ManagementRuleSearchComponent, + VitamuiSupHeaderComponent, + ArchiveUnitModule, + TooltipDirective, + DialogHeaderComponent, + OrderByButtonComponent, + PipesModule, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../../core/management-rules-shared-data.service'; @@ -122,10 +133,32 @@ import { ActionsRules } from '../models/ruleAction.interface'; import { SearchCriteriaSaverComponent } from './search-criteria-saver/search-criteria-saver.component'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment/transfer-acknowledgment.component'; import { PuaUpdateDialogComponent, PuaUpdateDialogComponentData } from './pua-update-dialog/pua-update-dialog.component'; -import { MatCheckboxChange } from '@angular/material/checkbox'; +import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; import { ReassignmentDialogService } from './additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service'; import { PreservationDialogService } from './additional-actions-search/preservation-dialog/preservation-dialog.service'; import { ReassignmentMode } from '../models/reassign-request.interface'; +import { TitleAndDescriptionCriteriaSearchComponent } from './title-and-description-criteria-search/title-and-description-criteria-search.component'; +import { MatMenuItem, MatMenuTrigger, MatMenu } from '@angular/material/menu'; +import { CriteriaSearchComponent } from '../criteria-search/criteria-search.component'; +import { SearchCriteriaListComponent } from './search-criteria-list/search-criteria-list.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { NgClass, NgTemplateOutlet, AsyncPipe, CommonModule } from '@angular/common'; +import { ArchiveSearchRulesFacetsComponent } from './archive-search-rules-facets/archive-search-rules-facets.component'; +import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { SimpleCriteriaSearchComponent } from './simple-criteria-search/simple-criteria-search.component'; +import { + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + MatCellDef, + MatCell, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, +} from '@angular/material/table'; +import { CdkScrollable } from '@angular/cdk/scrolling'; const PAGE_SIZE = 10; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -138,13 +171,57 @@ const NON_TREE_UNIT_TYPES = [ARCHIVE_UNIT_FILING_UNIT, ARCHIVE_UNIT_WITH_OBJECTS selector: 'app-archive-search', templateUrl: './archive-search.component.html', styleUrls: ['./archive-search.component.scss'], - standalone: false, providers: [ { provide: MANAGEMENT_RULE_SHARED_DATA_SERVICE, useExisting: ArchiveSharedDataService, }, ], + imports: [ + TitleAndDescriptionCriteriaSearchComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + CriteriaSearchComponent, + MatMenuTrigger, + MatMenu, + SearchCriteriaListComponent, + MatProgressSpinner, + NgClass, + ArchiveSearchRulesFacetsComponent, + MatTabGroup, + MatTab, + SimpleCriteriaSearchComponent, + MatTabLabel, + ManagementRuleSearchComponent, + VitamuiSupHeaderComponent, + ArchiveUnitModule, + TooltipDirective, + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + NgTemplateOutlet, + MatCellDef, + MatCell, + MatCheckbox, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, + DialogHeaderComponent, + MatDialogActions, + MatDialogClose, + CdkScrollable, + MatDialogContent, + OrderByButtonComponent, + AsyncPipe, + PipesModule, + TranslatePipe, + CommonModule, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, + ], }) export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, AfterContentChecked, AfterViewInit { archiveService = inject(ArchiveService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts index 6665b30bcd7..8c7e3bdad29 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts @@ -72,12 +72,24 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; +import { PipesModule, ClosePopupDialogComponent, CommonConfirmDialogComponent, DialogHeaderComponent } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; +import { MatDialogModule } from '@angular/material/dialog'; // FIXME: should be factorized in vitamui-library ConfirmActionComponent @Component({ selector: 'vitamui-confirm-action', templateUrl: './confirm-action.component.html', - standalone: false, + imports: [ + PipesModule, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + MatDialogModule, + ], }) export class ConfirmActionComponent { // delete or changeTab diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.module.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.module.ts deleted file mode 100644 index 4d5b5a20e19..00000000000 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { ConfirmDialogModule, VitamUICommonModule } from 'vitamui-library'; -import { ConfirmActionComponent } from './confirm-action.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ConfirmActionComponent], - imports: [CommonModule, MatDialogModule, ConfirmDialogModule, VitamUICommonModule, TranslatePipe], - exports: [ConfirmActionComponent], -}) -export class ConfirmActionModule {} diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts index 47249a8f921..5c093649147 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts @@ -56,10 +56,7 @@ import { ArchiveSharedDataService } from '../../../core/archive-shared-data.serv import { SearchCriteriaListComponent } from './search-criteria-list.component'; import { SearchCriteriaListService } from './search-criteria-list.service'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -95,8 +92,7 @@ describe('SearchCriteriaListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule], - declarations: [SearchCriteriaListComponent, MockTruncatePipe], + imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, SearchCriteriaListComponent, MockTruncatePipe], providers: [ ArchiveSharedDataService, DatePipe, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts index 6f45e316fcc..2902a5a422e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts @@ -36,19 +36,22 @@ */ import { Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { Direction, SearchCriteriaHistory, SnackBarService } from 'vitamui-library'; +import { SearchCriteriaHistory, SnackBarService } from 'vitamui-library'; +import { Direction, TooltipDirective, PipesModule } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ConfirmActionComponent } from './confirm-action/confirm-action.component'; import { SearchCriteriaListService } from './search-criteria-list.service'; +import { MatMenuItem } from '@angular/material/menu'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ selector: 'app-search-criteria-list', templateUrl: './search-criteria-list.component.html', styleUrls: ['./search-criteria-list.component.css'], - standalone: false, + imports: [MatMenuItem, TooltipDirective, MatProgressSpinner, PipesModule, TranslatePipe], }) export class SearchCriteriaListComponent implements OnInit, OnDestroy { private searchCriteriaListService = inject(SearchCriteriaListService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts index c6c52ef6ce4..e37f9497b39 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -59,10 +59,7 @@ import { ArchiveSharedDataService } from '../../../core/archive-shared-data.serv import { SearchCriteriaSaverComponent } from './search-criteria-saver.component'; import { SearchCriteriaSaverService } from './search-criteria-saver.service'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -99,8 +96,7 @@ describe('SearchCriteriaSaverComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule], - declarations: [SearchCriteriaSaverComponent, MockTruncatePipe], + imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, SearchCriteriaSaverComponent, MockTruncatePipe], providers: [ FormBuilder, ArchiveSharedDataService, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts index 3060f21b690..a4dd2dfe32d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts @@ -36,7 +36,7 @@ */ import { DatePipe } from '@angular/common'; import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslatePipe } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; @@ -49,6 +49,11 @@ import { SnackBarService, ORIGIN_WAITING_RECALCULATE, WAITING_RECALCULATE, + ChipComponent, + TooltipDirective, + InputComponent, + ElementsComponent, + PipesModule, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { SearchCriteriaSaverService } from './search-criteria-saver.service'; @@ -58,7 +63,7 @@ import { SearchCriteriaSaverService } from './search-criteria-saver.service'; templateUrl: './search-criteria-saver.component.html', styleUrls: ['./search-criteria-saver.component.css'], providers: [TranslatePipe], - standalone: false, + imports: [ChipComponent, TooltipDirective, ReactiveFormsModule, InputComponent, ElementsComponent, PipesModule, TranslatePipe], }) export class SearchCriteriaSaverComponent implements OnInit, OnDestroy { data = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts index 76e4acd6783..42919b7a8d1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts @@ -92,8 +92,7 @@ describe('SimpleCriteriaSearchComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [SimpleCriteriaSearchComponent], - imports: [InjectorModule, AgenciesModule, LoggerModule.forRoot()], + imports: [InjectorModule, AgenciesModule, LoggerModule.forRoot(), SimpleCriteriaSearchComponent], providers: [ FormBuilder, { provide: ArchiveService, useValue: archiveServiceStub }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts index 43093fca298..7d971123f95 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, ChangeDetectorRef, inject } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { AbstractControl, FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { AgencyService, ArchiveUnitProfilesService, @@ -55,6 +55,25 @@ import { SearchCriteriaTypeEnum, SearchType, VitamuiSelectOptions, + FormFieldValueWrapperComponent, + SearchWithTypeSelectorComponent, + SelectComponent, + DatepickerComponent, + SelectWithTreeComponent, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../../../core/management-rules-shared-data.service'; @@ -63,7 +82,15 @@ import { combineLatest } from 'rxjs'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; import { ActivatedRoute, Params } from '@angular/router'; import { ArchiveSearchHelperService } from '../../common-services/archive-search-helper.service'; -import { MatCheckboxChange } from '@angular/material/checkbox'; +import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { NgTemplateOutlet, CommonModule } from '@angular/common'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; const FINAL_ACTION_TYPE = 'FINAL_ACTION_TYPE'; const ARCHIVE_UNIT_FILING_UNIT = 'ARCHIVE_UNIT_FILING_UNIT'; @@ -84,7 +111,41 @@ const COMPLEX_INPUTS = ['otherCriteriaList']; selector: 'app-simple-criteria-search', templateUrl: './simple-criteria-search.component.html', styleUrls: ['./simple-criteria-search.component.css'], - standalone: false, + imports: [ + ReactiveFormsModule, + FormFieldValueWrapperComponent, + SearchWithTypeSelectorComponent, + MatProgressSpinner, + SelectComponent, + DatepickerComponent, + MatCheckbox, + NgTemplateOutlet, + SelectWithTreeComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class SimpleCriteriaSearchComponent implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts index 64a918cbb6c..2ca5d5a6ebb 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts @@ -38,7 +38,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { CriteriaOperator, CriteriaValue, InjectorModule } from 'vitamui-library'; +import { CriteriaValue } from 'vitamui-library'; +import { CriteriaOperator, InjectorModule } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { TitleAndDescriptionCriteriaSearchComponent } from './title-and-description-criteria-search.component'; @@ -56,13 +57,12 @@ describe('TitleAndDescriptionCriteriaSearchComponent', () => { }; matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - declarations: [TitleAndDescriptionCriteriaSearchComponent], providers: [ FormBuilder, { provide: MatDialog, useValue: matDialogSpy }, { provide: ArchiveSharedDataService, useValue: archiveExchangeDataServiceMock }, ], - imports: [InjectorModule], + imports: [InjectorModule, TitleAndDescriptionCriteriaSearchComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts index 45951597646..afd8901823e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts @@ -35,20 +35,74 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { merge } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; -import { CriteriaDataType, CriteriaOperator, CriteriaValue, diff, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { CriteriaValue } from 'vitamui-library'; +import { + CriteriaDataType, + CriteriaOperator, + diff, + SearchCriteriaTypeEnum, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, +} from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const TITLE_OR_DESCRIPTION = 'TITLE_OR_DESCRIPTION'; @Component({ selector: 'app-title-and-description-criteria-search', templateUrl: './title-and-description-criteria-search.component.html', - standalone: false, + imports: [ + ReactiveFormsModule, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class TitleAndDescriptionCriteriaSearchComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index 450382aa5d5..2a56dc4680b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -39,7 +39,8 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, BytesPipe, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment.component'; import { DecimalPipe } from '@angular/common'; @@ -47,10 +48,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { CdkStep } from '@angular/cdk/stepper'; -@Pipe({ - name: 'dateTime', - standalone: false, -}) +@Pipe({ name: 'dateTime' }) export class MockDateTimePipe implements PipeTransform { transform(value: string = ''): any { return value; @@ -90,8 +88,7 @@ describe('TransferAcknowledgmentComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [MockDateTimePipe], - imports: [TransferAcknowledgmentComponent, CdkStep, NoopAnimationsModule, InjectorModule, LoggerModule.forRoot()], + imports: [TransferAcknowledgmentComponent, CdkStep, NoopAnimationsModule, InjectorModule, LoggerModule.forRoot(), MockDateTimePipe], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts index 32ec6f0dc35..4ce9ffe6669 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts @@ -108,7 +108,6 @@ describe('ArchiveComponent', () => { }; matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - declarations: [ArchiveComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ MatDatepickerModule, @@ -122,6 +121,7 @@ describe('ArchiveComponent', () => { RouterTestingModule, NoopAnimationsModule, SearchBarComponent, + ArchiveComponent, ], providers: [ FormBuilder, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts index 63ecf1817d2..7ebd4949461 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts @@ -47,16 +47,40 @@ import { SidenavPage, SnackBarService, Unit, + VitamuiTitleBreadcrumbComponent, + TooltipDirective, + ResizeSidebarDirective, + ResizeVerticalDirective, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../core/management-rules-shared-data.service'; import { ArchiveService } from './archive.service'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { FilingHoldingSchemeComponent } from './filing-holding-scheme/filing-holding-scheme.component'; +import { NgClass, CommonModule } from '@angular/common'; +import { ArchivePreviewComponent } from './archive-preview/archive-preview.component'; +import { ArchiveSearchComponent } from './archive-search/archive-search.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-archive', templateUrl: './archive.component.html', styleUrls: ['./archive.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + FilingHoldingSchemeComponent, + NgClass, + ArchivePreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + TooltipDirective, + ArchiveSearchComponent, + TranslatePipe, + CommonModule, + ResizeSidebarDirective, + ResizeVerticalDirective, + ], }) export class ArchiveComponent extends SidenavPage implements OnInit { private route: ActivatedRoute; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.module.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.module.ts index 014f3f1e130..a9dc0209345 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.module.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.module.ts @@ -91,7 +91,7 @@ import { ClassificationTreeComponent } from './filing-holding-scheme/classificat import { FilingHoldingSchemeComponent } from './filing-holding-scheme/filing-holding-scheme.component'; import { LeavesTreeComponent } from './filing-holding-scheme/leaves-tree/leaves-tree.component'; import { MatTableModule } from '@angular/material/table'; -import { ConfirmActionModule } from './archive-search/search-criteria-list/confirm-action/confirm-action.module'; + import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ @@ -116,14 +116,11 @@ import { TranslatePipe } from '@ngx-translate/core'; MatTabsModule, MatTreeModule, ReactiveFormsModule, - ConfirmActionModule, VitamUICommonModule, VitamUILibraryModule, MatTableModule, TranslatePipe, DiscussionIconComponent, - ], - declarations: [ AddManagementRulesComponent, AddUpdatePropertyComponent, ArchiveComponent, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts index 5f7df9aa461..2909f16eba2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts @@ -39,7 +39,8 @@ import { TestBed } from '@angular/core/testing'; import { ArchiveService } from './archive.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BASE_URL, LoggerModule, Unit } from 'vitamui-library'; +import { BASE_URL, Unit } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { ArchiveApiService } from '../core/api/archive-api.service'; import { vi } from 'vitest'; import { of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts index 03a261500f0..ae6dcb095ba 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { ResultFacet, ResultFacetList, LoggerModule, BASE_URL } from 'vitamui-library'; +import { ResultFacet, ResultFacetList, BASE_URL } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { ArchiveFacetsService } from './archive-facets.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts index 15ac185cf47..ee08f3362bb 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts @@ -38,7 +38,8 @@ import { inject, Injectable, TemplateRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { filter } from 'rxjs/operators'; -import { ApplicationId, VitamTenantConfigService, SearchCriteriaEltDto, SnackBarService } from 'vitamui-library'; +import { VitamTenantConfigService, SearchCriteriaEltDto, SnackBarService } from 'vitamui-library'; +import { ApplicationId } from 'vitamui-library'; import { ArchiveSearchComponent } from '../archive-search/archive-search.component'; import { ArchiveService } from '../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts index 921d970ea58..5fc082e7c72 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts @@ -40,7 +40,8 @@ import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { CriteriaDataType, CriteriaOperator, SearchCriteriaEltDto, SearchCriteriaTypeEnum, UnitType } from 'vitamui-library'; +import { SearchCriteriaEltDto } from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, SearchCriteriaTypeEnum, UnitType } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../core/management-rules-shared-data.service'; import { ArchiveSearchComponent } from '../archive-search/archive-search.component'; import { ArchiveService } from '../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts index 939f21403c3..4b487df56d1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts @@ -58,7 +58,6 @@ describe('CriteriaSearchComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [CriteriaSearchComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ InjectorModule, @@ -67,6 +66,7 @@ describe('CriteriaSearchComponent', () => { BrowserAnimationsModule, LoggerModule.forRoot(), RouterTestingModule, + CriteriaSearchComponent, ], providers: [ TranslateWithOptionalTypeSuffixPipe, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts index 55bcb282ad0..6b55989c509 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts @@ -35,21 +35,24 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import type { CriteriaSearchCriteria, CriteriaValue, SearchCriteriaValue } from 'vitamui-library'; +import { CriteriaSearchCriteria, CriteriaValue, SearchCriteriaValue } from 'vitamui-library'; import { ORIGIN_WAITING_RECALCULATE, QueryParamsService, SearchCriteriaTypeEnum, TranslateWithOptionalTypeSuffixPipe, WAITING_RECALCULATE, + TooltipDirective, + PipesModule, } from 'vitamui-library'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { NgClass } from '@angular/common'; @Component({ selector: 'app-criteria-search', templateUrl: './criteria-search.component.html', styleUrls: ['./criteria-search.component.scss'], - standalone: false, providers: [TranslateWithOptionalTypeSuffixPipe], + imports: [TooltipDirective, NgClass, PipesModule, TranslatePipe], }) export class CriteriaSearchComponent { private queryParamsService = inject(QueryParamsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts index 0a4b671bf13..8c3e79bc948 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts @@ -36,14 +36,35 @@ */ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; -import { FilingHoldingSchemeNode, nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon } from 'vitamui-library'; +import { + MatTreeNestedDataSource, + MatTree, + MatTreeNodeDef, + MatTreeNode, + MatNestedTreeNode, + MatTreeNodeOutlet, +} from '@angular/material/tree'; +import { FilingHoldingSchemeNode } from 'vitamui-library'; +import { nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon, VitamuiTreeNodeComponent } from 'vitamui-library'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { DecimalPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-classification-tree', templateUrl: './classification-tree.component.html', styleUrls: ['./classification-tree.component.scss'], - standalone: false, + imports: [ + MatProgressSpinner, + MatTree, + MatTreeNodeDef, + MatTreeNode, + VitamuiTreeNodeComponent, + MatNestedTreeNode, + MatTreeNodeOutlet, + DecimalPipe, + TranslatePipe, + ], }) export class ClassificationTreeComponent { @Input() loadingHolding: boolean; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts index 4fc7778fadb..4ac1beef2bd 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -43,7 +43,8 @@ import { MatTreeModule } from '@angular/material/tree'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { FilingHoldingSchemeNode, InjectorModule, LoggerModule } from 'vitamui-library'; +import { FilingHoldingSchemeNode } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { ArchiveApiService } from '../../core/api/archive-api.service'; import { ArchiveService } from '../archive.service'; @@ -72,8 +73,8 @@ describe('FilingHoldingSchemeComponent', () => { InjectorModule, LoggerModule.forRoot(), RouterTestingModule, + FilingHoldingSchemeComponent, ], - declarations: [FilingHoldingSchemeComponent], providers: [ { provide: ArchiveService, useValue: archiveServiceStub }, { provide: ArchiveApiService, useValue: archiveServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts index 7fed6f0672e..f583a799073 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts @@ -51,16 +51,21 @@ import { SearchCriteriaTypeEnum, Unit, UnitType, + ResizeSidebarDirective, + ResizeVerticalDirective, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { ArchiveService } from '../archive.service'; import { NodeData } from '../models/nodedata.interface'; +import { ClassificationTreeComponent } from './classification-tree/classification-tree.component'; +import { LeavesTreeComponent } from './leaves-tree/leaves-tree.component'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-filing-holding-scheme', templateUrl: './filing-holding-scheme.component.html', styleUrls: ['./filing-holding-scheme.component.scss'], - standalone: false, + imports: [ClassificationTreeComponent, LeavesTreeComponent, CommonModule, ResizeSidebarDirective, ResizeVerticalDirective], }) export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts index 44ee1695fda..fcb7b953641 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts @@ -121,7 +121,6 @@ describe('LeavesTreeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [LeavesTreeComponent], imports: [ MatMenuModule, MatTreeModule, @@ -130,6 +129,7 @@ describe('LeavesTreeComponent', () => { InjectorModule, LoggerModule.forRoot(), RouterTestingModule, + LeavesTreeComponent, ], providers: [ { provide: ArchiveService, useValue: archiveServiceStub }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts index 8001dd4736d..3c9a099bd84 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts @@ -36,7 +36,7 @@ */ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, inject } from '@angular/core'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; +import { MatTreeNestedDataSource, MatTree, MatTreeNodeDef, MatNestedTreeNode, MatTreeNodeOutlet } from '@angular/material/tree'; import { Subscription } from 'rxjs'; import { ConfigurationsApiService, @@ -50,16 +50,32 @@ import { SearchCriteriaDto, Unit, UnitType, + TooltipDirective, + VitamuiTreeNodeComponent, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ArchiveService } from '../../archive.service'; import { first } from 'rxjs/operators'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { NgClass, DecimalPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-leaves-tree', templateUrl: './leaves-tree.component.html', styleUrls: ['./leaves-tree.component.scss'], - standalone: false, + imports: [ + MatProgressSpinner, + TooltipDirective, + MatTree, + MatTreeNodeDef, + MatNestedTreeNode, + NgClass, + VitamuiTreeNodeComponent, + MatTreeNodeOutlet, + DecimalPipe, + TranslatePipe, + ], }) export class LeavesTreeComponent implements OnInit, OnChanges, OnDestroy { private archiveSharedDataService = inject(ArchiveSharedDataService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts index 0b3fc92ccc0..671ebc2ce0d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts @@ -41,7 +41,8 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { MissingTranslationHandler, TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, LoggerModule, ObjectQualifierType, VitamuiMissingTranslationHandler } from 'vitamui-library'; +import { BASE_URL, VitamuiMissingTranslationHandler } from 'vitamui-library'; +import { LoggerModule, ObjectQualifierType } from 'vitamui-library'; import { FoundObjectModalComponent } from './found-object-modal.component'; class FakeTranslateLoader implements TranslateLoader { @@ -68,8 +69,7 @@ describe('ErrorResponseModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [FoundObjectModalComponent], - imports: [LoggerModule.forRoot(), RouterTestingModule], + imports: [LoggerModule.forRoot(), RouterTestingModule, FoundObjectModalComponent], providers: [ { provide: MatDialogRef, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts index f4e50a0d304..cba029173d9 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; import { NavigationExtras, Router } from '@angular/router'; import { AccessContract, @@ -45,15 +45,17 @@ import { qualifiersToVersionsWithQualifier, TenantSelectionService, VersionWithQualifierDto, + DialogHeaderComponent, } from 'vitamui-library'; import { PurgedPersistentIdentifierDto } from '../../../core/api/persistent-identifier-response-dto.interface'; import { ArchiveService } from '../../archive.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-found-object-modal', templateUrl: './found-object-modal.component.html', styleUrls: ['./found-object-modal.component.scss'], - standalone: false, + imports: [DialogHeaderComponent, MatDialogActions, TranslatePipe], }) export class FoundObjectModalComponent { private dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts index dc502f7b6e3..2603c73de89 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts @@ -59,8 +59,7 @@ describe('PersistentIdentifierSearchComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [PersistentIdentifierSearchComponent], - imports: [MatDialogModule, RouterTestingModule], + imports: [MatDialogModule, RouterTestingModule, PersistentIdentifierSearchComponent], providers: [ { provide: BASE_URL, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts index 656a66c2a86..d6d1ef5a7ae 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts @@ -38,11 +38,19 @@ import { Component, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { NavigationExtras, Router } from '@angular/router'; import { combineLatest } from 'rxjs'; -import { ApiUnitObject, ApplicationId, BreadCrumbData, TenantSelectionService } from 'vitamui-library'; +import { + ApiUnitObject, + ApplicationId, + BreadCrumbData, + TenantSelectionService, + VitamuiTitleBreadcrumbComponent, + SearchBarComponent, +} from 'vitamui-library'; import { PurgedPersistentIdentifierDto } from '../../core/api/persistent-identifier-response-dto.interface'; import { PersistentIdentifierService } from '../persistent-identifier.service'; import { FoundObjectModalComponent } from './found-object-modal/found-object-modal.component'; import { PurgedPersistentIdentifierModalComponent } from './purged-persistent-identifier-modal/purged-persistent-identifier-modal.component'; +import { TranslatePipe } from '@ngx-translate/core'; const PERMANENT_IDENTIFIER = 'PersistentIdentifier.PersistentIdentifierContent'; @@ -50,7 +58,7 @@ const PERMANENT_IDENTIFIER = 'PersistentIdentifier.PersistentIdentifierContent'; selector: 'app-persistent-identifier-search', templateUrl: './persistent-identifier-search.component.html', styleUrls: ['./persistent-identifier-search.component.scss'], - standalone: false, + imports: [VitamuiTitleBreadcrumbComponent, SearchBarComponent, TranslatePipe], }) export class PersistentIdentifierSearchComponent { private dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.module.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.module.ts index 42af00cb574..10afa80be0b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.module.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.module.ts @@ -52,7 +52,9 @@ import { TranslatePipe } from '@ngx-translate/core'; MatDialogModule, VitamUILibraryModule, TranslatePipe, + PersistentIdentifierSearchComponent, + PurgedPersistentIdentifierModalComponent, + FoundObjectModalComponent, ], - declarations: [PersistentIdentifierSearchComponent, PurgedPersistentIdentifierModalComponent, FoundObjectModalComponent], }) export class PersistentIdentifierSearchModule {} diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts index 1b5c5d9d49e..76d3bd5a48a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts @@ -71,8 +71,7 @@ describe('ErrorResponseModalComponent', () => { async function init(type: any, operationType: any) { await TestBed.configureTestingModule({ - declarations: [PurgedPersistentIdentifierModalComponent], - imports: [], + imports: [PurgedPersistentIdentifierModalComponent], providers: [ { provide: MatDialogRef, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts index 13d7fed97c1..d7fe38e7ce4 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts @@ -35,18 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; import { ObjectPurgedPersistentOperationType, PurgedPersistentIdentifierDto, UnitPurgedPersistentOperationType, } from '../../../core/api/persistent-identifier-response-dto.interface'; +import { DialogHeaderComponent } from 'vitamui-library'; +import { DatePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-purged-persistent-identifier-modal', templateUrl: './purged-persistent-identifier-modal.component.html', styleUrls: ['./purged-persistent-identifier-modal.component.scss'], - standalone: false, + imports: [DialogHeaderComponent, MatDialogActions, DatePipe, TranslatePipe], }) export class PurgedPersistentIdentifierModalComponent implements OnInit { private dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts index 07fdd0c3977..b1ac7737e73 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts @@ -38,7 +38,8 @@ import { Injectable, inject } from '@angular/core'; import { AbstractControl, AsyncValidatorFn } from '@angular/forms'; import { of, timer } from 'rxjs'; import { map, switchMap, take } from 'rxjs/operators'; -import { SearchCriteriaDto, CriteriaOperator, SearchCriteriaTypeEnum, CriteriaDataType } from 'vitamui-library'; +import { SearchCriteriaDto } from 'vitamui-library'; +import { CriteriaOperator, SearchCriteriaTypeEnum, CriteriaDataType } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { ArchiveService } from '../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts index b8ee0288343..35720dda206 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { ArchiveApiService } from './archive-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts b/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts index 3950fac64cb..4c512f3f18e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts @@ -37,7 +37,8 @@ import { CommonModule } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NgModule, inject } from '@angular/core'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/archive-search/src/main.ts b/ui/ui-frontend/projects/archive-search/src/main.ts index c0ee6e23c2c..db5c243c618 100644 --- a/ui/ui-frontend/projects/archive-search/src/main.ts +++ b/ui/ui-frontend/projects/archive-search/src/main.ts @@ -34,16 +34,49 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; +import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { WINDOW_LOCATION, BytesPipe } from 'vitamui-library'; +import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { DatePipe } from '@angular/common'; +import { CoreModule } from './app/core/core.module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { AppRoutingModule } from './app/app-routing.module'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.error(err)); +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom( + AuthenticationModule.forRoot(), + CoreModule, + BrowserAnimationsModule, + BrowserModule, + VitamUICommonModule.forRoot(), + AppRoutingModule, + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), + provideI18n(), + provideNativeDateAdapter(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { + provide: WINDOW_LOCATION, + useValue: window.location, + }, + DatePipe, + BytesPipe, + ], +}).catch((err) => console.error(err)); diff --git a/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts index 7f315896e3b..d0a18fda78f 100644 --- a/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts @@ -65,8 +65,7 @@ describe('AppComponent', () => { printConfiguration: () => {}, }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent], - declarations: [AppComponent], + imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ { provide: StartupService, useValue: startupServiceStub }, diff --git a/ui/ui-frontend/projects/collect/src/app/app.component.ts b/ui/ui-frontend/projects/collect/src/app/app.component.ts index dd5e909b9c0..7f5eaf9f955 100644 --- a/ui/ui-frontend/projects/collect/src/app/app.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/app.component.ts @@ -36,11 +36,13 @@ */ import { Component } from '@angular/core'; +import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [HeaderModule, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule], }) export class AppComponent {} diff --git a/ui/ui-frontend/projects/collect/src/app/app.module.ts b/ui/ui-frontend/projects/collect/src/app/app.module.ts deleted file mode 100644 index 4a48eecf31c..00000000000 --- a/ui/ui-frontend/projects/collect/src/app/app.module.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { DatePipe, registerLocaleData } from '@angular/common'; -import localeFr from '@angular/common/locales/fr'; -import { LOCALE_ID, NgModule } from '@angular/core'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { CoreModule } from './collect/core/core.module'; -import { provideNativeDateAdapter } from '@angular/material/core'; - -registerLocaleData(localeFr, 'fr'); - -@NgModule({ - declarations: [AppComponent], - imports: [ - AuthenticationModule.forRoot(), - CoreModule, - BrowserAnimationsModule, - BrowserModule, - VitamUICommonModule.forRoot(), - AppRoutingModule, - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ], - providers: [ - provideI18n(), - provideNativeDateAdapter(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { - provide: WINDOW_LOCATION, - useValue: window.location, - }, - DatePipe, - BytesPipe, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index c59d74fe550..8547d798790 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -41,7 +41,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, BytesPipe, Transaction, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, TransactionStatus } from 'vitamui-library'; import { AddUnitsComponent } from './add-units.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DecimalPipe } from '@angular/common'; @@ -103,8 +104,7 @@ describe('AddUnitsComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AddUnitsComponent], - imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot()], + imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), AddUnitsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts index 573a8bd2ec9..bf72333b061 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts @@ -36,7 +36,7 @@ */ import { Component, inject, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { finalize, from, Observable, of, switchMap } from 'rxjs'; import { ApplicationId, @@ -53,12 +53,30 @@ import { Unit, ZipFile, ZipFileStatus, + DialogHeaderComponent, + StepperComponent, + SelectComponent, + FileSelectorComponent, + NextStepComponent, + PreviousStepComponent, + CommonProgressBarComponent, + PipesModule, + FilingPlanComponent, } from 'vitamui-library'; import { ArchiveCollectService } from '../archive-collect.service'; import { SipImportTrackingService } from '../../shared/sip-import-tracking.service'; -import { FormControl, Validators } from '@angular/forms'; +import { FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { last, tap } from 'rxjs/operators'; import { HttpEventType } from '@angular/common/http'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { AsyncPipe, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatButtonModule } from '@angular/material/button'; +import { MatTreeModule } from '@angular/material/tree'; +import { MatCheckboxModule } from '@angular/material/checkbox'; export enum ImportType { DIRECTORIES_FILES = 'DIRECTORIES_FILES', @@ -70,7 +88,31 @@ export enum ImportType { selector: 'app-add-units', templateUrl: './add-units.component.html', styleUrls: ['./add-units.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + MatProgressSpinner, + SelectComponent, + FormsModule, + ReactiveFormsModule, + FileSelectorComponent, + MatDialogActions, + NextStepComponent, + PreviousStepComponent, + CommonProgressBarComponent, + AsyncPipe, + PipesModule, + TranslatePipe, + CommonModule, + FilingPlanComponent, + MatButtonModule, + MatCheckboxModule, + MatProgressSpinnerModule, + MatTreeModule, + ], }) export class AddUnitsComponent implements OnInit { data = inject<{ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts index 06088e8ab68..936a18087ec 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts @@ -64,20 +64,14 @@ describe('ArchivePreviewComponent', () => { let component: ArchivePreviewComponent; let fixture: ComponentFixture; - @Pipe({ - name: 'truncate', - standalone: false, - }) + @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; } } - @Pipe({ - name: 'unitI18n', - standalone: false, - }) + @Pipe({ name: 'unitI18n' }) class MockUnitI18nPipe implements PipeTransform { transform(value: number): number { return value; @@ -103,8 +97,10 @@ describe('ArchivePreviewComponent', () => { RouterTestingModule, MatIconModule, BrowserAnimationsModule, + ArchivePreviewComponent, + MockTruncatePipe, + MockUnitI18nPipe, ], - declarations: [ArchivePreviewComponent, MockTruncatePipe, MockUnitI18nPipe], providers: [ { provide: ArchiveCollectService, useValue: archiveServiceMock }, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts index 723287ce935..f2e3028ccec 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts @@ -47,17 +47,52 @@ import { inject, } from '@angular/core'; import { MatTab, MatTabChangeEvent, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; -import { TranslateService } from '@ngx-translate/core'; -import type { ArchiveUnit, Unit } from 'vitamui-library'; -import { unitToVitamuiIcon, addErrorStatusBadgeIfArchiveUnitHasErrors } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { ArchiveUnit, Unit } from 'vitamui-library'; +import { + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, + unitToVitamuiIcon, + addErrorStatusBadgeIfArchiveUnitHasErrors, + VitamuiMenuButtonComponent, + ClickOutsideDirective, + PipesModule, +} from 'vitamui-library'; import { ArchiveUnitDescriptionTabComponent } from './archive-unit-description-tab/archive-unit-description-tab.component'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; +import { MatMenuItem } from '@angular/material/menu'; +import { NgClass, CommonModule } from '@angular/common'; +import { ArchiveUnitInformationTabComponent } from './archive-unit-information-tab/archive-unit-information-tab.component'; +import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab/archive-unit-rules-details-tab.component'; +import { CollectObjectGroupDetailsTabComponent } from './collect-object-group-details-tab/collect-object-group-details-tab.component'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @Component({ selector: 'app-archive-preview', templateUrl: './archive-preview.component.html', styleUrls: ['./archive-preview.component.scss'], - standalone: false, + imports: [ + VitamuiMenuButtonComponent, + MatMenuItem, + MatTabGroup, + NgClass, + MatTab, + ArchiveUnitInformationTabComponent, + ArchiveUnitDescriptionTabComponent, + ClickOutsideDirective, + ArchiveUnitRulesDetailsTabComponent, + CollectObjectGroupDetailsTabComponent, + PipesModule, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class ArchivePreviewComponent implements OnChanges, AfterViewInit { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts index c220a6f86a6..1ebe73f3b41 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts @@ -35,19 +35,26 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnChanges, OnDestroy, Output, SimpleChanges, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { merge, Observable, Subscription } from 'rxjs'; import { filter, map, startWith, switchMap, tap } from 'rxjs/operators'; -import type { ArchiveUnit, EditObject, JsonPatch } from 'vitamui-library'; -import { ArchiveUnitEditorComponent, SnackBarService, SpinnerOverlayService } from 'vitamui-library'; +import { ArchiveUnit, EditObject, JsonPatch } from 'vitamui-library'; +import { + ArchiveUnitEditorComponent, + SnackBarService, + SpinnerOverlayService, + ArchiveUnitModule, + DialogHeaderComponent, +} from 'vitamui-library'; import { ArchiveUnitService } from './archive-unit.service'; +import { NgClass } from '@angular/common'; @Component({ selector: 'app-archive-unit-description-tab', templateUrl: './archive-unit-description-tab.component.html', styleUrls: ['./archive-unit-description-tab.component.scss'], - standalone: false, + imports: [ArchiveUnitModule, NgClass, DialogHeaderComponent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class ArchiveUnitDescriptionTabComponent implements OnChanges, OnDestroy { private dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts index 856b9c9e2cc..df5106cebd5 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts @@ -43,14 +43,20 @@ import { getErrorOnTechnicalObjectsGroup, getErrorOnObjectsGroup, ValidationError, + DataComponent, + InformationBlocComponent, + InformationDetailComponent, + PipesModule, } from 'vitamui-library'; import { ArchiveCollectService } from '../../archive-collect.service'; +import { AsyncPipe, UpperCasePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-archive-unit-information-tab', templateUrl: './archive-unit-information-tab.component.html', styleUrls: ['./archive-unit-information-tab.component.css'], - standalone: false, + imports: [DataComponent, InformationBlocComponent, InformationDetailComponent, AsyncPipe, UpperCasePipe, PipesModule, TranslatePipe], }) export class ArchiveUnitInformationTabComponent implements OnChanges { private archiveService = inject(ArchiveCollectService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index f5088ef5d57..18de55ec928 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -38,7 +38,8 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; -import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -48,9 +49,8 @@ describe('Collect ArchiveUnitRulesDetailsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ArchiveUnitRulesDetailsTabComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [InjectorModule, LoggerModule.forRoot()], + imports: [InjectorModule, LoggerModule.forRoot(), ArchiveUnitRulesDetailsTabComponent], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts index 07ca7ae6c33..1440baa6d71 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts @@ -37,9 +37,10 @@ import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import type { SearchCriteriaEltDto, Unit } from 'vitamui-library'; +import { SearchCriteriaEltDto, Unit } from 'vitamui-library'; import { CriteriaDataType, CriteriaOperator, SearchCriteriaTypeEnum } from 'vitamui-library'; import { ArchiveCollectService } from '../../archive-collect.service'; +import { ArchiveUnitRulesInformationsTabComponent } from './archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component'; const PAGE_SIZE = 10; const CURRENT_PAGE = 0; @@ -47,7 +48,7 @@ const CURRENT_PAGE = 0; @Component({ selector: 'app-archive-unit-rules-details-tab', templateUrl: './archive-unit-rules-details-tab.component.html', - standalone: false, + imports: [ArchiveUnitRulesInformationsTabComponent], }) export class ArchiveUnitRulesDetailsTabComponent implements OnChanges, OnDestroy { private collectService = inject(ArchiveCollectService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 35ab65e5121..a85f3010a34 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -75,10 +75,7 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { @Input() vitamuiCommonCollapse: any; } - @Pipe({ - name: 'dateTime', - standalone: false, - }) + @Pipe({ name: 'dateTime' }) class DateTimeStubPipe implements PipeTransform { transform(value: string = ''): string { return value; @@ -121,7 +118,6 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe], imports: [ CollapseStubDirective, CollapseTriggerForStubDirective, @@ -130,6 +126,8 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { LoggerModule.forRoot(), NoopAnimationsModule, VitamUICommonTestModule, + ArchiveUnitRulesInformationsTabComponent, + DateTimeStubPipe, ], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts index 62496104a2e..d0d2b5b7626 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts @@ -35,15 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import type { InheritedPropertyDto, RuleActionDetails, Unit, UnitRuleDto } from 'vitamui-library'; -import { Logger } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { InheritedPropertyDto, RuleActionDetails, Unit, UnitRuleDto, Logger } from 'vitamui-library'; +import { PipesModule } from 'vitamui-library'; +import { NgClass } from '@angular/common'; @Component({ selector: 'app-archive-unit-rules-informations-tab', templateUrl: './archive-unit-rules-informations-tab.component.html', styleUrls: ['./archive-unit-rules-informations-tab.component.css'], - standalone: false, + imports: [NgClass, PipesModule, TranslatePipe], }) export class ArchiveUnitRulesInformationsTabComponent implements OnChanges { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts index 953b422f0cb..f0018e65c18 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts @@ -121,8 +121,14 @@ describe('CollectObjectGroupDetailsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [CollectObjectGroupDetailsTabComponent], - imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, BrowserAnimationsModule], + imports: [ + BrowserAnimationsModule, + InjectorModule, + LoggerModule.forRoot(), + RouterTestingModule, + BrowserAnimationsModule, + CollectObjectGroupDetailsTabComponent, + ], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts index d39a35a00b1..81b326274b4 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts @@ -48,14 +48,30 @@ import { ValidationError, getErrorOnTechnicalObjectsGroup, getErrorOnObjectsGroup, + InformationBlocComponent, + InformationDetailComponent, + ArchiveUnitModule, + TooltipDirective, + PipesModule, } from 'vitamui-library'; import { ArchiveCollectService } from '../../archive-collect.service'; +import { NgClass, UpperCasePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-collect-object-group-details-tab', templateUrl: './collect-object-group-details-tab.component.html', styleUrls: ['./collect-object-group-details-tab.component.scss'], - standalone: false, + imports: [ + InformationBlocComponent, + InformationDetailComponent, + ArchiveUnitModule, + NgClass, + TooltipDirective, + UpperCasePipe, + PipesModule, + TranslatePipe, + ], }) export class CollectObjectGroupDetailsTabComponent implements OnChanges { private archiveCollectService = inject(ArchiveCollectService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index 221cfab913e..9f2ea9ba6c6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -152,12 +152,11 @@ describe('ArchiveSearchCollectComponent', () => { vi.spyOn(archiveCollectServiceStub, 'searchArchiveUnitsByCriteria'); - const declarations = withSimpleCriteria + const extraImports = withSimpleCriteria ? [ArchiveSearchCollectComponent, SimpleCriteriaSearchComponent] : [ArchiveSearchCollectComponent]; await TestBed.configureTestingModule({ - declarations: declarations, schemas: [NO_ERRORS_SCHEMA], imports: [ BrowserAnimationsModule, @@ -168,6 +167,7 @@ describe('ArchiveSearchCollectComponent', () => { MatMenuModule, MatSidenavModule, RouterTestingModule, + ...extraImports, ], providers: [ ArchiveSearchHelperService, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts index 14b487ebc3b..4690432952c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts @@ -36,9 +36,9 @@ */ import { HttpErrorResponse } from '@angular/common/http'; import { AfterViewInit, Component, inject, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { MatDialog, MatDialogConfig, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { BehaviorSubject, finalize, merge, Observable, of, Subject, Subscription, zip } from 'rxjs'; import { debounceTime, filter, map, mergeMap, share, switchMap, take, tap } from 'rxjs/operators'; import { isEmpty } from 'underscore'; @@ -98,6 +98,20 @@ import { UnitType, VALID_COMPUTED_INHERITED_RULES_FACET, WAITING_RECALCULATE, + VitamuiTitleBreadcrumbComponent, + DiscussionIconComponent, + TooltipDirective, + DiscussionPanelComponent, + VitamuiMenuButtonComponent, + ManagementRuleSearchComponent, + VitamuiSupHeaderComponent, + ArchiveUnitModule, + DialogHeaderComponent, + OrderByButtonComponent, + PipesModule, + InfiniteScrollDirective, + ResizeSidebarDirective, + ResizeVerticalDirective, } from 'vitamui-library'; import { ArchiveCollectService } from './archive-collect.service'; import { SearchCriteriaSaverComponent } from './archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component'; @@ -108,9 +122,34 @@ import { UpdateUnitsMetadataComponent } from './update-units-metadata/update-uni import { AddUnitsComponent } from './add-units/add-units.component'; import { TransactionsService } from '../transactions/transactions.service'; import { SipImportTrackingService } from '../shared/sip-import-tracking.service'; -import { MatCheckboxChange } from '@angular/material/checkbox'; +import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; import { TransactionValidationMode } from '../models/transaction-validation-mode.enum'; import { BatchStatus } from 'projects/vitamui-library/src/app/modules/models/collect/batch-status'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { FilingHoldingSchemeComponent } from './archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component'; +import { NgClass, NgTemplateOutlet, AsyncPipe, CommonModule } from '@angular/common'; +import { ArchivePreviewComponent } from './archive-preview/archive-preview.component'; +import { TitleAndDescriptionCriteriaSearchCollectComponent } from './archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component'; +import { MatMenuItem, MatMenuTrigger, MatMenu } from '@angular/material/menu'; +import { CriteriaSearchComponent } from './archive-search-criteria/components/criteria-search/criteria-search.component'; +import { SearchCriteriaListComponent } from './archive-search-criteria/components/search-criteria-list/search-criteria-list.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { ArchiveSearchRulesFacetsComponent } from './archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component'; +import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { SimpleCriteriaSearchComponent } from './archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component'; +import { + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + MatCellDef, + MatCell, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, +} from '@angular/material/table'; +import { CdkScrollable } from '@angular/cdk/scrolling'; const PAGE_SIZE = 10; const ELIMINATION_TECHNICAL_ID = 'ELIMINATION_TECHNICAL_ID'; @@ -120,13 +159,65 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-archive-search-collect', templateUrl: './archive-search-collect.component.html', styleUrls: ['./archive-search-collect.component.scss'], - standalone: false, providers: [ { provide: MANAGEMENT_RULE_SHARED_DATA_SERVICE, useExisting: ArchiveSharedDataService, }, ], + imports: [ + MatSidenavContainer, + MatSidenav, + FilingHoldingSchemeComponent, + NgClass, + ArchivePreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + DiscussionIconComponent, + TooltipDirective, + DiscussionPanelComponent, + TitleAndDescriptionCriteriaSearchCollectComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + CriteriaSearchComponent, + MatMenuTrigger, + MatMenu, + SearchCriteriaListComponent, + MatProgressSpinner, + ArchiveSearchRulesFacetsComponent, + MatTabGroup, + MatTab, + SimpleCriteriaSearchComponent, + MatTabLabel, + ManagementRuleSearchComponent, + VitamuiSupHeaderComponent, + ArchiveUnitModule, + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + NgTemplateOutlet, + MatCellDef, + MatCell, + MatCheckbox, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, + CdkScrollable, + MatDialogContent, + MatDialogActions, + MatDialogClose, + DialogHeaderComponent, + OrderByButtonComponent, + AsyncPipe, + PipesModule, + TranslatePipe, + CommonModule, + InfiniteScrollDirective, + ResizeSidebarDirective, + ResizeVerticalDirective, + ], }) export class ArchiveSearchCollectComponent extends SidenavPage implements OnInit, OnDestroy, AfterViewInit { private route: ActivatedRoute; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.module.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.module.ts index 30901800baf..11dacbb13d2 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.module.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.module.ts @@ -72,7 +72,7 @@ import { CriteriaSearchComponent } from './archive-search-criteria/components/cr import { ClassificationTreeComponent } from './archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component'; import { FilingHoldingSchemeComponent } from './archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component'; import { LeavesTreeComponent } from './archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component'; -import { ConfirmActionModule } from './archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.module'; + import { SearchCriteriaListComponent } from './archive-search-criteria/components/search-criteria-list/search-criteria-list.component'; import { SearchCriteriaSaverComponent } from './archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component'; @@ -101,7 +101,6 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ ArchiveSearchCollectRoutingModule, CommonModule, - ConfirmActionModule, MatDatepickerModule, MatDialogModule, MatFormFieldModule, @@ -131,8 +130,6 @@ import { TranslatePipe } from '@ngx-translate/core'; TranslatePipe, DiscussionPanelComponent, DiscussionIconComponent, - ], - declarations: [ ArchivePreviewComponent, ArchiveSearchCollectComponent, ArchiveSearchRulesFacetsComponent, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts index e3bb33235c7..897488686ce 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts @@ -37,12 +37,29 @@ import { Component, Input } from '@angular/core'; import { RuleFacets } from 'vitamui-library'; +import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { SearchStorageRulesFacetsComponent } from './search-storage-rules-facets/search-storage-rules-facets.component'; +import { SearchAppraisalRulesFacetsComponent } from './search-appraisal-rules-facets/search-appraisal-rules-facets.component'; +import { SearchAccessRulesFacetsComponent } from './search-access-rules-facets/search-access-rules-facets.component'; +import { SearchDisseminationRulesFacetsComponent } from './search-dissemination-rules-facets/search-dissemination-rules-facets.component'; +import { SearchReuseRulesFacetsComponent } from './search-reuse-rules-facets/search-reuse-rules-facets.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-archive-search-rules-facets', templateUrl: './archive-search-rules-facets.component.html', styleUrls: ['./archive-search-rules-facets.component.css'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + MatTabLabel, + SearchStorageRulesFacetsComponent, + SearchAppraisalRulesFacetsComponent, + SearchAccessRulesFacetsComponent, + SearchDisseminationRulesFacetsComponent, + SearchReuseRulesFacetsComponent, + TranslatePipe, + ], }) export class ArchiveSearchRulesFacetsComponent { @Input() diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts index ed2e9376fb9..0035960867a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; @@ -46,7 +47,7 @@ import { ArchiveFacetsService } from '../../../services/archive-facets.service'; selector: 'app-search-access-rules-facets', templateUrl: './search-access-rules-facets.component.html', styleUrls: ['./search-access-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchAccessRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts index b7e6df556aa..f40fe1409d1 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; @@ -46,7 +47,7 @@ import { ArchiveFacetsService } from '../../../services/archive-facets.service'; selector: 'app-search-appraisal-rules-facets', templateUrl: './search-appraisal-rules-facets.component.html', styleUrls: ['./search-appraisal-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchAppraisalRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts index cc9a26f2315..bf2c2e70c2e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; @@ -46,7 +47,7 @@ import { ArchiveFacetsService } from '../../../services/archive-facets.service'; selector: 'app-search-dissemination-rules-facets', templateUrl: './search-dissemination-rules-facets.component.html', styleUrls: ['./search-dissemination-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchDisseminationRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts index f590c6057da..2bc65a1e462 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; @@ -46,7 +47,7 @@ import { ArchiveFacetsService } from '../../../services/archive-facets.service'; selector: 'app-search-reuse-rules-facets', templateUrl: './search-reuse-rules-facets.component.html', styleUrls: ['./search-reuse-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchReuseRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts index 08d5e74c5fa..47fe74a3f0b 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts @@ -37,8 +37,9 @@ import { DatePipe } from '@angular/common'; import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; +import { Colors, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; @@ -46,7 +47,7 @@ import { ArchiveFacetsService } from '../../../services/archive-facets.service'; selector: 'app-search-storage-rules-facets', templateUrl: './search-storage-rules-facets.component.html', styleUrls: ['./search-storage-rules-facets.component.scss'], - standalone: false, + imports: [VitamuiFacetComponent, TranslatePipe], }) export class SearchStorageRulesFacetsComponent implements OnChanges { private facetsService = inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts index 32c39955040..69245944ddd 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts @@ -36,22 +36,25 @@ */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import type { CriteriaSearchCriteria, CriteriaValue, SearchCriteriaValue } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { CriteriaSearchCriteria, CriteriaValue, SearchCriteriaValue } from 'vitamui-library'; import { ORIGIN_WAITING_RECALCULATE, QueryParamsService, SearchCriteriaTypeEnum, TranslateWithOptionalTypeSuffixPipe, WAITING_RECALCULATE, + TooltipDirective, + PipesModule, } from 'vitamui-library'; +import { NgClass, DatePipe } from '@angular/common'; @Component({ selector: 'app-criteria-search', templateUrl: './criteria-search.component.html', styleUrls: ['./criteria-search.component.scss'], - standalone: false, providers: [TranslateWithOptionalTypeSuffixPipe], + imports: [TooltipDirective, NgClass, DatePipe, PipesModule, TranslatePipe], }) export class CriteriaSearchComponent { private queryParamsService = inject(QueryParamsService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts index 02f16c39df3..b6e00ae9fae 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts @@ -36,15 +36,36 @@ */ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; -import { FilingHoldingSchemeNode, nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon } from 'vitamui-library'; +import { + MatTreeNestedDataSource, + MatTree, + MatTreeNodeDef, + MatTreeNode, + MatNestedTreeNode, + MatTreeNodeOutlet, +} from '@angular/material/tree'; +import { FilingHoldingSchemeNode } from 'vitamui-library'; +import { nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon, VitamuiTreeNodeComponent } from 'vitamui-library'; import { Pair } from '../../../models/utils'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { DecimalPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-classification-tree', templateUrl: './classification-tree.component.html', styleUrls: ['./classification-tree.component.scss'], - standalone: false, + imports: [ + MatProgressSpinner, + MatTree, + MatTreeNodeDef, + MatTreeNode, + VitamuiTreeNodeComponent, + MatNestedTreeNode, + MatTreeNodeOutlet, + DecimalPipe, + TranslatePipe, + ], }) export class ClassificationTreeComponent { @Input() loadingHolding: boolean; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts index 32816c1bcde..284f4ddeee9 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -44,7 +44,8 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/collect/src/environments/environment.prod'; import { of } from 'rxjs'; -import { FilingHoldingSchemeNode, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; +import { FilingHoldingSchemeNode, StartupService } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { ArchiveCollectService } from '../../../archive-collect.service'; import { FilingHoldingSchemeComponent } from './filing-holding-scheme.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -126,8 +127,8 @@ describe('FilingHoldingSchemeComponent', () => { InjectorModule, LoggerModule.forRoot(), RouterTestingModule, + FilingHoldingSchemeComponent, ], - declarations: [FilingHoldingSchemeComponent], providers: [ { provide: ArchiveCollectService, useValue: archiveCollectServiceMock }, { provide: StartupService, useValue: StartupServiceMock }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts index 9461e5c6f2c..813bb1ba4e9 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts @@ -51,6 +51,8 @@ import { SearchCriteriaTypeEnum, Unit, UnitType, + ResizeSidebarDirective, + ResizeVerticalDirective, } from 'vitamui-library'; import { isEmpty } from 'underscore'; import { ArchiveCollectService } from '../../../archive-collect.service'; @@ -58,12 +60,15 @@ import { NodeData } from '../../models/nodedata.interface'; import { Pair } from '../../models/utils'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { tap } from 'rxjs/operators'; +import { ClassificationTreeComponent } from './classification-tree/classification-tree.component'; +import { LeavesTreeComponent } from './leaves-tree/leaves-tree.component'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-filing-holding-scheme', templateUrl: './filing-holding-scheme.component.html', styleUrls: ['./filing-holding-scheme.component.scss'], - standalone: false, + imports: [ClassificationTreeComponent, LeavesTreeComponent, CommonModule, ResizeSidebarDirective, ResizeVerticalDirective], }) export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts index 026dde33a7f..ab2c21da5e7 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts @@ -106,8 +106,7 @@ describe('LeavesTreeComponent', () => { (archiveSharedDataServiceStub as any).selectedUnit$ = of(); await TestBed.configureTestingModule({ - imports: [BrowserAnimationsModule], - declarations: [LeavesTreeComponent], + imports: [BrowserAnimationsModule, LeavesTreeComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ { provide: ArchiveCollectService, useValue: archiveServiceStub }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts index aa1cb61a358..b9ff22a053e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts @@ -36,7 +36,14 @@ */ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; +import { + MatTreeNestedDataSource, + MatTree, + MatTreeNodeDef, + MatNestedTreeNode, + MatTreeNodeOutlet, + MatTreeNode, +} from '@angular/material/tree'; import { Subscription } from 'rxjs'; import { ConfigurationsApiService, @@ -49,17 +56,34 @@ import { SearchCriteriaDto, Unit, UnitType, + TooltipDirective, + VitamuiTreeNodeComponent, } from 'vitamui-library'; import { ArchiveCollectService } from '../../../../archive-collect.service'; import { Pair } from '../../../models/utils'; import { ArchiveSharedDataService } from '../../../../../core/archive-shared-data.service'; import { first } from 'rxjs/operators'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { NgClass, DecimalPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-leaves-tree', templateUrl: './leaves-tree.component.html', styleUrls: ['./leaves-tree.component.scss'], - standalone: false, + imports: [ + MatProgressSpinner, + TooltipDirective, + MatTree, + MatTreeNodeDef, + MatNestedTreeNode, + NgClass, + VitamuiTreeNodeComponent, + MatTreeNodeOutlet, + MatTreeNode, + DecimalPipe, + TranslatePipe, + ], }) export class LeavesTreeComponent implements OnInit, OnChanges, OnDestroy { private archiveSharedDataService = inject(ArchiveSharedDataService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts index 6665b30bcd7..26c9d332b1d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts @@ -72,12 +72,24 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; +import { DatePipe, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ClosePopupDialogComponent, CommonConfirmDialogComponent, DialogHeaderComponent } from 'vitamui-library'; +import { MatDialogModule } from '@angular/material/dialog'; // FIXME: should be factorized in vitamui-library ConfirmActionComponent @Component({ selector: 'vitamui-confirm-action', templateUrl: './confirm-action.component.html', - standalone: false, + imports: [ + DatePipe, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + MatDialogModule, + ], }) export class ConfirmActionComponent { // delete or changeTab diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.module.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.module.ts deleted file mode 100644 index e09297438bb..00000000000 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { ConfirmDialogModule, VitamUICommonModule } from 'vitamui-library'; -import { ConfirmActionComponent } from './confirm-action.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ConfirmActionComponent], - imports: [CommonModule, MatDialogModule, ConfirmDialogModule, VitamUICommonModule, TranslatePipe], - exports: [ConfirmActionComponent], -}) -export class ConfirmActionModule {} diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts index b6dd6c9f681..23f83187b24 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts @@ -59,10 +59,7 @@ import { SearchCriteriaSaverService } from '../../services/search-criteria-saver import { SearchCriteriaListComponent } from './search-criteria-list.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -99,8 +96,14 @@ describe('SearchCriteriaListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule], - declarations: [SearchCriteriaListComponent, MockTruncatePipe], + imports: [ + BrowserAnimationsModule, + InjectorModule, + LoggerModule.forRoot(), + RouterTestingModule, + SearchCriteriaListComponent, + MockTruncatePipe, + ], providers: [ ArchiveSharedDataService, DatePipe, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts index eae64af2a6a..d803bc4de6e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts @@ -37,19 +37,22 @@ import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { Direction, SearchCriteriaHistory, SnackBarService } from 'vitamui-library'; +import { SearchCriteriaHistory, SnackBarService } from 'vitamui-library'; +import { Direction, TooltipDirective, PipesModule } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { SearchCriteriaSaverService } from '../../services/search-criteria-saver.service'; import { ConfirmActionComponent } from './confirm-action/confirm-action.component'; +import { MatMenuItem } from '@angular/material/menu'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ selector: 'app-search-criteria-list', templateUrl: './search-criteria-list.component.html', styleUrls: ['./search-criteria-list.component.css'], - standalone: false, + imports: [MatMenuItem, TooltipDirective, MatProgressSpinner, PipesModule, TranslatePipe], }) export class SearchCriteriaListComponent implements OnInit { private searchCriteriaSaverService = inject(SearchCriteriaSaverService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts index 4be7613db88..bdfd920545a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -60,10 +60,7 @@ import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.s import { SearchCriteriaSaverService } from '../../services/search-criteria-saver.service'; import { SearchCriteriaSaverComponent } from './search-criteria-saver.component'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -102,8 +99,14 @@ describe('SearchCriteriaSaverComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule], - declarations: [SearchCriteriaSaverComponent, MockTruncatePipe], + imports: [ + BrowserAnimationsModule, + InjectorModule, + LoggerModule.forRoot(), + RouterTestingModule, + SearchCriteriaSaverComponent, + MockTruncatePipe, + ], providers: [ FormBuilder, ArchiveSharedDataService, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts index 41326d87974..e5ba66fe26d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts @@ -37,7 +37,7 @@ import { DatePipe } from '@angular/common'; import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslatePipe } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; @@ -50,6 +50,11 @@ import { SnackBarService, ORIGIN_WAITING_RECALCULATE, WAITING_RECALCULATE, + ChipComponent, + TooltipDirective, + InputComponent, + ElementsComponent, + PipesModule, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { SearchCriteriaSaverService } from '../../services/search-criteria-saver.service'; @@ -59,7 +64,16 @@ import { SearchCriteriaSaverService } from '../../services/search-criteria-saver templateUrl: './search-criteria-saver.component.html', styleUrls: ['./search-criteria-saver.component.css'], providers: [TranslatePipe], - standalone: false, + imports: [ + ChipComponent, + TooltipDirective, + FormsModule, + ReactiveFormsModule, + InputComponent, + ElementsComponent, + PipesModule, + TranslatePipe, + ], }) export class SearchCriteriaSaverComponent implements OnInit, OnDestroy { data = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts index b3db004f767..da67f0cea0c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts @@ -36,9 +36,9 @@ */ import { Component, OnInit, inject } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { AbstractControl, FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { debounceTime, filter, map, share } from 'rxjs/operators'; import { @@ -59,13 +59,38 @@ import { SearchCriteriaTypeEnum, SearchProvider, VitamuiSelectOptions, + TooltipDirective, + SelectComponent, + DatepickerComponent, + SelectWithTreeComponent, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../../services/management-rules-shared-data.service'; import { ActivatedRoute, Params } from '@angular/router'; import { ArchiveSearchHelperService } from '../../services/archive-search-helper.service'; -import { MatCheckboxChange } from '@angular/material/checkbox'; +import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; +import { NgTemplateOutlet, AsyncPipe, CommonModule } from '@angular/common'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; const FINAL_ACTION_TYPE = 'FINAL_ACTION_TYPE'; const ARCHIVE_UNIT_WITH_OBJECTS = 'ARCHIVE_UNIT_WITH_OBJECTS'; @@ -89,7 +114,40 @@ const keysList = [ALL_ARCHIVE_UNIT_TYPES, ERRORS]; selector: 'app-simple-criteria-search', templateUrl: './simple-criteria-search.component.html', styleUrls: ['./simple-criteria-search.component.css'], - standalone: false, + imports: [ + FormsModule, + ReactiveFormsModule, + TooltipDirective, + SelectComponent, + DatepickerComponent, + NgTemplateOutlet, + MatCheckbox, + SelectWithTreeComponent, + AsyncPipe, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class SimpleCriteriaSearchComponent implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index 8b122fe91b4..0a95fdbecf6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -42,7 +42,8 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TitleAndDescriptionCriteriaSearchCollectComponent } from './title-and-description-criteria-search-collect.component'; @@ -69,8 +70,13 @@ describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [TitleAndDescriptionCriteriaSearchCollectComponent], - imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule], + imports: [ + BrowserAnimationsModule, + InjectorModule, + LoggerModule.forRoot(), + RouterTestingModule, + TitleAndDescriptionCriteriaSearchCollectComponent, + ], schemas: [NO_ERRORS_SCHEMA], providers: [ FormBuilder, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts index cf50c4483b6..9fb5945f8b1 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts @@ -35,20 +35,74 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { merge } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; -import { CriteriaDataType, CriteriaOperator, CriteriaValue, diff, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { CriteriaValue } from 'vitamui-library'; +import { + CriteriaDataType, + CriteriaOperator, + diff, + SearchCriteriaTypeEnum, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, +} from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const TITLE_OR_DESCRIPTION = 'TITLE_OR_DESCRIPTION'; @Component({ selector: 'app-title-and-description-criteria-search-collect', templateUrl: './title-and-description-criteria-search-collect.component.html', - standalone: false, + imports: [ + FormsModule, + ReactiveFormsModule, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class TitleAndDescriptionCriteriaSearchCollectComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index ee1c83c9a84..92335171228 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -40,7 +40,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, BytesPipe, Transaction, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, TransactionStatus } from 'vitamui-library'; import { UpdateUnitsMetadataComponent } from './update-units-metadata.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DecimalPipe } from '@angular/common'; @@ -83,8 +84,7 @@ describe('UpdateUaMetadataComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [UpdateUnitsMetadataComponent], - imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot()], + imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), UpdateUnitsMetadataComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts index a49e788e57f..39457e465e3 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts @@ -36,16 +36,40 @@ */ import { Component, OnDestroy, TemplateRef, ViewChild, inject } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subscription, throwError } from 'rxjs'; -import { Logger, SnackBarService, Transaction, VitamErrorDetails } from 'vitamui-library'; +import { + Logger, + SnackBarService, + Transaction, + VitamErrorDetails, + DialogHeaderComponent, + StepperComponent, + TooltipDirective, + FileSelectorComponent, +} from 'vitamui-library'; import { ArchiveCollectService } from '../archive-collect.service'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-update-units-metadata', templateUrl: './update-units-metadata.component.html', styleUrls: ['./update-units-metadata.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + TooltipDirective, + MatProgressSpinner, + FileSelectorComponent, + MatDialogActions, + TranslatePipe, + ], }) export class UpdateUnitsMetadataComponent implements OnDestroy { data = inject<{ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts index b7367808796..3347089104a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts @@ -37,7 +37,8 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../../environments/environment'; import { ProjectsApiService } from './project-api.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts index 89e174284a3..bc2629527bf 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts @@ -38,7 +38,8 @@ import { CommonModule } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NgModule, inject } from '@angular/core'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts index 0812209296e..211c3b7749b 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts @@ -64,10 +64,7 @@ import { TransactionsService } from '../transactions.service'; import { CreateProjectComponent } from './create-project.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -@Pipe({ - name: 'fileSize', - standalone: false, -}) +@Pipe({ name: 'fileSize' }) export class MockFileSizePipe implements PipeTransform { transform(value: string = ''): any { return value; @@ -158,10 +155,16 @@ describe('CreateProjectComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [CreateProjectComponent, MockFileSizePipe], teardown: { destroyAfterEach: false }, schemas: [NO_ERRORS_SCHEMA], - imports: [BrowserAnimationsModule, InjectorModule, MatButtonToggleModule, LoggerModule.forRoot()], + imports: [ + BrowserAnimationsModule, + InjectorModule, + MatButtonToggleModule, + LoggerModule.forRoot(), + CreateProjectComponent, + MockFileSizePipe, + ], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts index f6c677cc174..496b7cb6c4f 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { AfterViewChecked, ChangeDetectorRef, Component, OnInit, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { finalize, forkJoin, Observable, of, throwError } from 'rxjs'; import { last, map, switchMap, tap } from 'rxjs/operators'; import { ProjectsService } from '../projects.service'; @@ -72,7 +72,31 @@ import { Workflow, ZipFile, ZipFileStatus, + DialogHeaderComponent, + StepperComponent, + NextStepComponent, + SlideToggleComponent, + SelectComponent, + PreviousStepComponent, + InputComponent, + FileSelectorComponent, + AccordionComponent, + TooltipDirective, + SelectWithTreeComponent, + DatepickerComponent, + CommonProgressBarComponent, + DialogContentWithStateComponent, + PipesModule, + FilingPlanComponent, } from 'vitamui-library'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { AsyncPipe, CommonModule } from '@angular/common'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatButtonModule } from '@angular/material/button'; +import { MatTreeModule } from '@angular/material/tree'; +import { MatCheckboxModule } from '@angular/material/checkbox'; export enum ImportType { DIRECTORIES_FILES = 'DIRECTORIES_FILES', @@ -91,7 +115,39 @@ export const LOCAL_ARCHIVING_SYSTEM_ID = 'local'; selector: 'app-create-project', templateUrl: './create-project.component.html', styleUrls: ['./create-project.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + FormsModule, + ReactiveFormsModule, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + MatButtonToggleGroup, + MatButtonToggle, + MatDialogActions, + NextStepComponent, + SlideToggleComponent, + SelectComponent, + PreviousStepComponent, + InputComponent, + FileSelectorComponent, + AccordionComponent, + TooltipDirective, + SelectWithTreeComponent, + DatepickerComponent, + CommonProgressBarComponent, + DialogContentWithStateComponent, + AsyncPipe, + PipesModule, + TranslatePipe, + CommonModule, + FilingPlanComponent, + MatButtonModule, + MatCheckboxModule, + MatProgressSpinnerModule, + MatTreeModule, + ], }) export class CreateProjectComponent implements OnInit, AfterViewChecked { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts index 388cc183a27..60026c40d78 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts @@ -37,14 +37,39 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { Router } from '@angular/router'; import { Subject, Subscription } from 'rxjs'; -import { DEFAULT_PAGE_SIZE, Direction, getProjectIcon, InfiniteScrollTable, PageRequest, Project } from 'vitamui-library'; +import { + DEFAULT_PAGE_SIZE, + Direction, + getProjectIcon, + InfiniteScrollTable, + PageRequest, + Project, + OrderByButtonComponent, + VitamuiMenuButtonComponent, + PipesModule, + InfiniteScrollDirective, +} from 'vitamui-library'; import { ProjectsService } from '../projects.service'; +import { MatMenuItem } from '@angular/material/menu'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { AsyncPipe, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-project-list', templateUrl: './project-list.component.html', styleUrls: ['./project-list.component.css'], - standalone: false, + imports: [ + OrderByButtonComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + MatProgressSpinner, + AsyncPipe, + PipesModule, + TranslatePipe, + CommonModule, + InfiniteScrollDirective, + ], }) export class ProjectListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { projectsService: ProjectsService; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project.module.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project.module.ts index 25c06931853..279baccc26d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project.module.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project.module.ts @@ -76,7 +76,9 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, VitamUILibraryModule, TranslatePipe, + ProjectsComponent, + ProjectListComponent, + CreateProjectComponent, ], - declarations: [ProjectsComponent, ProjectListComponent, CreateProjectComponent], }) export class ProjectModule {} diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts index cdc970f438f..122bb46613c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts @@ -38,16 +38,37 @@ import { Component, OnDestroy, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; -import { DEFAULT_PAGE_SIZE, Direction, PageRequest, SidenavPage } from 'vitamui-library'; +import { + DEFAULT_PAGE_SIZE, + Direction, + PageRequest, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { CreateProjectComponent } from './create-project/create-project.component'; import { ProjectListComponent } from './project-list/project-list.component'; import { ProjectsService } from './projects.service'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { NgClass } from '@angular/common'; +import { ProjectPreviewComponent } from './project-preview/project-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-projects', templateUrl: './projects.component.html', styleUrls: ['./projects.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + NgClass, + ProjectPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ProjectListComponent, + TranslatePipe, + ], }) export class ProjectsComponent extends SidenavPage implements OnDestroy { private dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index 20b62ec1e29..2269452c42a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -46,7 +46,8 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, StartupService, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, StartupService, Transaction, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, TransactionStatus } from 'vitamui-library'; import { environment } from '../../../../../../archive-search/src/environments/environment'; import { TransactionResolver } from '../transaction-resolver.service'; import { TransactionsService } from '../transactions.service'; @@ -120,9 +121,15 @@ describe('TransactionListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [TransactionListComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [InjectorModule, MatSidenavModule, BrowserAnimationsModule, LoggerModule.forRoot(), RouterTestingModule], + imports: [ + InjectorModule, + MatSidenavModule, + BrowserAnimationsModule, + LoggerModule.forRoot(), + RouterTestingModule, + TransactionListComponent, + ], providers: [ DatePipe, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts index 3b8e05b15f2..538df0bf4a0 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts @@ -46,6 +46,10 @@ import { StartupService, Transaction, TransactionStatus, + VitamuiSupHeaderComponent, + OrderByButtonComponent, + VitamuiMenuButtonComponent, + InfiniteScrollDirective, } from 'vitamui-library'; import { TransactionsService } from '../transactions.service'; import { ArchiveCollectService } from '../../archive-search-collect/archive-collect.service'; @@ -54,12 +58,23 @@ import { SipImportTrackingService } from '../../shared/sip-import-tracking.servi import { MatDialog } from '@angular/material/dialog'; import { TransactionValidationMode } from '../../models/transaction-validation-mode.enum'; import { BatchStatus } from 'projects/vitamui-library/src/app/modules/models/collect/batch-status'; +import { MatMenuItem } from '@angular/material/menu'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-transaction-list', templateUrl: './transaction-list.component.html', styleUrls: ['./transaction-list.component.css'], - standalone: false, + imports: [ + VitamuiSupHeaderComponent, + OrderByButtonComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + TranslatePipe, + CommonModule, + InfiniteScrollDirective, + ], }) export class TransactionListComponent extends InfiniteScrollTable implements OnInit { private transactionService: TransactionsService; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction.module.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction.module.ts index c38ad3c1b0b..d91aa6152b8 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction.module.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction.module.ts @@ -57,8 +57,9 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, MatProgressSpinnerModule, TranslatePipe, + TransactionsComponent, + TransactionListComponent, ], providers: [TransactionResolver], - declarations: [TransactionsComponent, TransactionListComponent], }) export class TransactionModule {} diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts index 4e9d2cf0a42..08edd9fbdf3 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts @@ -38,14 +38,26 @@ import { Component, OnInit, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { ApplicationId, BreadCrumbData, GlobalEventService, Project, SidenavPage, Transaction } from 'vitamui-library'; +import { + ApplicationId, + BreadCrumbData, + GlobalEventService, + Project, + SidenavPage, + Transaction, + VitamuiTitleBreadcrumbComponent, +} from 'vitamui-library'; import { TransactionsService } from './transactions.service'; +import { MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; +import { TransactionListComponent } from './transaction-list/transaction-list.component'; +import { AsyncPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-projects', templateUrl: './transactions.component.html', styleUrls: ['./transactions.component.scss'], - standalone: false, + imports: [MatSidenavContainer, MatSidenavContent, VitamuiTitleBreadcrumbComponent, TransactionListComponent, AsyncPipe, TranslatePipe], }) export class TransactionsComponent extends SidenavPage implements OnInit { private transactionsService = inject(TransactionsService); diff --git a/ui/ui-frontend/projects/collect/src/main.ts b/ui/ui-frontend/projects/collect/src/main.ts index c0ee6e23c2c..6d43392c304 100644 --- a/ui/ui-frontend/projects/collect/src/main.ts +++ b/ui/ui-frontend/projects/collect/src/main.ts @@ -34,16 +34,49 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; +import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { WINDOW_LOCATION, BytesPipe } from 'vitamui-library'; +import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { DatePipe } from '@angular/common'; +import { CoreModule } from './app/collect/core/core.module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { AppRoutingModule } from './app/app-routing.module'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.error(err)); +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom( + AuthenticationModule.forRoot(), + CoreModule, + BrowserAnimationsModule, + BrowserModule, + VitamUICommonModule.forRoot(), + AppRoutingModule, + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), + provideI18n(), + provideNativeDateAdapter(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { + provide: WINDOW_LOCATION, + useValue: window.location, + }, + DatePipe, + BytesPipe, + ], +}).catch((err) => console.error(err)); diff --git a/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts b/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts index 4ffe48409b6..0b1d57e2b76 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts @@ -41,8 +41,7 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AppComponent], - imports: [], + imports: [AppComponent], }) .overrideTemplate(AppComponent, '
') .compileComponents(); diff --git a/ui/ui-frontend/projects/design-system/src/app/app.component.ts b/ui/ui-frontend/projects/design-system/src/app/app.component.ts index 1e500f94398..4c253da62ed 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.component.ts @@ -35,17 +35,46 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { Route, Router, Routes } from '@angular/router'; +import { Route, Router, Routes, RouterLinkActive, RouterLink, RouterOutlet } from '@angular/router'; import { VitamuiSelectOptions } from 'vitamui-library'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +import { SelectComponent, SelectLanguageComponent } from 'vitamui-library'; +import { FormBuilder, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { RouteData } from './app-routing.module'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatList } from '@angular/material/list'; +import { MatAccordion, MatExpansionPanel, MatExpansionPanelHeader } from '@angular/material/expansion'; +import { NgTemplateOutlet, CommonModule } from '@angular/common'; +import { MatSelectModule } from '@angular/material/select'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatButtonModule } from '@angular/material/button'; @Component({ selector: 'design-system-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + ReactiveFormsModule, + SelectComponent, + MatList, + MatAccordion, + MatExpansionPanel, + MatExpansionPanelHeader, + RouterLinkActive, + RouterLink, + NgTemplateOutlet, + MatSidenavContent, + RouterOutlet, + TranslatePipe, + CommonModule, + FormsModule, + MatButtonModule, + MatMenuModule, + MatSelectModule, + SelectLanguageComponent, + ], }) export class AppComponent { private router = inject(Router); diff --git a/ui/ui-frontend/projects/design-system/src/app/app.module.ts b/ui/ui-frontend/projects/design-system/src/app/app.module.ts index 7f949400e3d..5cea59d0c05 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.module.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.module.ts @@ -45,8 +45,7 @@ import { of } from 'rxjs'; import { environment } from '../environments/environment'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; -import { TranslationModule } from './components/translation/translation.module'; -import { DesignSystemModule } from './components/design-system/design-system.module'; + import { ServiceWorkerModule } from '@angular/service-worker'; import { MatExpansionModule } from '@angular/material/expansion'; import { ReactiveFormsModule } from '@angular/forms'; @@ -68,7 +67,8 @@ import { TranslatePipe } from '@ngx-translate/core'; registerLocaleData(localeFr, 'fr'); -@NgModule({ +@NgModule(/* TODO(standalone-migration): clean up removed NgModule class manually. +{ declarations: [AppComponent], imports: [ AppRoutingModule, @@ -101,7 +101,7 @@ registerLocaleData(localeFr, 'fr'); { provide: BaseUserInfoApiService, useValue: { patchMyUserInfo: () => of(undefined) } }, // Make changing language work ], bootstrap: [AppComponent], -}) +} */) export class AppModule { constructor() { const authService = inject(AuthService); diff --git a/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts index cbf04592b24..cbf5c29a09c 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts @@ -35,7 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; -import { InformationDetailComponent, ValidationError } from 'vitamui-library'; +import { ValidationError } from 'vitamui-library'; +import { InformationDetailComponent } from 'vitamui-library'; @Component({ imports: [InformationDetailComponent], diff --git a/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts index a79b13d4db1..01f3a6e40f1 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts @@ -37,14 +37,14 @@ import { AfterViewInit, Component, QueryList, ViewChildren } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { CommonTooltipModule, InputComponent, TooltipDirective } from 'vitamui-library'; +import { TooltipDirective, InputComponent } from 'vitamui-library'; import { MatTooltipModule } from '@angular/material/tooltip'; @Component({ selector: 'design-system-tooltip', templateUrl: './tooltip.component.html', styleUrls: ['./tooltip.component.scss'], - imports: [ReactiveFormsModule, CommonTooltipModule, MatTooltipModule, FormsModule, InputComponent], + imports: [ReactiveFormsModule, TooltipDirective, MatTooltipModule, FormsModule, InputComponent], }) export class TooltipComponent implements AfterViewInit { outlineValues = [true, false] as const; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.component.ts index 944e35fc48f..9be0b1f0bcf 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.component.ts @@ -41,6 +41,5 @@ import { Component } from '@angular/core'; selector: 'design-system', templateUrl: './design-system.component.html', styleUrls: ['./design-system.component.scss'], - standalone: false, }) export class DesignSystemComponent {} diff --git a/ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.module.ts b/ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.module.ts deleted file mode 100644 index 2fba443a50a..00000000000 --- a/ui/ui-frontend/projects/design-system/src/app/components/design-system/design-system.module.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { DesignSystemComponent } from './design-system.component'; - -@NgModule({ - declarations: [DesignSystemComponent], - imports: [CommonModule], -}) -export class DesignSystemModule {} diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts index 7b8c9a562ab..368e05a3a17 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts @@ -35,9 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; -import { ApplicationId } from 'vitamui-library'; - -import { VitamUICommonModule } from 'vitamui-library'; +import { ApplicationId, VitamUICommonModule } from 'vitamui-library'; @Component({ templateUrl: './breadcrumbs.component.html', diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts index faeeda53dee..74cbe7e9569 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts @@ -35,7 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { DatepickerComponent, PickerType, SelectComponent } from 'vitamui-library'; +import { PickerType } from 'vitamui-library'; +import { DatepickerComponent, SelectComponent } from 'vitamui-library'; import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { DatePipe, TitleCasePipe } from '@angular/common'; import { MatFormFieldModule } from '@angular/material/form-field'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts index acbd61d84f5..700243a3029 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts @@ -38,7 +38,8 @@ import { Component, inject, OnInit } from '@angular/core'; import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatSelectModule } from '@angular/material/select'; -import { CountryOption, CountryService, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { CountryOption, CountryService, Option } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { EditableFieldModule } from '../../../../../../../identity/src/app/shared/editable-field/editable-field.module'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts index fdefbda11f7..100a50dcee2 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts @@ -36,7 +36,8 @@ */ import { AfterViewInit, Component, ElementRef, OnInit, QueryList, ViewChildren, inject } from '@angular/core'; import { AbstractControl, FormControl, FormsModule, ReactiveFormsModule, ValidationErrors, Validators } from '@angular/forms'; -import { ItemNode, MockSchemaService, SchemaElement, SchemaService, SelectWithTreeComponent, VitamUICommonModule } from 'vitamui-library'; +import { ItemNode, MockSchemaService, SchemaElement, SchemaService } from 'vitamui-library'; +import { SelectWithTreeComponent, VitamUICommonModule } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { AsyncPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts index d61f0b47189..398de674791 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts @@ -38,7 +38,7 @@ import { Component, inject } from '@angular/core'; import { OverlayModule } from '@angular/cdk/overlay'; import { AuthService, - CommonTooltipModule, + TooltipDirective, DiscussionComponent, DiscussionDto, DiscussionIconComponent, @@ -54,7 +54,7 @@ import { DiscussionServiceMock } from 'vitamui-library/testing'; @Component({ imports: [ AsyncPipe, - CommonTooltipModule, + TooltipDirective, DiscussionComponent, DiscussionIconComponent, DiscussionListComponent, diff --git a/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts index 50f6301ef20..d040ff5ddaa 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts @@ -35,7 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; -import { VitamUICommonModule, VitamUILibraryModule, SnackBarService } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { FormArray, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; const INFINITE_DURATION = 0; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts index 60bf56a03d0..164eee17fad 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts @@ -36,13 +36,13 @@ */ import { Component } from '@angular/core'; import { TranslatePipe } from '@ngx-translate/core'; -import { EllipsisDirectiveModule, CommonTooltipModule } from 'vitamui-library'; -import { NgClass, NgTemplateOutlet } from '@angular/common'; +import { TooltipDirective, EllipsisDirective } from 'vitamui-library'; +import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common'; @Component({ templateUrl: './typography.component.html', styleUrls: ['./typography.component.scss'], - imports: [TranslatePipe, EllipsisDirectiveModule, NgClass, CommonTooltipModule, NgTemplateOutlet], + imports: [TranslatePipe, NgClass, TooltipDirective, NgTemplateOutlet, CommonModule, EllipsisDirective], }) export class TypographyComponent { textFlavors = ['', 'bold']; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts index 4e2ebe48c75..34858ec0f66 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts @@ -35,8 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; -import { FormControl, Validators } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { InputComponent } from 'vitamui-library'; +import { I18nPluralPipe } from '@angular/common'; const TRANSLATE_GET_PATH = 'TRANSLATION.TRANSLATE_GET'; @@ -44,7 +46,7 @@ const TRANSLATE_GET_PATH = 'TRANSLATION.TRANSLATE_GET'; selector: 'design-system-translation', templateUrl: './translation.component.html', styleUrls: ['./translation.component.scss'], - standalone: false, + imports: [InputComponent, ReactiveFormsModule, I18nPluralPipe, TranslatePipe], }) export class TranslationComponent implements OnInit { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.module.ts b/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.module.ts deleted file mode 100644 index bb682fffec3..00000000000 --- a/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatInputModule } from '@angular/material/input'; -import { VitamUICommonModule } from 'vitamui-library'; -import { TranslationComponent } from './translation.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [TranslationComponent], - imports: [CommonModule, VitamUICommonModule, ReactiveFormsModule, MatInputModule, TranslatePipe], - exports: [TranslationComponent], -}) -export class TranslationModule {} diff --git a/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts index 3a6d7fd68a7..ac30ddfe46f 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts @@ -36,7 +36,8 @@ */ import { Component } from '@angular/core'; -import { FileValidationErrors, readFileContent, VitamUICommonModule } from 'vitamui-library'; +import { FileValidationErrors } from 'vitamui-library'; +import { readFileContent, VitamUICommonModule } from 'vitamui-library'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @Component({ diff --git a/ui/ui-frontend/projects/design-system/src/main.ts b/ui/ui-frontend/projects/design-system/src/main.ts index a76b446c356..0051de8f764 100644 --- a/ui/ui-frontend/projects/design-system/src/main.ts +++ b/ui/ui-frontend/projects/design-system/src/main.ts @@ -34,16 +34,27 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID } from '@angular/core'; +import { Title, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { provideI18n, ENVIRONMENT, BASE_URL, BaseUserInfoApiService } from 'vitamui-library'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { of } from 'rxjs'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.log(err)); +bootstrapApplication(AppComponent, { + providers: [ + provideI18n(), + provideNativeDateAdapter(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { provide: ENVIRONMENT, useValue: environment }, + { provide: BASE_URL, useValue: '/FAKE' }, + { provide: BaseUserInfoApiService, useValue: { patchMyUserInfo: () => of(undefined) } }, // Make changing language work + ], +}).catch((err) => console.log(err)); diff --git a/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts index 11f5b119500..b4ed2a8350e 100644 --- a/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts @@ -61,8 +61,7 @@ describe('AppComponent', () => { beforeEach(async () => { const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {}, getPlatformName: () => '' }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent], - declarations: [AppComponent], + imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/identity/src/app/app.component.ts b/ui/ui-frontend/projects/identity/src/app/app.component.ts index e24b5e05168..1080d3b522e 100644 --- a/ui/ui-frontend/projects/identity/src/app/app.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/app.component.ts @@ -37,12 +37,14 @@ import { Component, inject } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { StartupService } from 'vitamui-library'; +import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [HeaderModule, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule], }) export class AppComponent { title = 'Identity App'; diff --git a/ui/ui-frontend/projects/identity/src/app/app.module.ts b/ui/ui-frontend/projects/identity/src/app/app.module.ts deleted file mode 100644 index 9db7acd017b..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/app.module.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { DatePipe, registerLocaleData } from '@angular/common'; -import { default as localeFr } from '@angular/common/locales/fr'; -import { LOCALE_ID, NgModule } from '@angular/core'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { AuthenticationModule, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { CoreModule } from './core/core.module'; - -registerLocaleData(localeFr, 'fr'); - -@NgModule({ - declarations: [AppComponent], - imports: [ - AuthenticationModule.forRoot(), - CoreModule, - BrowserAnimationsModule, - BrowserModule, - VitamUICommonModule.forRoot(), - AppRoutingModule, - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ], - providers: [ - provideI18n(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { provide: WINDOW_LOCATION, useValue: window.location }, - DatePipe, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts index 1152ae3c22b..8217f5913dc 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { CustomerApiService } from './customer-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/core/core.module.ts b/ui/ui-frontend/projects/identity/src/app/core/core.module.ts index 401b3bcd284..c72a53b8d6f 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/core.module.ts @@ -37,7 +37,8 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NgModule, inject } from '@angular/core'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts index eb847a2cf0c..8233bd19593 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Customer, ENVIRONMENT, LoggerModule, Operators, OtpState, SnackBarService } from 'vitamui-library'; +import { BASE_URL, CriteriaSearchQuery, Customer, ENVIRONMENT } from 'vitamui-library'; +import { LoggerModule, Operators, OtpState, SnackBarService } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts index 658567da4bd..3d00d39787f 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts @@ -36,7 +36,8 @@ */ import { Observable, Subject, zip } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Customer, Logo, Operators, ThemeService, SnackBarService } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Customer, Logo, ThemeService, SnackBarService } from 'vitamui-library'; +import { Operators } from 'vitamui-library'; import { HttpResponse } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.spec.ts index 07c6f99fab2..89fd96681b0 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.spec.ts @@ -45,8 +45,7 @@ describe('CustomerAlertingComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatDialogModule], - declarations: [CustomerAlertingComponent], + imports: [MatDialogModule, CustomerAlertingComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts index 3f54966f48a..4e43a99c9a0 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts @@ -35,11 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-customer-alerting', templateUrl: './customer-alerting.component.html', styleUrls: ['./customer-alerting.component.scss'], - standalone: false, + imports: [CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class CustomerAlertingComponent {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts index b111262e3e9..1c9d8d4a442 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts @@ -35,16 +35,18 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnInit, inject } from '@angular/core'; -import { FormGroup } from '@angular/forms'; -import { Color, Option, ThemeColorType, ThemeService } from 'vitamui-library'; +import { FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Color, Option, ThemeColorType } from 'vitamui-library'; +import { ThemeService, SelectComponent } from 'vitamui-library'; import { Subscription } from 'rxjs'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { InputColorComponent } from './input-color/input-color.component'; @Component({ selector: 'app-customer-colors-input', templateUrl: './customer-colors-input.component.html', styleUrls: ['./customer-colors-input.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, InputColorComponent, SelectComponent, FormsModule, TranslatePipe], }) export class CustomerColorsInputComponent implements OnInit { private themeService = inject(ThemeService); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.module.ts deleted file mode 100644 index 37388414a8d..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.module.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; -import { ColorPickerDirective } from 'ngx-color-picker'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../../shared/shared.module'; -import { OwnerFormModule } from '../../owner-form/owner-form.module'; -import { CustomerColorsInputComponent } from './customer-colors-input.component'; -import { InputColorComponent } from './input-color/input-color.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - SharedModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - OwnerFormModule, - VitamUICommonModule, - ColorPickerDirective, - VitamUILibraryModule, - FormsModule, - TranslatePipe, - ], - declarations: [CustomerColorsInputComponent, InputColorComponent], - exports: [CustomerColorsInputComponent], -}) -export class CustomerColorsInputModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts index d361cb7ba79..232d6cba489 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts @@ -35,15 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnInit, ViewChild } from '@angular/core'; -import { AbstractControl, FormControl, ValidationErrors, ValidatorFn } from '@angular/forms'; +import { AbstractControl, FormControl, ValidationErrors, ValidatorFn, ReactiveFormsModule } from '@angular/forms'; import { ColorPickerDirective } from 'ngx-color-picker'; -import { hexToRgb, rgbToHsl, FormControlWarn } from 'vitamui-library'; +import { FormControlWarn } from 'vitamui-library'; +import { hexToRgb, rgbToHsl, InputComponent, PipesModule } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-input-color', templateUrl: './input-color.component.html', styleUrls: ['./input-color.component.scss'], - standalone: false, + imports: [InputComponent, ColorPickerDirective, ReactiveFormsModule, PipesModule, TranslatePipe], }) export class InputColorComponent implements OnInit { @Input() placeholder: string; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index 3ebde470c30..57b978d91aa 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -47,7 +47,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService, CountryService, LoggerModule, OtpState, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ConfirmDialogService, CountryService, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { LoggerModule, OtpState } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { CustomerService } from '../../core/customer.service'; import { OwnerFormValidators } from '../owner-form/owner-form.validators'; @@ -68,7 +69,16 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' multi: true, }, ], - standalone: false, + imports: [ + MatButtonToggleModule, + MatFormFieldModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatSelectModule, + NoopAnimationsModule, + ReactiveFormsModule, + VitamUICommonTestModule, + ], }) class DomainInputStubComponent implements ControlValueAccessor { @Input() @@ -98,7 +108,16 @@ class DomainInputStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, + imports: [ + MatButtonToggleModule, + MatFormFieldModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatSelectModule, + NoopAnimationsModule, + ReactiveFormsModule, + VitamUICommonTestModule, + ], }) class OwnerFormStubComponent implements ControlValueAccessor { @Input() @@ -121,7 +140,16 @@ class OwnerFormStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, + imports: [ + MatButtonToggleModule, + MatFormFieldModule, + MatProgressBarModule, + MatProgressSpinnerModule, + MatSelectModule, + NoopAnimationsModule, + ReactiveFormsModule, + VitamUICommonTestModule, + ], }) class CustomerColorsInputStubComponent implements ControlValueAccessor { @Input() @@ -230,7 +258,6 @@ describe('CustomerCreateComponent', () => { .mockReturnValue(() => of(null)), }; await TestBed.configureTestingModule({ - declarations: [CustomerCreateComponent, OwnerFormStubComponent, CustomerColorsInputStubComponent, DomainInputStubComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ LoggerModule.forRoot(), @@ -242,6 +269,10 @@ describe('CustomerCreateComponent', () => { NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, + CustomerCreateComponent, + OwnerFormStubComponent, + CustomerColorsInputStubComponent, + DomainInputStubComponent, ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts index c8fc0e00667..fd2d9f50399 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts @@ -36,8 +36,8 @@ */ import { ComponentType } from '@angular/cdk/portal'; import { Component, OnDestroy, OnInit, TemplateRef, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { finalize, merge, Observable, Subscription } from 'rxjs'; import { filter, tap } from 'rxjs/operators'; import { @@ -50,18 +50,56 @@ import { OtpState, StartupService, VitamuiSelectOptions, + DialogHeaderComponent, + StepperComponent, + InputComponent, + SelectComponent, + SlideToggleComponent, + NextStepComponent, + PreviousStepComponent, } from 'vitamui-library'; import { CustomerService } from '../../core/customer.service'; import { TenantFormValidators } from '../tenant-create/tenant-form.validators'; import { CustomerAlertingComponent } from './customer-alerting/customer-alerting.component'; import { ALPHA_NUMERIC_REGEX, CUSTOMER_CODE_MAX_LENGTH, CustomerCreateValidators } from './customer-create.validators'; import { TenantService } from '../tenant.service'; +import { CdkStep, CdkStepperNext } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { NgTemplateOutlet } from '@angular/common'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { DomainsInputComponent } from '../../shared/domains-input/domains-input.component'; +import { GraphicIdentityComponent } from '../customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component'; +import { HomepageMessageComponent } from '../customer-preview/homepage-message-tab/homepage-message/homepage-message.component'; +import { OwnerFormComponent } from '../owner-form/owner-form.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-customer-create', templateUrl: './customer-create.component.html', styleUrls: ['./customer-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + InputComponent, + SelectComponent, + SlideToggleComponent, + MatDialogActions, + NextStepComponent, + NgTemplateOutlet, + MatButtonToggleGroup, + MatButtonToggle, + DomainsInputComponent, + PreviousStepComponent, + GraphicIdentityComponent, + HomepageMessageComponent, + OwnerFormComponent, + CdkStepperNext, + TranslatePipe, + ], }) export class CustomerCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.module.ts deleted file mode 100644 index 9ad1c5d1d7f..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.module.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; - -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { CustomerPreviewModule } from '../customer-preview/customer-preview.module'; -import { OwnerFormModule } from '../owner-form/owner-form.module'; -import { CustomerAlertingComponent } from './customer-alerting/customer-alerting.component'; -import { CustomerColorsInputModule } from './customer-colors-input/customer-colors-input.module'; -import { CustomerCreateComponent } from './customer-create.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - CustomerColorsInputModule, - SharedModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatSelectModule, - ReactiveFormsModule, - OwnerFormModule, - VitamUICommonModule, - CustomerPreviewModule, - MatDialogModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [CustomerCreateComponent, CustomerAlertingComponent], -}) -export class CustomerCreateModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts index 180908b49f9..4060b5aefd5 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts @@ -44,7 +44,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of, Subject } from 'rxjs'; -import { Customer, OtpState, Owner, Tenant } from 'vitamui-library'; +import { Customer, Owner, Tenant } from 'vitamui-library'; +import { OtpState } from 'vitamui-library'; import { InfiniteScrollStubDirective, VitamUICommonTestModule } from 'vitamui-library/testing'; import { CustomerService } from '../../core/customer.service'; import { CustomerDataService } from '../customer.data.service'; @@ -56,7 +57,6 @@ import { CustomerListService } from './customer-list.service'; @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[vitamuiCommonCollapseTriggerFor]', - standalone: false, }) class CollapseTriggerForStubDirective { @Input() @@ -67,7 +67,6 @@ class CollapseTriggerForStubDirective { // eslint-disable-next-line @angular-eslint/directive-selector selector: '[vitamuiCommonCollapse]', exportAs: 'vitamuiCommonCollapse', - standalone: false, }) class CollapseStubDirective { @Input() @@ -77,7 +76,7 @@ class CollapseStubDirective { @Component({ selector: 'app-owner-list', template: '', - standalone: false, + imports: [MatProgressSpinnerModule, NoopAnimationsModule, VitamUICommonTestModule], }) class OwnerListStubComponent { @Input() @@ -280,9 +279,16 @@ describe('CustomerListComponent', () => { matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - imports: [MatProgressSpinnerModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [ + MatProgressSpinnerModule, + NoopAnimationsModule, + VitamUICommonTestModule, + CustomerListComponent, + CollapseStubDirective, + CollapseTriggerForStubDirective, + OwnerListStubComponent, + ], schemas: [NO_ERRORS_SCHEMA], - declarations: [CustomerListComponent, CollapseStubDirective, CollapseTriggerForStubDirective, OwnerListStubComponent], providers: [ { provide: CustomerListService, useValue: customerListServiceSpy }, { provide: CustomerService, useValue: { updated: new Subject() } }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts index 5263ef8c185..15248a9ef28 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts @@ -39,18 +39,45 @@ import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { Customer, DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, Owner, PageRequest, Tenant } from 'vitamui-library'; +import { + Customer, + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollTable, + Owner, + PageRequest, + Tenant, + CollapseContainerDirective, + CollapseDirective, + CollapseTriggerForDirective, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; import { CustomerService } from '../../core/customer.service'; import { CustomerDataService } from '../customer.data.service'; import { OwnerCreateComponent } from '../owner-create/owner-create.component'; import { TenantService } from '../tenant.service'; import { CustomerListService } from './customer-list.service'; +import { OwnerListComponent } from './owner-list/owner-list.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-customer-list', templateUrl: './customer-list.component.html', styleUrls: ['./customer-list.component.scss'], - standalone: false, + imports: [ + OwnerListComponent, + MatProgressSpinner, + TranslatePipe, + CollapseContainerDirective, + CollapseDirective, + CollapseTriggerForDirective, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class CustomerListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { customerListService: CustomerListService; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.module.ts deleted file mode 100644 index 70bd902140c..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.module.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatRippleModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule } from 'vitamui-library'; - -import { SharedModule } from '../../shared/shared.module'; -import { CustomerListComponent } from './customer-list.component'; -import { OwnerListComponent } from './owner-list/owner-list.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - SharedModule, - RouterModule, - MatRippleModule, - MatDialogModule, - MatProgressSpinnerModule, - VitamUICommonModule, - TranslatePipe, - ], - declarations: [CustomerListComponent, OwnerListComponent], - exports: [CustomerListComponent], -}) -export class CustomerListModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts index 2b2a391246e..ae1e0f78239 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts @@ -37,7 +37,8 @@ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, Customer, Direction, ENVIRONMENT, LoggerModule, OtpState, PageRequest } from 'vitamui-library'; +import { BASE_URL, Customer, ENVIRONMENT } from 'vitamui-library'; +import { Direction, LoggerModule, OtpState, PageRequest } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { CustomerListService } from './customer-list.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts index 46d952f1e45..3bd679292c4 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts @@ -38,7 +38,8 @@ import { Injectable, inject } from '@angular/core'; import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Customer, DEFAULT_PAGE_SIZE, Direction, Owner, PageRequest, PaginatedResponse, SearchService } from 'vitamui-library'; +import { Customer, DEFAULT_PAGE_SIZE, Owner, PaginatedResponse, SearchService } from 'vitamui-library'; +import { Direction, PageRequest } from 'vitamui-library'; import { CustomerApiService } from '../../core/api/customer-api.service'; @Injectable({ diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts index 85c9ab64b59..92b705ccb08 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts @@ -39,18 +39,21 @@ import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import type { Customer, Owner, Tenant } from 'vitamui-library'; +import { Customer, Owner, Tenant } from 'vitamui-library'; +import { EllipsisDirective, TooltipDirective } from 'vitamui-library'; import { CustomerDataService } from '../../customer.data.service'; import { OwnerCreateComponent } from '../../owner-create/owner-create.component'; import { OwnerService } from '../../owner.service'; import { TenantCreateComponent } from '../../tenant-create/tenant-create.component'; import { TenantService } from '../../tenant.service'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-owner-list', templateUrl: './owner-list.component.html', styleUrls: ['./owner-list.component.scss'], - standalone: false, + imports: [TooltipDirective, TranslatePipe, CommonModule, EllipsisDirective], }) export class OwnerListComponent implements OnDestroy, OnInit { private dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-popup.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-popup.component.ts index e4b724dfc2a..38aad63e89c 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-popup.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-popup.component.ts @@ -38,11 +38,12 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Customer } from 'vitamui-library'; +import { CustomerPreviewComponent } from './customer-preview.component'; @Component({ selector: 'app-customer-popup', template: '', - standalone: false, + imports: [CustomerPreviewComponent], }) export class CustomerPopupComponent { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts index c72eb43d627..5318c6a6f09 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts @@ -115,15 +115,17 @@ describe('CustomerPreviewComponent', () => { getConfigStringValue: () => 'https://dev.vitamui.com/identity', }; await TestBed.configureTestingModule({ - declarations: [ - TestHostComponent, + declarations: [TestHostComponent, InformationTabStubComponent, SsoTabStubComponent, GraphicIdentityTabStubComponent], + schemas: [NO_ERRORS_SCHEMA], + imports: [ + MatMenuModule, + MatTabsModule, + NoopAnimationsModule, + ReactiveFormsModule, + VitamUICommonTestModule, + LoggerModule.forRoot(), CustomerPreviewComponent, - InformationTabStubComponent, - SsoTabStubComponent, - GraphicIdentityTabStubComponent, ], - schemas: [NO_ERRORS_SCHEMA], - imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, LoggerModule.forRoot()], providers: [ { provide: CustomerService, useValue: customerServiceSpy }, { provide: StartupService, useValue: startupServiceStub }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts index 25360c1175f..d266035b07c 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts @@ -38,13 +38,38 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } fro import { Subscription } from 'rxjs'; import type { Customer } from 'vitamui-library'; +import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { CustomerService } from '../../core/customer.service'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { InformationTabComponent } from './information-tab/information-tab.component'; +import { SsoTabComponent } from './sso-tab/sso-tab.component'; +import { GraphicIdentityTabComponent } from './graphic-identity-tab/graphic-identity-tab.component'; +import { HomepageMessageTabComponent } from './homepage-message-tab/homepage-message-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-customer-preview', templateUrl: './customer-preview.component.html', styleUrls: ['./customer-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + InformationTabComponent, + SsoTabComponent, + GraphicIdentityTabComponent, + HomepageMessageTabComponent, + OperationHistoryTabComponent, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class CustomerPreviewComponent implements OnInit, OnDestroy { private customerService = inject(CustomerService); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.module.ts deleted file mode 100644 index 8f3fb6fd475..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.module.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { CustomParamsModule } from '../../shared/custom-params/custom-params.module'; -import { SharedModule } from '../../shared/shared.module'; -import { CustomerColorsInputModule } from '../customer-create/customer-colors-input/customer-colors-input.module'; -import { CustomerPreviewComponent } from './customer-preview.component'; -import { GraphicIdentityTabComponent } from './graphic-identity-tab/graphic-identity-tab.component'; -import { GraphicIdentityUpdateComponent } from './graphic-identity-tab/graphic-identity-update/graphic-identity-update.component'; - -import { GraphicIdentityFormComponent } from './graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component'; -import { GraphicIdentityComponent } from './graphic-identity-tab/graphic-identity/graphic-identity.component'; -import { HomepageMessageTabComponent } from './homepage-message-tab/homepage-message-tab.component'; -import { HomepageMessageUpdateComponent } from './homepage-message-tab/homepage-message-update/homepage-message-update.component'; - -import { HomepageMessageTranslationComponent } from './homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation'; -import { HomepageMessageComponent } from './homepage-message-tab/homepage-message/homepage-message.component'; -import { InformationTabComponent } from './information-tab/information-tab.component'; -import { IdentityProviderCreateComponent } from './sso-tab/identity-provider-create/identity-provider-create.component'; -import { IdentityProviderDetailsComponent } from './sso-tab/identity-provider-details/identity-provider-details.component'; -import { SsoTabComponent } from './sso-tab/sso-tab.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - CustomerColorsInputModule, - SharedModule, - RouterModule, - MatDialogModule, - MatMenuModule, - MatTabsModule, - MatSelectModule, - MatButtonToggleModule, - ReactiveFormsModule, - MatProgressBarModule, - MatProgressSpinnerModule, - VitamUICommonModule, - CustomParamsModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [ - CustomerPreviewComponent, - SsoTabComponent, - IdentityProviderCreateComponent, - IdentityProviderDetailsComponent, - InformationTabComponent, - GraphicIdentityTabComponent, - GraphicIdentityUpdateComponent, - GraphicIdentityComponent, - GraphicIdentityFormComponent, - HomepageMessageTabComponent, - HomepageMessageUpdateComponent, - HomepageMessageComponent, - HomepageMessageTranslationComponent, - ], - exports: [CustomerPreviewComponent, GraphicIdentityComponent, HomepageMessageComponent, HomepageMessageTranslationComponent], -}) -export class CustomerPreviewModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts index 5a1f21138aa..bd30831e67f 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts @@ -38,17 +38,19 @@ import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import type { Customer, Theme } from 'vitamui-library'; -import { ThemeColorType, ThemeService } from 'vitamui-library'; +import { Customer, Theme, ThemeColorType, ThemeService } from 'vitamui-library'; +import { PipesModule } from 'vitamui-library'; import { CustomerService } from '../../../core/customer.service'; import { GraphicIdentityUpdateComponent } from './graphic-identity-update/graphic-identity-update.component'; import { LogosSafeResourceUrl } from './logos-safe-resource-url.interface'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-graphic-identity-tab', templateUrl: './graphic-identity-tab.component.html', styleUrls: ['./graphic-identity-tab.component.scss'], - standalone: false, + imports: [MatProgressSpinner, PipesModule, TranslatePipe], }) export class GraphicIdentityTabComponent implements OnInit, OnDestroy { private customerService = inject(CustomerService); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts index 1e29902c6fc..fc05ec85a79 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts @@ -39,7 +39,8 @@ import { Component, forwardRef, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { BASE_URL, Customer, ENVIRONMENT, InjectorModule, LoggerModule, OtpState, SnackBarService } from 'vitamui-library'; +import { BASE_URL, Customer, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule, OtpState, SnackBarService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../../../environments/environment'; @@ -101,7 +102,7 @@ const expectedCustomer: Customer = { multi: true, }, ], - standalone: false, + imports: [ReactiveFormsModule, VitamUICommonTestModule, InjectorModule], }) class CustomerColorsInputStubComponent implements ControlValueAccessor { @Input() @@ -128,8 +129,14 @@ describe('GraphicIdentityUpdateComponent', () => { open: vi.fn().mockName('SnackBarService.open'), }; await TestBed.configureTestingModule({ - declarations: [CustomerColorsInputStubComponent, GraphicIdentityUpdateComponent], - imports: [ReactiveFormsModule, VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot()], + imports: [ + ReactiveFormsModule, + VitamUICommonTestModule, + InjectorModule, + LoggerModule.forRoot(), + CustomerColorsInputStubComponent, + GraphicIdentityUpdateComponent, + ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: expectedCustomer, logo: null } }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts index 072ac3da7cd..d8687b3cf84 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts @@ -36,18 +36,20 @@ */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { Customer, Logo } from 'vitamui-library'; import { CustomerService } from '../../../../core/customer.service'; import { LogosSafeResourceUrl } from './../logos-safe-resource-url.interface'; +import { GraphicIdentityComponent } from '../graphic-identity/graphic-identity.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-graphic-identity-update', templateUrl: './graphic-identity-update.component.html', styleUrls: ['./graphic-identity-update.component.scss'], - standalone: false, + imports: [GraphicIdentityComponent, MatDialogActions, TranslatePipe], }) export class GraphicIdentityUpdateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts index aa54e2cce2a..a43de42d836 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts @@ -35,14 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { FormGroup, ReactiveFormsModule } from '@angular/forms'; import { AttachmentType, Logo, ThemeService } from 'vitamui-library'; +import { VitamuiDragDropFileComponent } from 'vitamui-library'; +import { CustomerColorsInputComponent } from '../../../../customer-create/customer-colors-input/customer-colors-input.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-graphic-identity-form', templateUrl: './graphic-identity-form.component.html', styleUrls: ['./graphic-identity-form.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, CustomerColorsInputComponent, VitamuiDragDropFileComponent, TranslatePipe], }) export class GraphicIdentityFormComponent implements OnInit { private themeService = inject(ThemeService); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts index 4fd5ff5fa40..adeeaaa4fa2 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts @@ -35,12 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, ValidatorFn, Validators, ReactiveFormsModule } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; import { Subject } from 'rxjs'; -import type { Customer, Logo, Theme } from 'vitamui-library'; -import { ThemeColorType, ThemeService } from 'vitamui-library'; +import { Customer, Logo, Theme, ThemeService } from 'vitamui-library'; +import { ThemeColorType, SlideToggleComponent } from 'vitamui-library'; import type { LogosSafeResourceUrl } from './../logos-safe-resource-url.interface'; +import { GraphicIdentityFormComponent } from './graphic-identity-form/graphic-identity-form.component'; +import { TranslatePipe } from '@ngx-translate/core'; interface ThemeColorGroup { [ThemeColorType.VITAMUI_PRIMARY]: FormControl; @@ -54,7 +56,7 @@ interface ThemeColorGroup { selector: 'app-graphic-identity', templateUrl: './graphic-identity.component.html', styleUrls: ['./graphic-identity.component.scss'], - standalone: false, + imports: [SlideToggleComponent, ReactiveFormsModule, GraphicIdentityFormComponent, TranslatePipe], }) export class GraphicIdentityComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts index 43c630b4d92..83fdc634ea0 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts @@ -37,15 +37,16 @@ import { Component, Input, OnDestroy, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subject } from 'rxjs'; -import type { Customer } from 'vitamui-library'; -import { StartupService } from 'vitamui-library'; +import { Customer, StartupService } from 'vitamui-library'; import { HomepageMessageUpdateComponent } from './homepage-message-update/homepage-message-update.component'; +import { KeyValuePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-homepage-message-tab', templateUrl: './homepage-message-tab.component.html', styleUrls: ['./homepage-message-tab.component.scss'], - standalone: false, + imports: [KeyValuePipe, TranslatePipe], }) export class HomepageMessageTabComponent implements OnDestroy { private dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts index f8b8f61acb6..fc90372e7bd 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts @@ -36,17 +36,19 @@ */ import { Component, OnDestroy, inject } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ConfirmDialogService, Customer } from 'vitamui-library'; import { CustomerService } from '../../../../core/customer.service'; +import { HomepageMessageComponent } from '../homepage-message/homepage-message.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-homepage-message-update', templateUrl: './homepage-message-update.component.html', styleUrls: ['./homepage-message-update.component.scss'], - standalone: false, + imports: [HomepageMessageComponent, MatDialogActions, TranslatePipe], }) export class HomepageMessageUpdateComponent implements OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts index 47e58b2ebac..159516efa76 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts @@ -35,15 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; import { Option } from 'vitamui-library'; +import { SelectComponent, InputComponent } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-homepage-message-translation', templateUrl: './homepage-message-translation.html', styleUrls: ['./homepage-message-translation.scss'], - standalone: false, + imports: [ReactiveFormsModule, SelectComponent, InputComponent, TranslatePipe], }) export class HomepageMessageTranslationComponent implements OnInit, OnDestroy { @Input() diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts index 24709ff80b0..a9b0261aee9 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts @@ -35,18 +35,29 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { AfterViewInit, Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MatDialogRef, MatDialogContent } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { take, takeUntil } from 'rxjs/operators'; -import type { Customer, Option } from 'vitamui-library'; -import { LanguageService, StartupService } from 'vitamui-library'; +import { Customer, Option, LanguageService, StartupService } from 'vitamui-library'; +import { DialogHeaderComponent, InputComponent } from 'vitamui-library'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { HomepageMessageTranslationComponent } from './homepage-message-translation/homepage-message-translation'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-homepage-message', templateUrl: './homepage-message.component.html', styleUrls: ['./homepage-message.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + CdkScrollable, + MatDialogContent, + ReactiveFormsModule, + InputComponent, + HomepageMessageTranslationComponent, + TranslatePipe, + ], }) export class HomepageMessageComponent implements OnInit, OnDestroy, AfterViewInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.spec.ts deleted file mode 100644 index 683094ae7fc..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.spec.ts +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, forwardRef, Input, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import type { AsyncValidator, Validator } from '@angular/forms'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { EMPTY, of } from 'rxjs'; -import { BASE_URL, CountryService, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; -import type { Customer } from 'vitamui-library'; -import { OtpState } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { CustomerService } from '../../../core/customer.service'; -import { CustomerCreateValidators } from '../../customer-create/customer-create.validators'; -import { InformationTabComponent } from './information-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -let expectedCustomer: Customer = { - id: '11', - identifier: '11', - code: '011000', - name: 'Kouygues Telecom', - companyName: 'Kouygues Telecom', - enabled: true, - readonly: false, - hasCustomGraphicIdentity: false, - language: 'FRENCH', - passwordRevocationDelay: 1, - otp: OtpState.OPTIONAL, - idp: false, - emailDomains: ['kouygues.com'], - defaultEmailDomain: 'kouygues.com', - address: { - street: '13 rue faubourg', - zipCode: '75009', - city: 'paris', - country: 'france', - }, - internalCode: '1', - owners: [], - themeColors: {}, - portalTitles: {}, - portalMessages: {}, - gdprAlert: false, - gdprAlertDelay: 72, -}; - -@Component({ - selector: 'app-editable-domain-input', - template: '', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => EditableDomainInputStubComponent), - multi: true, - }, - ], - standalone: false, -}) -class EditableDomainInputStubComponent implements ControlValueAccessor { - @Input() - validator: Validator; - @Input() - asyncValidator: AsyncValidator; - @Input() - defaultDomain: string; - - writeValue() {} - - registerOnChange() {} - - registerOnTouched() {} -} - -@Component({ - selector: 'app-customer-colors-input', - template: '', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => CustomerColorsInputStubComponent), - multi: true, - }, - ], - standalone: false, -}) -class CustomerColorsInputStubComponent implements ControlValueAccessor { - @Input() - placeholder: string; - @Input() - spinnerDiameter = 25; - - writeValue() {} - - registerOnChange() {} - - registerOnTouched() {} -} - -@Component({ - template: ` > - `, - standalone: false, -}) -class TestHostComponent { - customer = expectedCustomer; - readOnly = false; - gdprReadOnlyStatus = false; - - @ViewChild(InformationTabComponent, { static: false }) - component: InformationTabComponent; -} - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('Customer InformationTabComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - expectedCustomer = { - id: '11', - identifier: '11', - code: '011000', - name: 'Kouygues Telecom', - companyName: 'Kouygues Telecom', - enabled: true, - readonly: false, - hasCustomGraphicIdentity: false, - language: 'FRENCH', - passwordRevocationDelay: 1, - otp: OtpState.OPTIONAL, - idp: false, - emailDomains: ['kouygues.com'], - defaultEmailDomain: 'kouygues.com', - address: { - street: '13 rue faubourg', - zipCode: '75009', - city: 'paris', - country: 'france', - }, - internalCode: '1', - owners: [], - themeColors: {}, - portalMessages: {}, - portalTitles: {}, - gdprAlert: false, - gdprAlertDelay: 72, - }; - const customerServiceSpy = { - patch: vi.fn().mockName('CustomerService.patch').mockReturnValue(of({})), - }; - const customerCreateValidatorsSpy = { - uniqueCode: vi - .fn() - .mockName('CustomerCreateValidators.uniqueCode') - .mockReturnValue(() => of(null)), - uniqueDomain: vi - .fn() - .mockName('CustomerCreateValidators.uniqueDomain') - .mockReturnValue(() => of(null)), - }; - - await TestBed.configureTestingModule({ - imports: [LoggerModule.forRoot(), NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], - schemas: [NO_ERRORS_SCHEMA], - declarations: [InformationTabComponent, TestHostComponent, EditableDomainInputStubComponent, CustomerColorsInputStubComponent], - providers: [ - { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: StartupService, useValue: { getConfigNumberValue: () => 100 } }, - { provide: CustomerService, useValue: customerServiceSpy }, - { provide: CustomerCreateValidators, useValue: customerCreateValidatorsSpy }, - { provide: CountryService, useValue: { getAvailableCountries: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }) - .overrideComponent(InformationTabComponent, { - set: { template: '' }, - }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - - testhost.customer = expectedCustomer; - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should have the correct fields', () => { - expect(testhost.component.form.get('id')).not.toBeNull(); - expect(testhost.component.form.get('code')).not.toBeNull(); - expect(testhost.component.form.get('name')).not.toBeNull(); - expect(testhost.component.form.get('companyName')).not.toBeNull(); - expect(testhost.component.form.get('passwordRevocationDelay')).not.toBeNull(); - expect(testhost.component.form.get('otp')).not.toBeNull(); - expect(testhost.component.form.get('address.street')).not.toBeNull(); - expect(testhost.component.form.get('address.zipCode')).not.toBeNull(); - expect(testhost.component.form.get('address.city')).not.toBeNull(); - expect(testhost.component.form.get('address.country')).not.toBeNull(); - expect(testhost.component.form.get('internalCode')).not.toBeNull(); - expect(testhost.component.form.get('language')).not.toBeNull(); - expect(testhost.component.form.get('emailDomains')).not.toBeNull(); - expect(testhost.component.form.get('defaultEmailDomain')).not.toBeNull(); - }); - - it('should have the required validator', () => { - testhost.component.form.setValue({ - id: null, - identifier: null, - code: null, - name: null, - companyName: null, - passwordRevocationDelay: null, - otp: null, - address: { - street: null, - zipCode: null, - city: null, - country: null, - }, - internalCode: null, - language: null, - emailDomains: null, - defaultEmailDomain: null, - gdprAlert: null, - gdprAlertDelay: null, - }); - expect(testhost.component.form.get('id').valid).toBeFalsy(); - expect(testhost.component.form.get('code').valid).toBeFalsy(); - expect(testhost.component.form.get('name').valid).toBeFalsy(); - expect(testhost.component.form.get('companyName').valid).toBeFalsy(); - expect(testhost.component.form.get('passwordRevocationDelay').valid).toBeFalsy(); - expect(testhost.component.form.get('otp').valid).toBeTruthy(); - expect(testhost.component.form.get('address.street').valid).toBeFalsy(); - expect(testhost.component.form.get('address.zipCode').valid).toBeFalsy(); - expect(testhost.component.form.get('address.city').valid).toBeFalsy(); - expect(testhost.component.form.get('address.country').valid).toBeFalsy(); - expect(testhost.component.form.get('language').valid).toBeFalsy(); - expect(testhost.component.form.get('emailDomains').valid).toBeFalsy(); - expect(testhost.component.form.get('defaultEmailDomain').valid).toBeFalsy(); - }); - - it('should have the pattern validator', () => { - const codeControl = testhost.component.form.get('code'); - codeControl.setValue('a'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('123456a'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('aaaaaa'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('1234'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('1234_'); - expect(codeControl.valid).toBeFalsy(); - codeControl.setValue('1234_qzdqzdzqdzqd48d5zq41d5qz1d654'); - expect(codeControl.valid).toBeFalsy(); - }); - - it('should be valid and call update()', () => { - testhost.component.form.setValue({ - id: expectedCustomer.id, - identifier: expectedCustomer.identifier, - code: expectedCustomer.code, - name: expectedCustomer.name, - companyName: expectedCustomer.companyName, - passwordRevocationDelay: expectedCustomer.passwordRevocationDelay, - otp: expectedCustomer.otp, - address: { - street: expectedCustomer.address.street, - zipCode: expectedCustomer.address.zipCode, - city: expectedCustomer.address.city, - country: expectedCustomer.address.country, - }, - internalCode: expectedCustomer.internalCode, - language: expectedCustomer.language, - emailDomains: expectedCustomer.emailDomains, - defaultEmailDomain: expectedCustomer.defaultEmailDomain, - gdprAlert: expectedCustomer.gdprAlert, - gdprAlertDelay: expectedCustomer.gdprAlertDelay, - }); - expect(testhost.component.form.valid).toBeTruthy(); - }); - - it('should disable then enable the form', () => { - testhost.component.readOnly = true; - expect(testhost.component.form.disabled).toBe(true); - testhost.component.readOnly = false; - expect(testhost.component.form.disabled).toBe(false); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts index 98e688d7ffd..2eb2d104515 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts @@ -35,15 +35,45 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { merge, of, Subscription } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { CountryOption, Customer, OtpState } from 'vitamui-library'; -import { CountryService, diff, Option, StartupService } from 'vitamui-library'; +import { CountryOption, Customer, OtpState, CountryService, Option, StartupService } from 'vitamui-library'; +import { + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, + diff, + VitamUIFieldErrorComponent, + FormFieldValueWrapperComponent, + SelectComponent, + SlideToggleComponent, +} from 'vitamui-library'; import { CustomerService } from '../../../core/customer.service'; import { ALPHA_NUMERIC_REGEX, CUSTOMER_CODE_MAX_LENGTH, CustomerCreateValidators } from '../../customer-create/customer-create.validators'; +import { EditableDomainInputComponent } from '../../../shared/editable-field/editable-domain-input/editable-domain-input.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const UPDATE_DEBOUNCE_TIME = 200; @@ -51,7 +81,38 @@ const UPDATE_DEBOUNCE_TIME = 200; selector: 'app-information-tab', templateUrl: './information-tab.component.html', styleUrls: ['./information-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + VitamUIFieldErrorComponent, + FormFieldValueWrapperComponent, + SelectComponent, + EditableDomainInputComponent, + SlideToggleComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class InformationTabComponent implements OnInit, OnDestroy { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts index 9f2054b9454..c7e2e0e99dc 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts @@ -43,7 +43,8 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelect, MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of, throwError as observableThrowError } from 'rxjs'; -import { AuthnRequestBindingEnum, ConfirmDialogService, newFile } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { AuthnRequestBindingEnum, newFile } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { IdentityProviderService } from '../identity-provider.service'; import { IdentityProviderCreateComponent } from './identity-provider-create.component'; @@ -58,7 +59,14 @@ import { IdentityProviderCreateComponent } from './identity-provider-create.comp multi: true, }, ], - standalone: false, + imports: [ + MatProgressBarModule, + ReactiveFormsModule, + MatButtonToggleModule, + MatSelectModule, + NoopAnimationsModule, + VitamUICommonTestModule, + ], }) class PatternStubComponent implements ControlValueAccessor { @Input() @@ -101,9 +109,10 @@ describe('IdentityProviderCreateComponent', () => { MatSelectModule, NoopAnimationsModule, VitamUICommonTestModule, + IdentityProviderCreateComponent, + PatternStubComponent, ], schemas: [NO_ERRORS_SCHEMA], - declarations: [IdentityProviderCreateComponent, PatternStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: { id: '42', name: 'OwnerName' } } }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts index 26e193d78e9..74387000e70 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts @@ -35,18 +35,54 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { AuthnRequestBindingEnum, ConfirmDialogService, Customer, IdentityProvider } from 'vitamui-library'; +import { + AuthnRequestBindingEnum, + ConfirmDialogService, + Customer, + IdentityProvider, + DialogHeaderComponent, + StepperComponent, + SlideToggleComponent, + InputComponent, + PatternComponent, + NextStepComponent, + PreviousStepComponent, + SelectComponent, +} from 'vitamui-library'; import { IdentityProviderService } from '../identity-provider.service'; import JWS_ALGORITHMS, { ProtocoleType } from '../sso-tab-const'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { CustomParamsComponent } from '../../../../shared/custom-params/custom-params.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-identity-provider-create', templateUrl: './identity-provider-create.component.html', styleUrls: ['./identity-provider-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + SlideToggleComponent, + MatButtonToggleGroup, + MatButtonToggle, + InputComponent, + PatternComponent, + MatDialogActions, + NextStepComponent, + PreviousStepComponent, + SelectComponent, + CustomParamsComponent, + TranslatePipe, + ], }) export class IdentityProviderCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.spec.ts deleted file mode 100644 index f944f03cc62..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.spec.ts +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { Component, forwardRef, Input, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import type { AsyncValidator, Validator } from '@angular/forms'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of } from 'rxjs'; - -import { AuthnRequestBindingEnum } from 'vitamui-library'; -import type { IdentityProvider } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { IdentityProviderService } from '../identity-provider.service'; -import { IdentityProviderDetailsComponent } from './identity-provider-details.component'; - -@Component({ - selector: 'app-editable-keystore', - template: '', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => EditableKeystoreStubComponent), - multi: true, - }, - ], - standalone: false, -}) -class EditableKeystoreStubComponent implements ControlValueAccessor { - @Input() - validator: Validator; - @Input() - asyncValidator: AsyncValidator; - @Input() - identityProvider: any; - @Input() - disabled: boolean; - writeValue() {} - registerOnChange() {} - registerOnTouched() {} -} - -@Component({ - selector: 'app-editable-patterns', - template: '', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => EditablePatternStubComponent), - multi: true, - }, - ], - standalone: false, -}) -class EditablePatternStubComponent implements ControlValueAccessor { - @Input() - validator: Validator; - @Input() - asyncValidator: AsyncValidator; - @Input() - options: any; - writeValue() {} - registerOnChange() {} - registerOnTouched() {} -} - -@Component({ - template: ` - - `, - standalone: false, -}) -class TestHostComponent { - @ViewChild(IdentityProviderDetailsComponent, { static: false }) - component: IdentityProviderDetailsComponent; - provider: IdentityProvider = { - propagateLogout: false, - id: '42', - customerId: '1234', - identifier: '2', - name: 'Test IDP', - technicalName: 'Test IDP', - internal: true, - keystorePassword: 'testpassword1234', - - patterns: ['test1.com', 'test3.com'], - enabled: true, - keystore: null, - idpMetadata: null, - readonly: false, - mailAttribute: 'mailAttribute', - identifierAttribute: 'identifierAttribute', - authnRequestBinding: AuthnRequestBindingEnum.POST, - autoProvisioningEnabled: false, - authnRequestSigned: false, - maximumAuthenticationLifetime: 0, - wantsAssertionsSigned: false, - }; - domains = [ - { value: 'test1.com', disabled: true }, - { value: 'test2.com', disabled: true }, - { value: 'test3.com', disabled: true }, - { value: 'test4.com', disabled: false }, - { value: 'test5.com', disabled: false }, - ]; - readOnly: boolean; -} - -describe('IdentityProviderDetailsComponent', () => { - it('TODO - skipped tests pending migration', () => { - // Placeholder: tests below are skipped pending migration - }); -}); - -describe.skip('IdentityProviderDetailsComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule], - declarations: [IdentityProviderDetailsComponent, TestHostComponent, EditableKeystoreStubComponent, EditablePatternStubComponent], - providers: [{ provide: IdentityProviderService, useValue: { patch: () => of(null), updateMetadataFile: () => of(null) } }], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - @NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) - class TestHostModule {} - describe('Class', () => { - it('should set the form value', () => { - expect(testhost.component.form.getRawValue()).toEqual({ - authnRequestBinding: 'POST', - autoProvisioningEnabled: false, - clientId: null, - clientSecret: null, - customParams: null, - discoveryUrl: null, - enabled: true, - identifier: '2', - identifierAttribute: 'identifierAttribute', - internal: true, - mailAttribute: 'mailAttribute', - name: 'Test IDP', - patterns: ['test1.com', 'test3.com'], - preferredJwsAlgorithm: null, - protocoleType: null, - scope: null, - useNonce: null, - usePkce: null, - useState: null, - }); - }); - - it('should enable the pattern used by the provider', () => { - expect(testhost.component.domains).toEqual([ - { value: 'test1.com', disabled: false }, - { value: 'test2.com', disabled: true }, - { value: 'test3.com', disabled: false }, - { value: 'test4.com', disabled: false }, - { value: 'test5.com', disabled: false }, - ]); - }); - - it('should have the correct fields', () => { - expect(testhost.component.form.get('id')).toBeNull(); - expect(testhost.component.form.get('identifier')).not.toBeNull(); - expect(testhost.component.form.get('enabled')).not.toBeNull(); - expect(testhost.component.form.get('name')).not.toBeNull(); - expect(testhost.component.form.get('internal')).not.toBeNull(); - expect(testhost.component.form.get('patterns')).not.toBeNull(); - expect(testhost.component.form.get('mailAttribute')).not.toBeNull(); - expect(testhost.component.form.get('identifierAttribute')).not.toBeNull(); - expect(testhost.component.form.get('authnRequestBinding')).not.toBeNull(); - expect(testhost.component.form.get('autoProvisioningEnabled')).not.toBeNull(); - }); - - it('should have the required validator', () => { - testhost.component.form.setValue({ - identifier: null, - enabled: null, - name: null, - internal: null, - patterns: null, - mailAttribute: null, - identifierAttribute: null, - authnRequestBinding: null, - autoProvisioningEnabled: null, - protocoleType: null, - clientId: null, - clientSecret: null, - customParams: null, - discoveryUrl: null, - scope: null, - preferredJwsAlgorithm: null, - useNonce: null, - usePkce: null, - useState: null, - }); - expect(testhost.component.form.get('enabled').valid).toBeFalsy(); - expect(testhost.component.form.get('identifier').valid).toBeFalsy(); - expect(testhost.component.form.get('name').valid).toBeFalsy(); - expect(testhost.component.form.get('internal').valid).toBeFalsy(); - expect(testhost.component.form.get('patterns').valid).toBeFalsy(); - expect(testhost.component.form.get('mailAttribute').valid).toBeTruthy(); - expect(testhost.component.form.get('authnRequestBinding').valid).toBeFalsy(); - expect(testhost.component.form.get('autoProvisioningEnabled').valid).toBeFalsy(); - }); - - it('should be valid and call patch()', waitForAsync(() => { - const providerService = TestBed.inject(IdentityProviderService); - vi.spyOn(providerService, 'patch').mockReturnValue(of(null)); - testhost.component.form.setValue({ - identifier: testhost.provider.identifier, - enabled: false, - name: testhost.provider.name, - internal: testhost.provider.internal, - patterns: testhost.provider.patterns, - mailAttribute: testhost.provider.mailAttribute, - identifierAttribute: testhost.provider.identifierAttribute, - authnRequestBinding: testhost.provider.authnRequestBinding, - autoProvisioningEnabled: false, - protocoleType: 'SAML', - clientId: 2, - clientSecret: 'secret', - discoveryUrl: 'discoveryUrl', - scope: 'private', - preferredJwsAlgorithm: 'HS-256', - customParams: { key: 'value' }, - useNonce: true, - usePkce: true, - useState: true, - }); - expect(testhost.component.form.valid).toBeTruthy(); - })); - - it('should call updateMetadataFile'); - - it('should disable then enable the form', () => { - testhost.readOnly = true; - fixture.detectChanges(); - expect(testhost.component.form.disabled).toBe(true); - expect(testhost.component.idpMetadata.disabled).toBe(true); - testhost.readOnly = false; - fixture.detectChanges(); - expect(testhost.component.form.disabled).toBe(false); - expect(testhost.component.idpMetadata.disabled).toBe(false); - }); - }); - - describe('DOM', () => { - it('TODO', () => { - // TODO - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts index b71f5f66816..d5aaf6a8bf2 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts @@ -35,15 +35,48 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { merge } from 'rxjs'; import { debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty, isEqual, isObject, mapObject, omit } from 'underscore'; -import type { IdentityProvider } from 'vitamui-library'; -import { AuthnRequestBindingEnum, newFile, SnackBarService } from 'vitamui-library'; +import { IdentityProvider, SnackBarService } from 'vitamui-library'; +import { + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, + AuthnRequestBindingEnum, + newFile, + SlideToggleComponent, + VitamUIFieldErrorComponent, + FormFieldValueWrapperComponent, + SelectComponent, +} from 'vitamui-library'; import { IdentityProviderService } from '../identity-provider.service'; import JWS_ALGORITHMS, { ProtocoleType } from '../sso-tab-const'; +import { EditablePatternsComponent } from '../../../../shared/editable-field/editable-patterns/editable-patterns.component'; +import { EditableKeystoreComponent } from '../../../../shared/editable-field/editable-keystore/editable-keystore.component'; +import { EditableCustomParamsComponent } from '../../../../shared/editable-field/editable-custom-params/editable-custom-params.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const UPDATE_DEBOUNCE_TIME = 200; @@ -51,7 +84,40 @@ const UPDATE_DEBOUNCE_TIME = 200; selector: 'app-identity-provider-details', templateUrl: './identity-provider-details.component.html', styleUrls: ['./identity-provider-details.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + SlideToggleComponent, + VitamUIFieldErrorComponent, + EditablePatternsComponent, + EditableKeystoreComponent, + EditableCustomParamsComponent, + FormFieldValueWrapperComponent, + SelectComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class IdentityProviderDetailsComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts index 22d2a1383b8..4d6517101c2 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts @@ -36,7 +36,8 @@ */ import { Observable, Subject } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { Criterion, CriteriaSearchQuery, IdentityProvider, Operators, SnackBarService } from 'vitamui-library'; +import { Criterion, CriteriaSearchQuery, IdentityProvider, SnackBarService } from 'vitamui-library'; +import { Operators } from 'vitamui-library'; import { HttpParams } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.spec.ts deleted file mode 100644 index 749522751ab..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.spec.ts +++ /dev/null @@ -1,268 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { Component, Input, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatDialog } from '@angular/material/dialog'; -import { of, Subject } from 'rxjs'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BASE_URL, OtpState, SnackBarService } from 'vitamui-library'; -import type { Customer, IdentityProvider } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { IdentityProviderService } from './identity-provider.service'; -import { ProviderApiService } from './provider-api.service'; -import { SsoTabComponent } from './sso-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -@Component({ - selector: 'app-identity-provider-details', - template: '', - standalone: false, -}) -class IdentityProviderDetailsStubComponent { - @Input() - identityProvider: IdentityProvider; - @Input() - domains: any; - @Input() - readOnly: boolean; -} - -@Component({ - template: ` `, - standalone: false, -}) -class TestHostComponent { - customer: Customer = { - id: '5ad5f14c894e6a414edc7b5ffd02766b442f4256b563a6e3909e05b9e3abf9ea', - identifier: '1', - code: '015000', - name: 'TeamVitamUI', - companyName: 'vitamui', - enabled: false, - readonly: false, - hasCustomGraphicIdentity: false, - language: 'FRENCH', - passwordRevocationDelay: 9, - otp: OtpState.OPTIONAL, - emailDomains: ['vitamui.com', '1test.com', 'test2.com', 'test3.com', 'test4.com', 'test5.com', 'test6.com'], - defaultEmailDomain: '1test.com', - address: { - street: '73 rue du Faubourg Poissonnière ', - zipCode: '75009', - city: 'Paris', - country: 'DK', - }, - owners: [], - themeColors: {}, - gdprAlert: false, - gdprAlertDelay: 72, - portalMessages: {}, - portalTitles: {}, - }; - @ViewChild(SsoTabComponent, { static: false }) - component: SsoTabComponent; -} - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('SsoTabComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - let providers: any[]; - - beforeEach(async () => { - providers = [ - { - id: '5ad5f14c894e6a414edc7b60c5397d744f4b4ed8bd86934d0a8e8311add40f3f', - customerId: '5ad5f14c894e6a414edc7b5ffd02766b442f4256b563a6e3909e05b9e3abf9ea', - name: 'default', - internal: true, - enabled: true, - patterns: null, - keystoreBase64: null, - keystorePassword: null, - privateKeyPassword: null, - idpMetadata: null, - spMetadata: null, - }, - { - id: '5ad5f14e894e6a414edc7b91dc194c3187f143cbb7593242769a1706fd03d3f3', - customerId: '5ad5f14c894e6a414edc7b5ffd02766b442f4256b563a6e3909e05b9e3abf9ea', - name: 'TeamVitamUI', - internal: true, - enabled: true, - patterns: null, - keystoreBase64: null, - keystorePassword: null, - privateKeyPassword: null, - idpMetadata: null, - spMetadata: null, - }, - { - id: '5af95fae636f9114e074100590122991ac38418595cd0dab684fee3bccacd2dd', - customerId: '5ad5f14c894e6a414edc7b5ffd02766b442f4256b563a6e3909e05b9e3abf9ea', - name: 'test', - internal: false, - enabled: true, - patterns: ['vitamui.com'], - keystoreBase64: null, - keystorePassword: 'test', - privateKeyPassword: 'test', - idpMetadata: null, - spMetadata: null, - }, - ]; - - const matDialogSpy = { - open: vi.fn().mockName('MatDialog.open'), - }; - matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); - - await TestBed.configureTestingModule({ - declarations: [SsoTabComponent, IdentityProviderDetailsStubComponent, TestHostComponent], - imports: [VitamUICommonTestModule], - providers: [ - ProviderApiService, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: MatDialog, useValue: matDialogSpy }, - { provide: SnackBarService, useValue: { notifyDownloadStarted: vi.fn().mockName('SnackBarService.notifyDownloadStarted') } }, - { - provide: IdentityProviderService, - useValue: { - getAll: () => of(providers), - getDomainByCustomerId: () => of(['test1.com', 'test2.com']), - updated: new Subject(), - }, - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should set the providers', () => { - expect(testhost.component.providers).toEqual(providers); - }); - - it('should call open', () => { - const matDialogSpy = TestBed.inject(MatDialog); - testhost.component.openCreateIDPDialog(); - expect(matDialogSpy.open).toHaveBeenCalled(); - }); - - describe('DOM', () => { - describe('Button "Create IDP"', () => { - it('should exist', () => { - const elButton = fixture.nativeElement.querySelector('button'); - expect(elButton).toBeTruthy(); - expect(elButton.textContent).toContain('CUSTOMER.SSO.BUTTON'); - }); - - it('should call openCreateIDPDialog()', () => { - vi.spyOn(testhost.component, 'openCreateIDPDialog').mockImplementation(() => {}); - const elButton = fixture.nativeElement.querySelector('button'); - elButton.click(); - expect(testhost.component.openCreateIDPDialog).toHaveBeenCalled(); - }); - - it('should be disabled', () => { - vi.spyOn(testhost.component, 'openCreateIDPDialog').mockImplementation(() => {}); - testhost.component.domains = [{ value: 'test.com', disabled: true }]; - expect(testhost.component.domainsAvailable).toBeFalsy(); - expect(testhost.component.openCreateIDPDialog).not.toHaveBeenCalled(); - }); - - it('should not show up in readonly mode', () => { - testhost.component.readOnly = true; - fixture.detectChanges(false); - expect(testhost.component.readOnly).toBe(true); - }); - }); - - describe('Providers List', () => { - it('should display the list of providers', () => { - const elProviders = fixture.nativeElement.querySelectorAll('.provider-item-content'); - expect(elProviders.length).toBe(3); - elProviders.forEach((elProvider: HTMLElement, index: number) => { - expect(elProvider.textContent).toContain(providers[index].name); - expect(elProvider.textContent).toContain(providers[index].internal ? 'CUSTOMER.SSO.TYPE_INTERNAL' : 'CUSTOMER.SSO.TYPE_EXTERNAL'); - expect(elProvider.textContent).toContain( - providers[index].enabled ? 'CUSTOMER.SSO.STATUS_ACTIVE' : 'CUSTOMER.SSO.STATUS_INACTIVE', - ); - }); - }); - - it('should select the provider on click', () => { - const elProviders = fixture.nativeElement.querySelectorAll('.provider-item-content'); - elProviders[0].click(); - fixture.detectChanges(); - expect(testhost.component.selectedIdentityProvider).toBe(testhost.component.providers[0]); - }); - }); - - describe('Provider Details', () => { - it('should not show if no provider is selected', () => { - const elProviderDetails = fixture.nativeElement.querySelector('app-identity-provider-details'); - expect(elProviderDetails).toBeFalsy(); - }); - - it('should show when a provider is selected', () => { - testhost.component.selectIdentityProvider(providers[0]); - expect(testhost.component.selectedIdentityProvider).toBe(providers[0]); - }); - - it('should have a "back" button', () => { - testhost.component.selectIdentityProvider(providers[0]); - expect(testhost.component.selectedIdentityProvider).toBeTruthy(); - testhost.component.selectedIdentityProvider = null; - expect(testhost.component.selectedIdentityProvider).toBeFalsy(); - }); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts index 91f4a88ff57..e739301bab4 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts @@ -39,16 +39,18 @@ import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import type { Customer, IdentityProvider } from 'vitamui-library'; -import { DownloadUtils, SnackBarService } from 'vitamui-library'; +import { DownloadUtils, SnackBarService, TooltipDirective } from 'vitamui-library'; import { IdentityProviderCreateComponent } from './identity-provider-create/identity-provider-create.component'; import { IdentityProviderService } from './identity-provider.service'; import { ProviderApiService } from './provider-api.service'; +import { IdentityProviderDetailsComponent } from './identity-provider-details/identity-provider-details.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-sso-tab', templateUrl: './sso-tab.component.html', styleUrls: ['./sso-tab.component.scss'], - standalone: false, + imports: [TooltipDirective, IdentityProviderDetailsComponent, TranslatePipe], }) export class SsoTabComponent implements OnDestroy, OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts index c56792b1a22..505fb025932 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts @@ -38,7 +38,8 @@ import { inject, TestBed } from '@angular/core/testing'; import { ActivatedRouteSnapshot, Router } from '@angular/router'; import { of } from 'rxjs'; -import { Customer, OtpState } from 'vitamui-library'; +import { Customer } from 'vitamui-library'; +import { OtpState } from 'vitamui-library'; import { CustomerService } from '../core/customer.service'; import { CustomerResolver } from './customer-resolver.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts index eccdb309a85..3caa58801a4 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts @@ -37,7 +37,8 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { EMPTY, of } from 'rxjs'; -import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { MatDialog } from '@angular/material/dialog'; @@ -68,7 +69,7 @@ let page: Page; @Component({ selector: 'app-customer-list', template: '', - standalone: false, + imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], }) class CustomerListStubComponent { search() {} @@ -77,7 +78,7 @@ class CustomerListStubComponent { @Component({ selector: 'app-customer-preview', template: '', - standalone: false, + imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], }) class CustomerPreviewStubComponent { @Input() @@ -91,7 +92,7 @@ class CustomerPreviewStubComponent { @Component({ selector: 'app-owner-preview', template: '', - standalone: false, + imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], }) class OwnerPreviewStubComponent { @Input() @@ -114,8 +115,18 @@ describe('CustomerComponent', () => { matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot()], - declarations: [CustomerComponent, CustomerListStubComponent, CustomerPreviewStubComponent, OwnerPreviewStubComponent], + imports: [ + MatMenuModule, + MatSidenavModule, + NoopAnimationsModule, + VitamUICommonTestModule, + InjectorModule, + LoggerModule.forRoot(), + CustomerComponent, + CustomerListStubComponent, + CustomerPreviewStubComponent, + OwnerPreviewStubComponent, + ], providers: [ { provide: CustomerService, useValue: customerServiceSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts index 34088f17361..4fc34008c05 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts @@ -38,16 +38,38 @@ import { Component, OnInit, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { Customer, GlobalEventService, Owner, SidenavPage, Tenant } from 'vitamui-library'; +import { + Customer, + GlobalEventService, + Owner, + SidenavPage, + Tenant, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { CustomerService } from '../core/customer.service'; import { CustomerCreateComponent } from './customer-create/customer-create.component'; import { CustomerListComponent } from './customer-list/customer-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { CustomerPreviewComponent } from './customer-preview/customer-preview.component'; +import { OwnerPreviewComponent } from './owner-preview/owner-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-customer', templateUrl: './customer.component.html', styleUrls: ['./customer.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + CustomerPreviewComponent, + OwnerPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + CustomerListComponent, + TranslatePipe, + ], }) export class CustomerComponent extends SidenavPage implements OnInit { private dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.module.ts index 9a7da4a1437..35d20b492f4 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.module.ts @@ -41,36 +41,25 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../shared/shared.module'; -import { CustomerCreateModule } from './customer-create/customer-create.module'; -import { CustomerListModule } from './customer-list/customer-list.module'; -import { CustomerPreviewModule } from './customer-preview/customer-preview.module'; + import { CustomerPopupComponent } from './customer-preview/customer-popup.component'; import { CustomerRoutingModule } from './customer-routing.module'; import { CustomerComponent } from './customer.component'; -import { OwnerCreateModule } from './owner-create/owner-create.module'; -import { OwnerPreviewModule } from './owner-preview/owner-preview.module'; -import { TenantCreateModule } from './tenant-create/tenant-create.module'; + import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ imports: [ CommonModule, - SharedModule, VitamUICommonModule, - CustomerCreateModule, - CustomerListModule, - CustomerPreviewModule, MatDialogModule, MatMenuModule, - OwnerPreviewModule, - OwnerCreateModule, - TenantCreateModule, MatSidenavModule, CustomerRoutingModule, TranslatePipe, + CustomerComponent, + CustomerPopupComponent, ], - declarations: [CustomerComponent, CustomerPopupComponent], exports: [], }) export class CustomerModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts index 626e1c7988e..d86b28032bb 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts @@ -61,7 +61,7 @@ import { MatOptionModule } from '@angular/material/core'; multi: true, }, ], - standalone: false, + imports: [MatOptionModule, MatProgressBarModule, MatSelectModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], }) class OwnerFormStubComponent implements ControlValueAccessor { @Input() @@ -124,8 +124,16 @@ describe('OwnerCreateComponent', () => { }; await TestBed.configureTestingModule({ - imports: [MatOptionModule, MatProgressBarModule, MatSelectModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], - declarations: [OwnerCreateComponent, OwnerFormStubComponent], + imports: [ + MatOptionModule, + MatProgressBarModule, + MatSelectModule, + NoopAnimationsModule, + ReactiveFormsModule, + VitamUICommonTestModule, + OwnerCreateComponent, + OwnerFormStubComponent, + ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: { id: '42', name: 'OwnerName' } } }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts index 459c0737652..98a618f0b84 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts @@ -35,20 +35,48 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { concatMap, finalize, Observable, Subscription } from 'rxjs'; -import { ConfirmDialogService, Customer, Owner, Tenant } from 'vitamui-library'; +import { + ConfirmDialogService, + Customer, + Owner, + Tenant, + DialogHeaderComponent, + StepperComponent, + InputComponent, + SelectComponent, + PreviousStepComponent, +} from 'vitamui-library'; import { OwnerService } from '../owner.service'; import { TenantFormValidators } from '../tenant-create/tenant-form.validators'; import { TenantService } from '../tenant.service'; import { map, tap } from 'rxjs/operators'; +import { CdkStep, CdkStepperNext } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { OwnerFormComponent } from '../owner-form/owner-form.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-owner-create', templateUrl: './owner-create.component.html', styleUrls: ['./owner-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + StepperComponent, + CdkStep, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + OwnerFormComponent, + MatDialogActions, + CdkStepperNext, + InputComponent, + SelectComponent, + PreviousStepComponent, + TranslatePipe, + ], }) export class OwnerCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.module.ts deleted file mode 100644 index 83b7a2c4a1d..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.module.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { OwnerFormModule } from '../owner-form/owner-form.module'; -import { OwnerCreateComponent } from './owner-create.component'; -import { MatOptionModule } from '@angular/material/core'; -import { MatSelectModule } from '@angular/material/select'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatProgressBarModule, - ReactiveFormsModule, - OwnerFormModule, - VitamUICommonModule, - MatOptionModule, - MatSelectModule, - VitamUILibraryModule, - MatDialogModule, - TranslatePipe, - ], - declarations: [OwnerCreateComponent], -}) -export class OwnerCreateModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.spec.ts deleted file mode 100644 index 484dd3b2af1..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.spec.ts +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { EMPTY, of, timer } from 'rxjs'; -import { map } from 'rxjs/operators'; -import { BASE_URL, CountryService, LoggerModule, Owner, StartupService, WINDOW_LOCATION } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { OwnerService } from '../owner.service'; -import { OwnerFormComponent } from './owner-form.component'; -import { OwnerFormValidators } from './owner-form.validators'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -@Component({ - template: ` `, - standalone: false, -}) -class TesthostComponent { - owner: Owner = null; - customerId = '4242'; - @ViewChild(OwnerFormComponent, { static: false }) - ownerFormComponent: OwnerFormComponent; -} - -let testhost: TesthostComponent; -let fixture: ComponentFixture; - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('OwnerFormComponent', () => { - beforeEach(async () => { - const ownerServiceSpy = { - create: vi.fn().mockName('OwnerService.create').mockReturnValue(of({})), - }; - const ownerFormValidatorsSpy = { - uniqueCode: vi - .fn() - .mockName('OwnerFormValidators.uniqueCode') - .mockReturnValue(() => timer(10).pipe(map((): any => null))), - }; - - await TestBed.configureTestingModule({ - declarations: [OwnerFormComponent, TesthostComponent], - schemas: [NO_ERRORS_SCHEMA], - imports: [FormsModule, LoggerModule.forRoot(), MatSelectModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], - providers: [ - { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: OwnerService, useValue: ownerServiceSpy }, - { provide: OwnerFormValidators, useValue: ownerFormValidatorsSpy }, - { provide: StartupService, useValue: { getConfigNumberValue: () => 100 } }, - { provide: CountryService, useValue: { getAvailableCountries: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }) - .overrideComponent(OwnerFormComponent, { set: { template: '' } }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should set owner to null', () => { - expect(testhost.owner).toBe(null); - }); - - it('should set owner to a value', fakeAsync(() => { - const owner: Owner = { - id: null, - identifier: null, - customerId: '4242', - code: '43214345345', - name: 'Toto', - companyName: 'Toto & Co.', - address: { - street: 'Street name', - zipCode: '2134', - city: 'Paris', - country: 'FR', - }, - internalCode: null, - readonly: false, - }; - - testhost.ownerFormComponent.form.get('code').setValue(owner.code); - testhost.ownerFormComponent.form.get('name').setValue(owner.name); - testhost.ownerFormComponent.form.get('companyName').setValue(owner.companyName); - testhost.ownerFormComponent.form.get('address.street').setValue(owner.address.street); - testhost.ownerFormComponent.form.get('address.zipCode').setValue(owner.address.zipCode); - testhost.ownerFormComponent.form.get('address.city').setValue(owner.address.city); - testhost.ownerFormComponent.form.get('address.country').setValue(owner.address.country); - tick(10); - expect(testhost.owner).toEqual(owner); - })); - - it('should set owner to null when the form not valid', () => { - const owner: Owner = { - id: null, - identifier: null, - customerId: '4242', - code: 'invalid-code', - name: 'Toto', - companyName: 'Toto & Co.', - address: { - street: 'Street name', - zipCode: '2134', - city: 'Paris', - country: 'FR', - }, - readonly: false, - }; - - testhost.ownerFormComponent.form.get('code').setValue(owner.code); - testhost.ownerFormComponent.form.get('name').setValue(owner.name); - testhost.ownerFormComponent.form.get('companyName').setValue(owner.companyName); - testhost.ownerFormComponent.form.get('address.street').setValue(owner.address.street); - testhost.ownerFormComponent.form.get('address.zipCode').setValue(owner.address.zipCode); - testhost.ownerFormComponent.form.get('address.city').setValue(owner.address.city); - testhost.ownerFormComponent.form.get('address.country').setValue(owner.address.country); - expect(testhost.owner).toBe(null); - }); - - it('should set owner to null when the code is short ', () => { - const owner: Owner = { - id: null, - identifier: null, - customerId: '4242', - code: '135', //short code - name: 'Toto', - companyName: 'Toto & Co.', - address: { - street: 'Street name', - zipCode: '2134', - city: 'Paris', - country: 'FR', - }, - readonly: false, - }; - - testhost.ownerFormComponent.form.get('code').setValue(owner.code); - testhost.ownerFormComponent.form.get('name').setValue(owner.name); - testhost.ownerFormComponent.form.get('companyName').setValue(owner.companyName); - testhost.ownerFormComponent.form.get('address.street').setValue(owner.address.street); - testhost.ownerFormComponent.form.get('address.zipCode').setValue(owner.address.zipCode); - testhost.ownerFormComponent.form.get('address.city').setValue(owner.address.city); - testhost.ownerFormComponent.form.get('address.country').setValue(owner.address.country); - expect(testhost.owner).toBe(null); - }); - - it('should update the customerId', () => { - testhost.customerId = '5050505050'; - fixture.detectChanges(); - expect(testhost.ownerFormComponent.form.value.customerId).toBe(testhost.customerId); - }); - - it('should emit a value when the status changes', fakeAsync(() => { - const owner: Owner = { - id: null, - identifier: null, - customerId: '4242', - code: '43214345345', - name: 'Toto', - companyName: 'Toto & Co.', - address: { - street: 'Street name', - zipCode: '2134', - city: 'Paris', - country: 'FR', - }, - internalCode: null, - readonly: false, - }; - - testhost.ownerFormComponent.form.get('code').setValue(owner.code); - testhost.ownerFormComponent.form.get('name').setValue(owner.name); - testhost.ownerFormComponent.form.get('companyName').setValue(owner.companyName); - testhost.ownerFormComponent.form.get('address.street').setValue(owner.address.street); - testhost.ownerFormComponent.form.get('address.zipCode').setValue(owner.address.zipCode); - testhost.ownerFormComponent.form.get('address.city').setValue(owner.address.city); - testhost.ownerFormComponent.form.get('address.country').setValue(owner.address.country); - expect(testhost.ownerFormComponent.form.valid).toBe(false); - expect(testhost.owner).toBe(null); - tick(10); - expect(testhost.ownerFormComponent.form.valid).toBe(true); - expect(testhost.owner).toEqual(owner); - })); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts index a5e084ffcb3..3dd8784bcf2 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts @@ -35,11 +35,11 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, forwardRef, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Validators } from '@angular/forms'; +import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule } from '@angular/forms'; import { merge } from 'rxjs'; import { distinctUntilChanged, map } from 'rxjs/operators'; -import type { CountryOption, Customer, Owner } from 'vitamui-library'; -import { CountryService, Option, StartupService } from 'vitamui-library'; +import { CountryOption, Customer, Owner, CountryService, Option, StartupService } from 'vitamui-library'; +import { InputComponent, SelectComponent } from 'vitamui-library'; import { ALPHA_NUMERIC_REGEX, OWNER_CITY_MAX_LENGTH, @@ -51,6 +51,7 @@ import { OWNER_ZIP_CODE_MAX_LENGTH, OwnerFormValidators, } from './owner-form.validators'; +import { TranslatePipe } from '@ngx-translate/core'; export const OWNER_FORM_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -64,7 +65,7 @@ export const OWNER_FORM_VALUE_ACCESSOR: any = { templateUrl: './owner-form.component.html', styleUrls: ['./owner-form.component.scss'], providers: [OWNER_FORM_VALUE_ACCESSOR], - standalone: false, + imports: [ReactiveFormsModule, InputComponent, SelectComponent, TranslatePipe], }) export class OwnerFormComponent implements ControlValueAccessor, OnDestroy, OnInit { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.module.ts deleted file mode 100644 index 12fe3c1b2d5..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.module.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { OwnerFormComponent } from './owner-form.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatFormFieldModule, - MatSelectModule, - ReactiveFormsModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [OwnerFormComponent], - exports: [OwnerFormComponent], -}) -export class OwnerFormModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.spec.ts deleted file mode 100644 index 28bee6c7535..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.spec.ts +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatDividerModule } from '@angular/material/divider'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { EMPTY, of, Subject } from 'rxjs'; -import { BASE_URL, CountryService, LoggerModule, Owner, SnackBarService, StartupService, Tenant, WINDOW_LOCATION } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { OwnerFormValidators } from '../../owner-form/owner-form.validators'; -import { OwnerService } from '../../owner.service'; -import { TenantFormValidators } from '../../tenant-create/tenant-form.validators'; -import { TenantService } from '../../tenant.service'; -import { InformationTabComponent } from './information-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -const expectedOwner: Owner = { - id: '5ad5f14c894e6a414edc7b63', - identifier: '1', - customerId: '42', - name: 'Julien Cornille', - code: '10234665', - companyName: 'vitamui', - address: { - street: '73 rue du Faubourg Poissonnière ', - zipCode: '75009', - city: 'Paris', - country: 'France', - }, - internalCode: '1', - readonly: false, -}; - -const expectedTenant: Tenant = { - id: '5ad5f14c894e6a414edc7b61adad48f0b8124fcda07b0ec1886c8d5d61c8f713', - ownerId: '5ad5f14c894e6a414edc7b62', - customerId: '42', - name: 'Emmanuel Deviller', - identifier: 7, - enabled: true, - proof: true, - readonly: false, - accessContractHoldingIdentifier: 'AC-000001', - accessContractLogbookIdentifier: 'AC-000002', - ingestContractHoldingIdentifier: 'IC-000001', - itemIngestContractIdentifier: 'IC-000001', -}; - -const owner = { - id: '5ad5f14c894e6a414edc7b62', - identifier: '5ad5f14c894e6a414edc7b62', - customerId: '42', - name: 'Emmanuel Deviller', - code: '10234501', - companyName: 'vitamui', - address: { - street: '73 rue du Faubourg Poissonnière ', - zipCode: '75009', - city: 'Paris', - country: 'France', - }, - internalCode: '1', - readonly: false, -}; - -@Component({ - template: ` `, - standalone: false, -}) -class TestHostComponent { - tenant: Tenant; - owner: Owner; - readonly = false; - - @ViewChild(InformationTabComponent, { static: false }) - component: InformationTabComponent; -} - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('Owner InformationTabComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - const ownerServiceSpy = { - get: () => of(owner), - patch: () => of(owner), - updated: new Subject(), - }; - const ownerFormValidatorsSpy = { - uniqueCode: vi - .fn() - .mockName('OwnerFormValidators.uniqueCode') - .mockReturnValue(() => of(null)), - }; - const tenantFormValidatorsSpy = { - uniqueName: vi - .fn() - .mockName('TenantFormValidators.uniqueName') - .mockReturnValue(() => of(null)), - }; - - await TestBed.configureTestingModule({ - imports: [LoggerModule.forRoot(), MatDividerModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], - schemas: [NO_ERRORS_SCHEMA], - declarations: [TestHostComponent, InformationTabComponent], - providers: [ - { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: OwnerService, useValue: ownerServiceSpy }, - { provide: OwnerFormValidators, useValue: ownerFormValidatorsSpy }, - { provide: TenantFormValidators, useValue: tenantFormValidatorsSpy }, - { provide: TenantService, useValue: { patch: () => of(expectedTenant) } }, - { provide: StartupService, useValue: { getConfigNumberValue: () => 100 } }, - { provide: SnackBarService, useValue: { instant: () => EMPTY } }, - { provide: CountryService, useValue: { getAvailableCountries: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }) - .overrideComponent(InformationTabComponent, { set: { template: '' } }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('Owner Form', () => { - beforeEach(() => { - testhost.owner = expectedOwner; - fixture.detectChanges(); - }); - - it('should have the correct fields', () => { - expect(testhost.component.ownerForm.get('id')).toBeDefined(); - expect(testhost.component.ownerForm.get('customerId')).toBeDefined(); - expect(testhost.component.ownerForm.get('code')).toBeDefined(); - expect(testhost.component.ownerForm.get('name')).toBeDefined(); - expect(testhost.component.ownerForm.get('companyName')).toBeDefined(); - expect(testhost.component.ownerForm.get('address.street')).toBeDefined(); - expect(testhost.component.ownerForm.get('address.zipCode')).toBeDefined(); - expect(testhost.component.ownerForm.get('address.city')).toBeDefined(); - expect(testhost.component.ownerForm.get('address.country')).toBeDefined(); - }); - - it('should have the required validator', () => { - testhost.component.ownerForm.setValue({ - id: null, - identifier: null, - customerId: null, - code: null, - name: null, - companyName: null, - address: { - street: null, - zipCode: null, - city: null, - country: null, - }, - internalCode: null, - }); - expect(testhost.component.ownerForm.get('id').valid).toBeFalsy(); - expect(testhost.component.ownerForm.get('customerId').valid).toBeFalsy(); - expect(testhost.component.ownerForm.get('code').valid).toBeFalsy(); - expect(testhost.component.ownerForm.get('name').valid).toBeFalsy(); - expect(testhost.component.ownerForm.get('companyName').valid).toBeFalsy(); - expect(testhost.component.ownerForm.get('address.street').valid).toBeTruthy(); - expect(testhost.component.ownerForm.get('address.zipCode').valid).toBeTruthy(); - expect(testhost.component.ownerForm.get('address.city').valid).toBeTruthy(); - expect(testhost.component.ownerForm.get('address.country').valid).toBeTruthy(); - expect(testhost.component.ownerForm.get('internalCode').valid).toBeTruthy(); - }); - - it('should have the pattern validator', () => { - const codeControl = testhost.component.ownerForm.get('code'); - codeControl.setValue('a'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('123456a'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('aaaaaa'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('1234'); - expect(codeControl.valid).toBeTruthy(); - codeControl.setValue('1234_'); - expect(codeControl.valid).toBeFalsy(); - codeControl.setValue('1234_qzdqzdzqdzqd48d5zq41d5qz1d654'); - expect(codeControl.valid).toBeFalsy(); - }); - - it('should be valid and call patch()', () => { - testhost.component.ownerForm.setValue({ - id: expectedOwner.id, - identifier: expectedOwner.identifier, - customerId: expectedOwner.customerId, - code: expectedOwner.code, - name: expectedOwner.name, - companyName: expectedOwner.companyName, - address: { - street: expectedOwner.address.street, - zipCode: expectedOwner.address.zipCode, - city: expectedOwner.address.city, - country: expectedOwner.address.country, - }, - internalCode: expectedOwner.internalCode, - }); - expect(testhost.component.ownerForm.valid).toBeTruthy(); - }); - }); - - describe('Tenant Form', () => { - beforeEach(() => { - testhost.tenant = expectedTenant; - fixture.detectChanges(); - }); - - it('should have the correct fields', () => { - expect(testhost.component.tenantForm.get('id')).toBeDefined(); - expect(testhost.component.tenantForm.get('identifier')).toBeDefined(); - expect(testhost.component.tenantForm.get('customerId')).toBeDefined(); - expect(testhost.component.tenantForm.get('ownerId')).toBeDefined(); - expect(testhost.component.tenantForm.get('name')).toBeDefined(); - expect(testhost.component.tenantForm.get('enabled')).toBeDefined(); - }); - - it('should have the required validator', () => { - testhost.component.tenantForm.setValue({ - id: null, - customerId: null, - ownerId: null, - identifier: null, - name: null, - enabled: null, - ingestContractHoldingIdentifier: null, - itemIngestContractIdentifier: null, - accessContractHoldingIdentifier: null, - accessContractLogbookIdentifier: null, - }); - expect(testhost.component.tenantForm.get('id').valid).toBeFalsy(); - expect(testhost.component.tenantForm.get('customerId').valid).toBeFalsy(); - expect(testhost.component.tenantForm.get('ownerId').valid).toBeFalsy(); - expect(testhost.component.tenantForm.get('identifier').valid).toBeFalsy(); - expect(testhost.component.tenantForm.get('name').valid).toBeFalsy(); - expect(testhost.component.tenantForm.get('enabled').valid).toBeFalsy(); - }); - - it('should be valid and call patch()', () => { - testhost.component.tenantForm.setValue({ - id: expectedTenant.id, - ownerId: expectedTenant.ownerId, - customerId: expectedTenant.customerId, - identifier: expectedTenant.identifier, - name: expectedTenant.name, - enabled: expectedTenant.enabled, - ingestContractHoldingIdentifier: expectedTenant.ingestContractHoldingIdentifier, - itemIngestContractIdentifier: expectedTenant.itemIngestContractIdentifier, - accessContractHoldingIdentifier: expectedTenant.accessContractHoldingIdentifier, - accessContractLogbookIdentifier: expectedTenant.accessContractLogbookIdentifier, - }); - expect(testhost.component.tenantForm.valid).toBeTruthy(); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts index c74cb2e352e..1125a2a382b 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts @@ -35,17 +35,46 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { merge, of } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { CountryOption, Owner, Tenant } from 'vitamui-library'; -import { CountryService, diff, Option, StartupService } from 'vitamui-library'; +import { CountryOption, Owner, Tenant, CountryService, Option, StartupService } from 'vitamui-library'; +import { + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, + diff, + VitamUIFieldErrorComponent, + FormFieldValueWrapperComponent, + SelectComponent, +} from 'vitamui-library'; import { ALPHA_NUMERIC_REGEX, OWNER_CODE_MAX_LENGTH, OwnerFormValidators } from '../../owner-form/owner-form.validators'; import { OwnerService } from '../../owner.service'; import { TenantFormValidators } from '../../tenant-create/tenant-form.validators'; import { TenantService } from '../../tenant.service'; +import { MatDivider } from '@angular/material/divider'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const UPDATE_DEBOUNCE_TIME = 200; @@ -53,7 +82,37 @@ const UPDATE_DEBOUNCE_TIME = 200; selector: 'app-information-tab', templateUrl: './information-tab.component.html', styleUrls: ['./information-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + VitamUIFieldErrorComponent, + FormFieldValueWrapperComponent, + SelectComponent, + MatDivider, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class InformationTabComponent implements OnChanges, OnInit { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.spec.ts index 732e059ade6..e5b298caa16 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.spec.ts @@ -47,8 +47,7 @@ describe('OwnerOperationHistoryTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [VitamUICommonTestModule], - declarations: [OwnerOperationHistoryTabComponent], + imports: [VitamUICommonTestModule, OwnerOperationHistoryTabComponent], providers: [ { provide: AuthService, useValue: {} }, { provide: LogbookService, useValue: {} }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts index 25612f83e6c..faa14347668 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts @@ -36,13 +36,17 @@ */ import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; import { AuthService, HistoryEvent, LogbookService } from 'vitamui-library'; +import { HistoryEventsComponent, CollapseComponent } from 'vitamui-library'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; const EVENT_LIMIT = 100; @Component({ selector: 'app-owner-operation-history-tab', templateUrl: './owner-operation-history-tab.component.html', styleUrls: ['./owner-operation-history-tab.component.scss'], - standalone: false, + imports: [MatProgressSpinner, HistoryEventsComponent, TranslatePipe, CollapseComponent, CommonModule], }) export class OwnerOperationHistoryTabComponent implements OnChanges { private authService = inject(AuthService); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-popup.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-popup.component.ts index 7c46d979292..5cf1adaab4a 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-popup.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-popup.component.ts @@ -39,11 +39,12 @@ import { ActivatedRoute } from '@angular/router'; import { Owner, Tenant } from 'vitamui-library'; import { OwnerService } from '../owner.service'; +import { OwnerPreviewComponent } from './owner-preview.component'; @Component({ selector: 'app-owner-popup', template: '', - standalone: false, + imports: [OwnerPreviewComponent], }) export class OwnerPopupComponent { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 9a3e696ded2..316fb998770 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -43,7 +43,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateService } from '@ngx-translate/core'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ENVIRONMENT, LoggerModule, SnackBarService, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, SnackBarService, WINDOW_LOCATION } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../environments/environment'; @@ -53,7 +54,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' @Component({ selector: 'app-information-tab', template: '', - standalone: false, + imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule, VitamUICommonTestModule], }) export class InformationTabStubComponent { @Input() owner: any; @@ -67,9 +68,16 @@ describe('OwnerPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [OwnerPreviewComponent, InformationTabStubComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule, LoggerModule.forRoot(), VitamUICommonTestModule], + imports: [ + MatMenuModule, + MatTabsModule, + NoopAnimationsModule, + LoggerModule.forRoot(), + VitamUICommonTestModule, + OwnerPreviewComponent, + InformationTabStubComponent, + ], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts index f26512a5d04..bea8a512c7f 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts @@ -37,12 +37,32 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import type { Owner, Tenant } from 'vitamui-library'; +import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { InformationTabComponent } from './information-tab/information-tab.component'; +import { OwnerOperationHistoryTabComponent } from './owner-operation-history-tab/owner-operation-history-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-owner-preview', templateUrl: './owner-preview.component.html', styleUrls: ['./owner-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + InformationTabComponent, + OwnerOperationHistoryTabComponent, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class OwnerPreviewComponent { @Input() owner: Owner; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.module.ts deleted file mode 100644 index 680a7c872c4..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.module.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatMenuModule } from '@angular/material/menu'; - -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatTabsModule } from '@angular/material/tabs'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { InformationTabComponent } from './information-tab/information-tab.component'; -import { OwnerOperationHistoryTabComponent } from './owner-operation-history-tab/owner-operation-history-tab.component'; -import { OwnerPopupComponent } from './owner-popup.component'; -import { OwnerPreviewComponent } from './owner-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatDividerModule, - MatMenuModule, - MatProgressSpinnerModule, - MatTabsModule, - ReactiveFormsModule, - SharedModule, - TranslatePipe, - VitamUICommonModule, - VitamUILibraryModule, - ], - declarations: [OwnerPopupComponent, OwnerPreviewComponent, InformationTabComponent, OwnerOperationHistoryTabComponent], - exports: [OwnerPopupComponent, OwnerPreviewComponent], -}) -export class OwnerPreviewModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index 8953e7afdba..536830613e1 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -39,7 +39,8 @@ import { inject, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Type } from '@angular/core'; -import { BASE_URL, Owner, SnackBarService } from 'vitamui-library'; +import { BASE_URL, Owner } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; import { OwnerService } from './owner.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts index 5cb7e9b3168..7721ab1fe71 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts @@ -36,7 +36,8 @@ */ import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Operators, Owner, SnackBarService } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Owner, SnackBarService } from 'vitamui-library'; +import { Operators } from 'vitamui-library'; import { Injectable, inject } from '@angular/core'; import { OwnerApiService } from './owner-api.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts index fc298116ccc..f19713aba6d 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts @@ -74,9 +74,16 @@ describe('TenantCreateComponent', () => { }; await TestBed.configureTestingModule({ - imports: [MatSelectModule, MatOptionModule, MatProgressBarModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], + imports: [ + MatSelectModule, + MatOptionModule, + MatProgressBarModule, + NoopAnimationsModule, + ReactiveFormsModule, + VitamUICommonTestModule, + TenantCreateComponent, + ], schemas: [NO_ERRORS_SCHEMA], - declarations: [TenantCreateComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts index b270b1d9da4..7af9c844422 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts @@ -35,20 +35,32 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { ConfirmDialogService, Owner, Tenant } from 'vitamui-library'; +import { DialogHeaderComponent, InputComponent, SelectComponent } from 'vitamui-library'; import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { finalize, Subscription } from 'rxjs'; import { TenantService } from '../tenant.service'; import { TenantFormValidators } from './tenant-form.validators'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-tenant-create', templateUrl: './tenant-create.component.html', styleUrls: ['./tenant-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + InputComponent, + SelectComponent, + MatDialogActions, + TranslatePipe, + ], }) export class TenantCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.module.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.module.ts deleted file mode 100644 index d7c88f1ae6f..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.module.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { TenantCreateComponent } from './tenant-create.component'; -import { MatOptionModule } from '@angular/material/core'; -import { MatSelectModule } from '@angular/material/select'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatProgressBarModule, - ReactiveFormsModule, - VitamUICommonModule, - MatOptionModule, - MatSelectModule, - MatDialogModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [TenantCreateComponent], -}) -export class TenantCreateModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts index d6f25f34f88..ac92db40bd9 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Operators, Owner, SnackBarService, Tenant } from 'vitamui-library'; +import { BASE_URL, CriteriaSearchQuery, Owner, Tenant } from 'vitamui-library'; +import { Operators, SnackBarService } from 'vitamui-library'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts index b148ef64495..250053ed2b0 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts @@ -36,7 +36,8 @@ */ import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Operators, Tenant, SnackBarService } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Tenant, SnackBarService } from 'vitamui-library'; +import { Operators } from 'vitamui-library'; import { HttpParams } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts index c68117874dd..9ae3ef43adf 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts @@ -44,12 +44,13 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { CollapseModule, ConfirmDialogService } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { CollapseComponent } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileValidators } from '../external-param-profile.validators'; import { ExternalParamProfileCreateComponent } from './external-param-profile-create.component'; -import { DecimalPipe } from '@angular/common'; +import { DecimalPipe, CommonModule } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ExternalParamProfileCreateComponent', () => { @@ -78,17 +79,18 @@ describe('ExternalParamProfileCreateComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ExternalParamProfileCreateComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ BrowserAnimationsModule, - CollapseModule, FormsModule, MatButtonToggleModule, MatProgressBarModule, MatSelectModule, ReactiveFormsModule, VitamUICommonTestModule, + ExternalParamProfileCreateComponent, + CollapseComponent, + CommonModule, ], providers: [ DecimalPipe, diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts index 7e903b7f0fa..f5ba067b970 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts @@ -35,21 +35,51 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Observable, Subscription } from 'rxjs'; -import { ConfirmDialogService, ExternalParamProfile, Option } from 'vitamui-library'; +import { + ConfirmDialogService, + ExternalParamProfile, + Option, + DialogHeaderComponent, + StepperComponent, + SlideToggleComponent, + InputComponent, + SelectComponent, + NextStepComponent, + TooltipDirective, + PreviousStepComponent, +} from 'vitamui-library'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileValidators } from '../external-param-profile.validators'; import { map } from 'rxjs/operators'; -import { TranslateService } from '@ngx-translate/core'; -import { DecimalPipe } from '@angular/common'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { DecimalPipe, AsyncPipe } from '@angular/common'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; @Component({ selector: 'app-external-param-profile-create', templateUrl: './external-param-profile-create.component.html', styleUrls: ['./external-param-profile-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + SlideToggleComponent, + InputComponent, + SelectComponent, + MatDialogActions, + NextStepComponent, + TooltipDirective, + PreviousStepComponent, + AsyncPipe, + TranslatePipe, + ], }) export class ExternalParamProfileCreateComponent implements OnInit, OnDestroy { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index c8f80b38b71..77ca0e589ae 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -42,7 +42,8 @@ import { MatTabsModule } from '@angular/material/tabs'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of, Subject } from 'rxjs'; -import { AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { TestHostComponent } from '../../shared/domains-input/domains-input.component.spec'; import { ExternalParamProfileService } from '../external-param-profile.service'; @@ -52,7 +53,8 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' @Component({ selector: 'app-information-tab', template: '', - standalone: false, + standalone: true, + imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule], }) class InformationTabStubComponent { // @Input() profile: ExternalParamProfile; @@ -76,9 +78,16 @@ describe('ExternalParamProfilDetailComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [TestHostComponent, ExternalParamProfileDetailComponent, InformationTabStubComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule, LoggerModule.forRoot()], + imports: [ + MatMenuModule, + MatTabsModule, + NoopAnimationsModule, + LoggerModule.forRoot(), + TestHostComponent, + ExternalParamProfileDetailComponent, + InformationTabStubComponent, + ], providers: [ { provide: ExternalParamProfileService, useValue: { updated: new Subject() } }, { provide: AuthService, useValue: authServiceMock }, diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts index 460527d678a..8af770306ef 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts @@ -36,15 +36,36 @@ */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { Subscription } from 'rxjs'; -import type { ExternalParamProfile } from 'vitamui-library'; +import { ExternalParamProfile } from 'vitamui-library'; +import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { SharedService } from '../shared.service'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { InformationTabComponent } from './information-tab/information-tab.component'; +import { ThresholdsTabComponent } from './thresholds-tab/thresholds-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { ReactiveFormsModule } from '@angular/forms'; @Component({ selector: 'app-external-param-profile-detail', templateUrl: './external-param-profile-detail.component.html', styleUrls: ['./external-param-profile-detail.component.css'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + InformationTabComponent, + ThresholdsTabComponent, + OperationHistoryTabComponent, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class ExternalParamProfileDetailComponent implements OnInit, OnDestroy { private sharedService = inject(SharedService); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts index 1d8d327fc04..36194d44958 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts @@ -35,19 +35,77 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { of, skip, Subscription } from 'rxjs'; import { catchError, distinctUntilChanged, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEqual } from 'underscore'; -import type { ExternalParamProfile } from 'vitamui-library'; +import { ExternalParamProfile } from 'vitamui-library'; +import { + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, + SlideToggleComponent, + VitamUIFieldErrorComponent, + SelectComponent, +} from 'vitamui-library'; import { ExternalParamProfileService } from '../../external-param-profile.service'; import { ExternalParamProfileValidators } from '../../external-param-profile.validators'; +import { NgStyle, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; @Component({ selector: 'app-information-tab', templateUrl: './information-tab.component.html', styleUrls: ['./information-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + SlideToggleComponent, + NgStyle, + VitamUIFieldErrorComponent, + SelectComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class InformationTabComponent implements OnDestroy, OnInit, OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts index 8708a1b0191..2e12c2610c5 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts @@ -35,20 +35,20 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; import { extend, isEmpty } from 'underscore'; -import type { ExternalParamProfile } from 'vitamui-library'; -import { diff, Option } from 'vitamui-library'; +import { ExternalParamProfile, Option } from 'vitamui-library'; +import { diff, SlideToggleComponent, SelectComponent, TooltipDirective } from 'vitamui-library'; import { ExternalParamProfileService } from '../../external-param-profile.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { DecimalPipe } from '@angular/common'; @Component({ selector: 'app-thresholds-tab', templateUrl: './thresholds-tab.component.html', styleUrls: ['./thresholds-tab.component.css'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, SelectComponent, TooltipDirective, TranslatePipe], }) export class ThresholdsTabComponent implements OnDestroy, OnInit, OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts index 583ccbfb3b4..8237178d6f3 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts @@ -42,12 +42,13 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of, Subject } from 'rxjs'; -import { CollapseModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProfileValidators } from '../../hierarchy/profile.validators'; import { ProfileService } from '../../profile/profile.service'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileListComponent } from './external-param-profile-list.component'; +import { CollapseComponent } from 'vitamui-library'; +import { CommonModule } from '@angular/common'; const translations: any = { TEST: 'Mock translate test' }; @@ -80,8 +81,15 @@ describe('ExternalParamProfileListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, MatProgressBarModule, CollapseModule, MatButtonToggleModule, VitamUICommonTestModule], - declarations: [ExternalParamProfileListComponent], + imports: [ + ReactiveFormsModule, + MatProgressBarModule, + MatButtonToggleModule, + VitamUICommonTestModule, + ExternalParamProfileListComponent, + CollapseComponent, + CommonModule, + ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: ExternalParamProfileService, useValue: externalParamListServiceSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts index 1f51518f859..f1bdd265651 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts @@ -46,16 +46,21 @@ import { InfiniteScrollTable, PageRequest, Profile, + PipesModule, + InfiniteScrollDirective, } from 'vitamui-library'; import { ProfileService } from '../../profile/profile.service'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { SharedService } from '../shared.service'; +import { NgClass, DecimalPipe, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-external-param-profile-list', templateUrl: './external-param-profile-list.component.html', styleUrls: ['./external-param-profile-list.component.css'], - standalone: false, + imports: [NgClass, MatProgressSpinner, DecimalPipe, PipesModule, TranslatePipe, CommonModule, InfiniteScrollDirective], }) export class ExternalParamProfileListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { externalParamProfileServiceService: ExternalParamProfileService; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts index 94a42e3aebc..30abd66d07f 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule, SnackBarService } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { LoggerModule, SnackBarService } from 'vitamui-library'; import { ExternalParamProfileService } from './external-param-profile.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts index 4db90879cb3..9357e11e7cb 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts @@ -52,7 +52,6 @@ describe('ExternalParamProfileComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ExternalParamProfileComponent], imports: [ VitamUICommonTestModule, RouterTestingModule, @@ -62,6 +61,7 @@ describe('ExternalParamProfileComponent', () => { MatSidenavModule, MatDialogModule, MatMenuModule, + ExternalParamProfileComponent, ], providers: [{ provide: ExternalParamProfileService, useValue: {} }], schemas: [CUSTOM_ELEMENTS_SCHEMA], diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts index bba3ca6166b..2663b52fb04 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts @@ -37,15 +37,33 @@ import { Component, OnInit, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { ExternalParamProfile, GlobalEventService, SidenavPage } from 'vitamui-library'; +import { + ExternalParamProfile, + GlobalEventService, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { ExternalParamProfileCreateComponent } from './external-param-profile-create/external-param-profile-create.component'; import { ExternalParamProfileListComponent } from './external-param-profile-list/external-param-profile-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { ExternalParamProfileDetailComponent } from './external-param-profile-detail/external-param-profile-detail.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-external-param-profile', templateUrl: './external-param-profile.component.html', styleUrls: ['./external-param-profile.component.css'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + ExternalParamProfileDetailComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ExternalParamProfileListComponent, + TranslatePipe, + ], }) export class ExternalParamProfileComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts index bb8272a62ca..c4553149926 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts @@ -36,7 +36,7 @@ */ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatMenuModule } from '@angular/material/menu'; import { MatProgressBarModule } from '@angular/material/progress-bar'; @@ -44,9 +44,15 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; -import { LevelInputModule, RoleToggleModule, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../shared/shared.module'; -import { GroupAttributionModule } from '../user/group-attribution/group-attribution.module'; +import { + VitamUICommonModule, + VitamUILibraryModule, + RoleComponent, + RoleToggleComponent, + SlideToggleComponent, + LevelInputComponent, +} from 'vitamui-library'; + import { ExternalParamProfileCreateComponent } from './external-param-profile-create/external-param-profile-create.component'; import { ExternalParamProfileDetailComponent } from './external-param-profile-detail/external-param-profile-detail.component'; import { InformationTabComponent } from './external-param-profile-detail/information-tab/information-tab.component'; @@ -61,8 +67,6 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ CommonModule, ExternalParamProfileRoutingModule, - GroupAttributionModule, - LevelInputModule, MatButtonToggleModule, MatDialogModule, MatMenuModule, @@ -72,19 +76,20 @@ import { TranslatePipe } from '@ngx-translate/core'; MatSidenavModule, MatTabsModule, ReactiveFormsModule, - RoleToggleModule, - SharedModule, VitamUICommonModule, VitamUILibraryModule, TranslatePipe, - ], - declarations: [ ExternalParamProfileComponent, ExternalParamProfileListComponent, ExternalParamProfileCreateComponent, ExternalParamProfileDetailComponent, InformationTabComponent, ThresholdsTabComponent, + FormsModule, + RoleComponent, + RoleToggleComponent, + SlideToggleComponent, + LevelInputComponent, ], }) export class ExternalParamProfileModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts index 05b08fffcae..d3a6e17f5de 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts @@ -71,12 +71,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { EMPTY, of } from 'rxjs'; -import { AuthService, ConfirmDialogService, Group, LevelInputModule, ProfileService } from 'vitamui-library'; +import { AuthService, ConfirmDialogService, Group, ProfileService } from 'vitamui-library'; +import { LevelInputComponent } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { Component, forwardRef, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; +import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; @@ -84,6 +85,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { GroupService } from '../group.service'; import { GroupValidators } from '../group.validators'; import { GroupCreateComponent } from './group-create.component'; +import { CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-profiles-form', @@ -167,8 +170,18 @@ describe('GroupCreateComponent', () => { }; await TestBed.configureTestingModule({ - imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule, LevelInputModule], - declarations: [ProfilesFormStubComponent, UnitsFormStubComponent, GroupCreateComponent], + imports: [ + MatProgressBarModule, + ReactiveFormsModule, + NoopAnimationsModule, + VitamUICommonTestModule, + CommonModule, + FormsModule, + LevelInputComponent, + TranslatePipe, + GroupCreateComponent, + ], + declarations: [ProfilesFormStubComponent, UnitsFormStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts index fc062adf1c0..348d0b4a1af 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts @@ -35,19 +35,55 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { AuthService, buildValidators, ConfirmDialogService, MiscValidators } from 'vitamui-library'; +import { + AuthService, + buildValidators, + ConfirmDialogService, + MiscValidators, + DialogHeaderComponent, + StepperComponent, + SlideToggleComponent, + InputComponent, + NextStepComponent, + PreviousStepComponent, + LevelInputComponent, +} from 'vitamui-library'; import { GroupService } from '../group.service'; import { GroupValidators } from '../group.validators'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { ProfilesFormComponent } from '../../shared/profiles-form/profiles-form.component'; +import { UnitsFormComponent } from '../units-form/units-form.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-group-create', templateUrl: './group-create.component.html', styleUrls: ['./group-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + SlideToggleComponent, + InputComponent, + MatDialogActions, + NextStepComponent, + ProfilesFormComponent, + PreviousStepComponent, + UnitsFormComponent, + TranslatePipe, + CommonModule, + FormsModule, + LevelInputComponent, + ], }) export class GroupCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.module.ts b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.module.ts deleted file mode 100644 index 021f0956e0d..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.module.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { UnitsFormModule } from '../units-form/units-form.module'; -import { GroupCreateComponent } from './group-create.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatDialogModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - SharedModule, - UnitsFormModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [GroupCreateComponent], -}) -export class GroupCreateModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts index 636e667c75d..f5a0dc4e445 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { buildCriteriaFromFilters, CriteriaSearchQuery, Criterion, Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion } from 'vitamui-library'; +import { buildCriteriaFromFilters, Operators } from 'vitamui-library'; const GROUP_FILTER_CONVERTER: Readonly<{ [key: string]: (values: any[]) => Array }> = { status: (statusList: string[]): Criterion[] => { diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts index ddbb974ce7e..211f2f30012 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts @@ -43,7 +43,8 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of, Subject } from 'rxjs'; -import { Group, OrderByButtonComponent } from 'vitamui-library'; +import { Group } from 'vitamui-library'; +import { OrderByButtonComponent } from 'vitamui-library'; import { InfiniteScrollStubDirective, VitamUICommonTestModule } from 'vitamui-library/testing'; import { GroupService } from '../group.service'; import { GroupListComponent } from './group-list.component'; @@ -154,8 +155,7 @@ describe('GroupListComponent', () => { matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - imports: [MatProgressSpinnerModule, NoopAnimationsModule, VitamUICommonTestModule, OrderByButtonComponent], - declarations: [GroupListComponent], + imports: [MatProgressSpinnerModule, NoopAnimationsModule, VitamUICommonTestModule, OrderByButtonComponent, GroupListComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ { provide: GroupService, useValue: groupListServiceSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts index 211420ee4a0..0422924f5cd 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts @@ -45,15 +45,39 @@ import { Group, InfiniteScrollTable, PageRequest, + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + OrderByButtonComponent, + TableFilterSearchComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, } from 'vitamui-library'; import { GroupService } from '../group.service'; import { buildCriteriaFromGroupFilters } from './group-criteria-builder.util'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-group-list', templateUrl: './group-list.component.html', styleUrls: ['./group-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + OrderByButtonComponent, + TableFilterSearchComponent, + NgClass, + MatProgressSpinner, + PipesModule, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class GroupListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { groupService: GroupService; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.module.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.module.ts deleted file mode 100644 index e26c43dba56..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.module.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatRippleModule } from '@angular/material/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { RouterModule } from '@angular/router'; - -import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { GroupListComponent } from './group-list.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, SharedModule, RouterModule, MatRippleModule, MatProgressSpinnerModule, VitamUICommonModule, TranslatePipe], - declarations: [GroupListComponent], - exports: [GroupListComponent], -}) -export class GroupListModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-popup.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-popup.component.ts index fc09b488193..c614943c2be 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-popup.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-popup.component.ts @@ -38,11 +38,12 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Group } from 'vitamui-library'; +import { GroupPreviewComponent } from './group-preview.component'; @Component({ selector: 'app-group-popup', template: '', - standalone: false, + imports: [GroupPreviewComponent], }) export class GroupPopupComponent { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts index a1e0272bcef..75a49047121 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts @@ -37,15 +37,42 @@ import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, inject } from '@angular/core'; import { Subscription } from 'rxjs'; import type { Group } from 'vitamui-library'; -import { AuthService, isLevelAllowed } from 'vitamui-library'; +import { + AuthService, + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, + isLevelAllowed, + OperationHistoryTabComponent, +} from 'vitamui-library'; import { GroupService } from '../group.service'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { InformationTabComponent } from './information-tab/information-tab.component'; +import { ProfilesTabComponent } from './profiles-tab/profiles-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-group-preview', templateUrl: './group-preview.component.html', styleUrls: ['./group-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + InformationTabComponent, + ProfilesTabComponent, + OperationHistoryTabComponent, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class GroupPreviewComponent implements OnInit, OnDestroy, OnChanges { private groupService = inject(GroupService); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.module.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.module.ts deleted file mode 100644 index a369ee52539..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.module.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { UnitsFormModule } from '../units-form/units-form.module'; -import { GroupPopupComponent } from './group-popup.component'; -import { GroupPreviewComponent } from './group-preview.component'; -import { InformationTabComponent } from './information-tab/information-tab.component'; -import { UnitsEditComponent } from './information-tab/units-edit/units-edit.component'; -import { ProfilesEditComponent } from './profiles-tab/profiles-edit/profiles-edit.component'; -import { ProfilesTabComponent } from './profiles-tab/profiles-tab.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatMenuModule, - MatProgressBarModule, - MatTabsModule, - ReactiveFormsModule, - RouterModule, - SharedModule, - UnitsFormModule, - VitamUICommonModule, - VitamUILibraryModule, - MatDialogModule, - TranslatePipe, - ], - declarations: [ - GroupPopupComponent, - GroupPreviewComponent, - InformationTabComponent, - ProfilesTabComponent, - ProfilesEditComponent, - UnitsEditComponent, - ], - exports: [GroupPreviewComponent], -}) -export class GroupPreviewModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.spec.ts deleted file mode 100644 index d4a06c4ef44..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.spec.ts +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; -import { EMPTY, of } from 'rxjs'; -import { AuthService, BASE_URL, CountryService, Group, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { GroupService } from '../../group.service'; -import { GroupValidators } from '../../group.validators'; -import { InformationTabComponent } from './information-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -let expectedGroup: Group; - -@Component({ - template: ` `, - standalone: false, -}) -class TestHostComponent { - group = expectedGroup; - readOnly = false; - - @ViewChild(InformationTabComponent, { static: false }) - component: InformationTabComponent; -} - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('Profile Group InformationTabComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - const groupServiceSpy = { - patch: vi.fn().mockName('GroupService.patch').mockReturnValue(of({})), - }; - const groupValidatorsSpy = { - nameExists: vi - .fn() - .mockName('GroupValidators.nameExists') - .mockReturnValue(() => of(null)), - }; - const authServiceMock = { user: { level: '' } }; - const matDialogSpy = { - open: vi.fn().mockName('MatDialog.open'), - }; - matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); - - beforeEach(async () => { - expectedGroup = { - id: '42', - enabled: true, - identifier: '1', - customerId: '4242442', - name: 'Group Name', - description: 'Group Description', - level: '', - usersCount: 0, - profileIds: [], - profiles: [], - units: [], - readonly: false, - }; - - await TestBed.configureTestingModule({ - declarations: [InformationTabComponent, TestHostComponent], - schemas: [NO_ERRORS_SCHEMA], - imports: [ReactiveFormsModule, VitamUICommonTestModule, LoggerModule.forRoot()], - providers: [ - { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: MatDialog, useValue: matDialogSpy }, - { provide: GroupService, useValue: groupServiceSpy }, - { provide: GroupValidators, useValue: groupValidatorsSpy }, - { provide: AuthService, useValue: authServiceMock }, - { provide: CountryService, useValue: { getAvailableCountries: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }) - .overrideComponent(InformationTabComponent, { set: { template: '' } }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('Class', () => { - it('should have the correct fields', () => { - expect(testhost.component.form.get('id')).not.toBeNull(); - expect(testhost.component.form.get('name')).not.toBeNull(); - expect(testhost.component.form.get('description')).not.toBeNull(); - }); - - it('should have the required validator', () => { - testhost.component.form.setValue({ - id: null, - identifier: null, - name: null, - level: null, - enabled: false, - description: null, - }); - expect(testhost.component.form.get('id').valid).toBeFalsy(); - expect(testhost.component.form.get('name').valid).toBeFalsy(); - expect(testhost.component.form.get('description').valid).toBeFalsy(); - }); - - it('should be valid and call patch()', () => { - testhost.component.form.setValue({ - id: expectedGroup.id, - identifier: expectedGroup.identifier, - enabled: expectedGroup.enabled, - name: expectedGroup.name, - level: '', - description: expectedGroup.description, - }); - expect(testhost.component.form.valid).toBeTruthy(); - }); - - it('should disable then enable the form', () => { - testhost.component.readOnly = true; - testhost.component.ngOnChanges({ - readOnly: { previousValue: false, currentValue: true, firstChange: false, isFirstChange: () => false }, - }); - expect(testhost.component.form.disabled).toBe(true); - testhost.component.readOnly = false; - testhost.component.ngOnChanges({ - readOnly: { previousValue: true, currentValue: false, firstChange: false, isFirstChange: () => false }, - }); - expect(testhost.component.form.disabled).toBe(false); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts index e7b3afe6e31..ad8fd330938 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts @@ -35,18 +35,46 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MatDialog } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { merge, of, Subscription } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { Group } from 'vitamui-library'; -import { AuthService, buildValidators, diff } from 'vitamui-library'; +import { Group, AuthService } from 'vitamui-library'; +import { + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, + buildValidators, + diff, + SlideToggleComponent, + TooltipDirective, + VitamUIFieldErrorComponent, +} from 'vitamui-library'; import { GroupService } from '../../group.service'; import { GroupValidators } from '../../group.validators'; import { UnitsEditComponent } from './units-edit/units-edit.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const DEBOUNCE_TIME = 200; @@ -54,7 +82,36 @@ const DEBOUNCE_TIME = 200; selector: 'app-information-tab', templateUrl: './information-tab.component.html', styleUrls: ['./information-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + SlideToggleComponent, + TooltipDirective, + VitamUIFieldErrorComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class InformationTabComponent implements OnDestroy, OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts index 888d679f0dc..aec849f1f42 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts @@ -58,7 +58,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' multi: true, }, ], - standalone: false, + imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule], }) class UnitsFormStubComponent { writeValue() {} @@ -78,9 +78,15 @@ describe('UnitsEditComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [UnitsEditComponent, UnitsFormStubComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [ + MatProgressBarModule, + ReactiveFormsModule, + NoopAnimationsModule, + VitamUICommonTestModule, + UnitsEditComponent, + UnitsFormStubComponent, + ], providers: [ { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', units: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts index 49d3f565be9..bb94d4412b1 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts @@ -38,18 +38,30 @@ import { Subscription } from 'rxjs'; import { take } from 'rxjs/operators'; import { ConfirmDialogService, Group } from 'vitamui-library'; +import { DialogHeaderComponent } from 'vitamui-library'; import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { GroupService } from '../../../group.service'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { UnitsFormComponent } from '../../../units-form/units-form.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-units-edit', templateUrl: './units-edit.component.html', styleUrls: ['./units-edit.component.css'], - standalone: false, + imports: [ + DialogHeaderComponent, + CdkScrollable, + MatDialogContent, + ReactiveFormsModule, + UnitsFormComponent, + MatDialogActions, + TranslatePipe, + ], }) export class UnitsEditComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts index 3e01f1aef64..eb19ab2e2f5 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts @@ -60,7 +60,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' multi: true, }, ], - standalone: false, + imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule], }) class ProfilesFormStubComponent { @Input() @@ -83,9 +83,15 @@ describe('ProfilesEditComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [ProfilesEditComponent, ProfilesFormStubComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [ + MatProgressBarModule, + ReactiveFormsModule, + NoopAnimationsModule, + VitamUICommonTestModule, + ProfilesEditComponent, + ProfilesFormStubComponent, + ], providers: [ { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', profileIds: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts index f721bc3d127..971f037bdaa 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts @@ -35,17 +35,29 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { ConfirmDialogService, Group } from 'vitamui-library'; +import { DialogHeaderComponent } from 'vitamui-library'; import { GroupService } from '../../../group.service'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { ProfilesFormComponent } from '../../../../shared/profiles-form/profiles-form.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-profiles-edit', templateUrl: './profiles-edit.component.html', styleUrls: ['./profiles-edit.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + ProfilesFormComponent, + MatDialogActions, + TranslatePipe, + ], }) export class ProfilesEditComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.spec.ts deleted file mode 100644 index a55738105f1..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.spec.ts +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { Component, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatDialog } from '@angular/material/dialog'; - -import { of, Subject } from 'rxjs'; -import { ApplicationService, Group } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { GroupService } from '../../group.service'; -import { ProfilesEditComponent } from './profiles-edit/profiles-edit.component'; -import { ProfilesTabComponent } from './profiles-tab.component'; - -@Component({ - template: ` `, - standalone: false, -}) -class TesthostComponent { - readOnly = false; - - group: Group = { - id: '1', - customerId: '42', - name: 'Profile Group Name', - level: 'level', - usersCount: 0, - description: 'Profile Group Description', - profileIds: [], - units: [], - profiles: [ - { - id: '1', - name: 'profile 1', - description: 'description 1', - applicationName: 'app 1', - level: 'level', - customerId: 'customerId', - groupsCount: 1, - enabled: true, - usersCount: 4, - tenantName: 'tenant 1', - tenantIdentifier: 1, - roles: [], - externalParamId: null, - readonly: false, - }, - { - id: '2', - name: 'profile 2', - description: 'description 2', - applicationName: 'app 1', - level: 'level', - customerId: 'customerId', - groupsCount: 1, - enabled: true, - usersCount: 4, - tenantName: 'tenant 2', - tenantIdentifier: 2, - roles: [], - externalParamId: null, - readonly: false, - }, - { - id: '3', - name: 'profile 3', - description: 'description 3', - applicationName: 'app 2', - level: 'level', - customerId: 'customerId', - groupsCount: 1, - enabled: true, - usersCount: 4, - tenantName: 'tenant 1', - tenantIdentifier: 1, - roles: [], - externalParamId: null, - readonly: false, - }, - ], - readonly: true, - }; -} - -const expectedApp = [ - { - id: 'CUSTOMERS_APP', - identifier: 'CUSTOMERS_APP', - name: 'Organisations', - url: '', - }, - { - id: 'ARCHIVE_APP', - identifier: 'ARCHIVE_APP', - name: 'Archives', - url: '', - }, - { - id: 'USERS_APP', - identifier: 'USERS_APP', - name: 'Utilisateurs', - url: '', - }, - { - id: 'GROUPS_APP', - identifier: 'GROUPS_APP', - name: 'Groupes de profils', - url: '', - }, - { - id: 'PROFILES_APP', - identifier: 'PROFILES_APP', - name: 'Profils APP Utilisateurs', - url: '', - }, -]; - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('ProfilesTabComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - const matDialogSpy = { - open: vi.fn().mockName('MatDialog.open'), - }; - matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [VitamUICommonTestModule], - declarations: [ProfilesTabComponent, TesthostComponent], - providers: [ - { provide: MatDialog, useValue: matDialogSpy }, - { provide: GroupService, useValue: { updated: new Subject() } }, - { provide: ApplicationService, useValue: { list: () => of(expectedApp), buildApplications: () => expectedApp } }, - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should open the profile edit dialog', () => { - const elButton = fixture.nativeElement.querySelector('button'); - const matDialog = TestBed.inject(MatDialog); - expect(elButton).toBeTruthy(); - expect(elButton.textContent).toContain('COMMON.UPDATE'); - elButton.click(); - expect(matDialog.open).toHaveBeenCalledWith(ProfilesEditComponent, { - data: { - group: testhost.group, - }, - autoFocus: false, - disableClose: true, - }); - }); - - it('should not show the edit button', () => { - testhost.readOnly = true; - fixture.detectChanges(false); - expect(testhost.readOnly).toBe(true); - }); - - it('should display a list of profiles', () => { - testhost.group = { - id: '1', - customerId: '42', - name: 'Profile Group Name', - usersCount: 0, - level: 'level', - description: 'Profile Group Description', - profileIds: [], - units: [], - profiles: [ - { - id: '1', - name: 'profile 1', - description: 'description 1', - applicationName: 'app 1', - level: 'level', - customerId: 'customerId', - groupsCount: 1, - enabled: true, - usersCount: 4, - tenantName: 'tenant 1', - tenantIdentifier: 2, - roles: [], - externalParamId: null, - readonly: false, - }, - { - id: '2', - name: 'profile 2', - description: 'description 2', - applicationName: 'app 1', - level: 'level', - customerId: 'customerId', - groupsCount: 1, - enabled: true, - usersCount: 4, - tenantName: 'tenant 2', - tenantIdentifier: 2, - roles: [], - externalParamId: null, - readonly: false, - }, - { - id: '3', - name: 'profile 3', - description: 'description 3', - applicationName: 'app 2', - level: 'level', - customerId: 'customerId', - groupsCount: 1, - enabled: true, - usersCount: 4, - tenantName: 'tenant 1', - tenantIdentifier: 2, - roles: [], - externalParamId: null, - readonly: false, - }, - ], - readonly: true, - }; - fixture.detectChanges(); - const elList = fixture.nativeElement.querySelector('.vitamui-profile-list'); - expect(elList).toBeTruthy(); - const elRows = fixture.nativeElement.querySelectorAll('.medium'); - expect(elRows.length).toBe(3); - testhost.group.profiles.forEach((profile: any, index: number) => { - const elDetails = elRows[index]; - expect(elDetails.textContent).toContain(profile.tenantName + ' : ' + profile.name); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts index ebc215153a2..a971bfe6367 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts @@ -37,15 +37,17 @@ import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import type { Group, Profile } from 'vitamui-library'; +import { Group, Profile } from 'vitamui-library'; +import { TooltipDirective } from 'vitamui-library'; import { GroupService } from '../../group.service'; import { ProfilesEditComponent } from './profiles-edit/profiles-edit.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-profiles-tab', templateUrl: './profiles-tab.component.html', styleUrls: ['./profiles-tab.component.scss'], - standalone: false, + imports: [TooltipDirective, TranslatePipe], }) export class ProfilesTabComponent implements OnInit, OnDestroy { private dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts index cd37023bfdc..18280d52dd9 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts @@ -38,8 +38,8 @@ import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { EMPTY, of } from 'rxjs'; -import { ENVIRONMENT, InjectorModule, LoggerModule, SearchBarComponent, SnackBarService } from 'vitamui-library'; -import type { Group } from 'vitamui-library'; +import { ENVIRONMENT, Group } from 'vitamui-library'; +import { InjectorModule, LoggerModule, SearchBarComponent, SnackBarService } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { MatDialog } from '@angular/material/dialog'; @@ -69,7 +69,7 @@ let page: Page; @Component({ selector: 'app-group-list', template: '', - standalone: false, + imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule, SearchBarComponent], }) class GroupListStubComponent { // eslint-disable-next-line @angular-eslint/no-input-rename @@ -82,7 +82,7 @@ class GroupListStubComponent { @Component({ selector: 'app-group-preview', template: '', - standalone: false, + imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule, SearchBarComponent], }) class GroupPreviewStubComponent { @Input() @@ -110,8 +110,10 @@ describe('GroupComponent', () => { InjectorModule, SearchBarComponent, LoggerModule.forRoot(), + GroupComponent, + GroupListStubComponent, + GroupPreviewStubComponent, ], - declarations: [GroupComponent, GroupListStubComponent, GroupPreviewStubComponent], providers: [ { provide: MatDialog, useValue: matDialogSpy }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group.component.ts index 67ef988947a..01bf8db5555 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.component.ts @@ -75,17 +75,36 @@ import { Component, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { GlobalEventService, Group, SidenavPage, SnackBarService } from 'vitamui-library'; +import { + GlobalEventService, + Group, + SidenavPage, + SnackBarService, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { GroupCreateComponent } from './group-create/group-create.component'; import { GroupListComponent } from './group-list/group-list.component'; import { DownloadSnackBarService } from 'projects/referential/src/app/core/service/download-snack-bar.service'; import { finalize } from 'rxjs/operators'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { GroupPreviewComponent } from './group-preview/group-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-group', templateUrl: './group.component.html', styleUrls: ['./group.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + GroupPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + GroupListComponent, + TranslatePipe, + ], }) export class GroupComponent extends SidenavPage { route: ActivatedRoute; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.module.ts b/ui/ui-frontend/projects/identity/src/app/group/group.module.ts index 3d05c58bb31..a23c2622136 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.module.ts @@ -42,28 +42,21 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../shared/shared.module'; -import { GroupCreateModule } from './group-create/group-create.module'; -import { GroupListModule } from './group-list/group-list.module'; -import { GroupPreviewModule } from './group-preview/group-preview.module'; + import { GroupRoutingModule } from './group-routing.module'; import { GroupComponent } from './group.component'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [GroupComponent], imports: [ CommonModule, VitamUICommonModule, - SharedModule, - GroupCreateModule, - GroupListModule, - GroupPreviewModule, MatDialogModule, MatMenuModule, MatSidenavModule, GroupRoutingModule, TranslatePipe, + GroupComponent, ], providers: [provideHttpClient(withInterceptorsFromDi())], }) diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts index 1fd1a71a000..edf6600ed21 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Direction, Group, Operators, PageRequest, SnackBarService } from 'vitamui-library'; +import { BASE_URL, CriteriaSearchQuery, Group } from 'vitamui-library'; +import { Direction, Operators, PageRequest, SnackBarService } from 'vitamui-library'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.ts index 3839c1d1511..114f9880c67 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.ts @@ -38,7 +38,8 @@ import { HttpParams } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Group, Operators, SearchService, SnackBarService } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Group, SearchService, SnackBarService } from 'vitamui-library'; +import { Operators } from 'vitamui-library'; import { GroupApiService } from '../core/api/group-api.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts b/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts index b7acff9f22f..a913b619aaf 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts @@ -35,8 +35,18 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, forwardRef, Input, OnInit, inject } from '@angular/core'; -import { AbstractControl, ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, ValidationErrors } from '@angular/forms'; +import { + AbstractControl, + ControlValueAccessor, + FormControl, + NG_VALUE_ACCESSOR, + ValidationErrors, + ReactiveFormsModule, +} from '@angular/forms'; import { GroupValidators } from '../group.validators'; +import { InputComponent, EllipsisDirective } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; export const UNITS_FORM_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -52,7 +62,7 @@ export const UNITS_FORM_VALUE_ACCESSOR: any = { templateUrl: './units-form.component.html', styleUrls: ['./units-form.component.scss'], providers: [UNITS_FORM_VALUE_ACCESSOR], - standalone: false, + imports: [InputComponent, ReactiveFormsModule, TranslatePipe, CommonModule, EllipsisDirective], }) export class UnitsFormComponent implements ControlValueAccessor, OnInit { private groupValidators = inject(GroupValidators); diff --git a/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.module.ts b/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.module.ts deleted file mode 100644 index 54cd4fa7a27..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatSelectModule } from '@angular/material/select'; -import { VitamUICommonModule } from 'vitamui-library'; -import { UnitsFormComponent } from './units-form.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, CommonModule, ReactiveFormsModule, MatSelectModule, VitamUICommonModule, TranslatePipe], - declarations: [UnitsFormComponent], - exports: [UnitsFormComponent], -}) -export class UnitsFormModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts index a12826cddc5..57acaf3665b 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts @@ -36,15 +36,18 @@ */ import { Component, forwardRef, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; +import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { AuthService, ConfirmDialogService, LevelInputModule } from 'vitamui-library'; +import { AuthService, ConfirmDialogService } from 'vitamui-library'; +import { LevelInputComponent } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { HierarchyService } from '../hierarchy.service'; import { HierarchyCreateComponent } from './hierarchy-create.component'; +import { CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-profiles-form', @@ -81,8 +84,18 @@ describe('HierarchyCreateComponent', () => { }; await TestBed.configureTestingModule({ - imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule, LevelInputModule], - declarations: [ProfilesFormStubComponent, HierarchyCreateComponent], + imports: [ + MatProgressBarModule, + ReactiveFormsModule, + NoopAnimationsModule, + VitamUICommonTestModule, + CommonModule, + FormsModule, + LevelInputComponent, + TranslatePipe, + HierarchyCreateComponent, + ], + declarations: [ProfilesFormStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { tenantId: 10 } }, diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts index dec1fd2ff3e..7826f725e69 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts @@ -35,17 +35,43 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Observable, Subscription, forkJoin } from 'rxjs'; -import { AuthService, ConfirmDialogService, CriteriaSearchQuery, Operators, Profile, buildValidators } from 'vitamui-library'; +import { + AuthService, + ConfirmDialogService, + CriteriaSearchQuery, + Operators, + Profile, + buildValidators, + DialogHeaderComponent, + SlideToggleComponent, + LevelInputComponent, +} from 'vitamui-library'; import { HierarchyService } from '../hierarchy.service'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { ProfilesFormComponent } from '../../shared/profiles-form/profiles-form.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-hierarchy-create', templateUrl: './hierarchy-create.component.html', styleUrls: ['./hierarchy-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + SlideToggleComponent, + ProfilesFormComponent, + MatDialogActions, + TranslatePipe, + CommonModule, + FormsModule, + LevelInputComponent, + ], }) export class HierarchyCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.module.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.module.ts deleted file mode 100644 index e7dfbabac50..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.module.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { HierarchyCreateComponent } from './hierarchy-create.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatDialogModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - SharedModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [HierarchyCreateComponent], - exports: [HierarchyCreateComponent], -}) -export class HierarchyCreateModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.spec.ts deleted file mode 100644 index 50fb6d2279e..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.spec.ts +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, Input, NO_ERRORS_SCHEMA, ViewChild, NgModule } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; -import { EMPTY, of, Subject } from 'rxjs'; -import { environment } from './../../../environments/environment'; - -import { AuthService, BASE_URL, ENVIRONMENT, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; -import type { Profile } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { HierarchyService } from '../hierarchy.service'; -import { HierarchyDetailComponent } from './hierarchy-detail.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -@Component({ - selector: 'app-information-tab', - template: '', - standalone: false, -}) -class InformationTabStubComponent { - @Input() profile: Profile; - @Input() readOnly: boolean; -} - -@Component({ - selector: 'app-side-panel', - template: ` `, - standalone: false, -}) -class SidePanelStubComponent { - @Input() popup: boolean; - @Input() popupUrl: string; -} - -@Component({ - template: '', - standalone: false, -}) -class TestHostComponent { - profile: any; - isPopup = false; - - @ViewChild(HierarchyDetailComponent, { static: false }) component: HierarchyDetailComponent; -} - -@NgModule({ declarations: [SidePanelStubComponent, TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('HierarchyDetailComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - const authServiceMock = { user: { level: '' } }; - - const expectedProfile = { - id: '42', - name: 'Profile Name', - description: 'description', - level: '', - groupsCount: 1, - applicationName: 'USERS_APP', - enabled: true, - usersCount: 0, - tenant: { - id: '42', - name: 'tenant name', - identifier: 754123, - owner: { - id: 'owner_id', - code: '745987', - name: 'Owner name', - companyName: 'The company name', - address: { - street: 'rue des bois', - zipCode: '75019', - city: 'Paris', - country: 'FRANCE', - }, - customerId: 'customer_id', - readonly: false, - }, - ownerId: 'owner_id', - customerId: 'customer_id', - enabled: true, - proof: false, - readonly: false, - }, - tenantIdentifier: '42', - roles: ['role_name'], - readonly: false, - }; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [TestHostComponent, HierarchyDetailComponent, SidePanelStubComponent, InformationTabStubComponent], - schemas: [NO_ERRORS_SCHEMA], - imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule, LoggerModule.forRoot(), VitamUICommonTestModule], - providers: [ - { provide: ActivatedRoute, useValue: { data: of({ isPopup: true, profile: expectedProfile }) } }, - { provide: HierarchyService, useValue: { updated: new Subject() } }, - { provide: AuthService, useValue: authServiceMock }, - { provide: WINDOW_LOCATION, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - testhost.profile = expectedProfile; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should have a header', () => { - const elTitle = fixture.nativeElement.querySelector('vitamui-common-sidenav-header'); - expect(elTitle).toBeTruthy(); - }); - - it('should have a mat-tab-group', () => { - const elTabGroup = fixture.nativeElement.querySelector('.mat-mdc-tab-group'); - expect(elTabGroup).toBeTruthy(); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts index bb7c6f5a36d..e4037139ca3 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts @@ -38,14 +38,39 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } fro import { Subscription } from 'rxjs'; import type { Profile } from 'vitamui-library'; -import { AuthService, isLevelAllowed } from 'vitamui-library'; +import { + AuthService, + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, + isLevelAllowed, + OperationHistoryTabComponent, +} from 'vitamui-library'; import { HierarchyService } from '../hierarchy.service'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { InformationTabComponent } from './information-tab/information-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-hierarchy-detail', templateUrl: './hierarchy-detail.component.html', styleUrls: ['./hierarchy-detail.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + InformationTabComponent, + OperationHistoryTabComponent, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class HierarchyDetailComponent implements OnInit, OnDestroy { private hierarchyService = inject(HierarchyService); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.spec.ts deleted file mode 100644 index 7ad45114378..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { HierarchyDetailModule } from './hierarchy-detail.module'; - -describe('HierarchyDetailModule', () => { - let hierarchyDetailModule: HierarchyDetailModule; - - beforeEach(() => { - hierarchyDetailModule = new HierarchyDetailModule(); - }); - - it('should create an instance', () => { - expect(hierarchyDetailModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.ts deleted file mode 100644 index d1434a73979..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.module.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; -import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { HierarchyDetailComponent } from './hierarchy-detail.component'; -import { HierarchyPopupComponent } from './hierarchy-popup.component'; -import { InformationTabComponent } from './information-tab/information-tab.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, SharedModule, MatMenuModule, MatTabsModule, ReactiveFormsModule, VitamUICommonModule, TranslatePipe], - declarations: [HierarchyPopupComponent, HierarchyDetailComponent, InformationTabComponent], - exports: [HierarchyDetailComponent], -}) -export class HierarchyDetailModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-popup.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-popup.component.ts index ac11ecc5441..1a3b67d707e 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-popup.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-popup.component.ts @@ -38,11 +38,12 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Profile } from 'vitamui-library'; +import { HierarchyDetailComponent } from './hierarchy-detail.component'; @Component({ selector: 'app-hierarchy-popup', template: '', - standalone: false, + imports: [HierarchyDetailComponent], }) export class HierarchyPopupComponent { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.spec.ts deleted file mode 100644 index 5ed05e13ed4..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.spec.ts +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { Component, forwardRef, Input, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import type { AsyncValidator, Validator } from '@angular/forms'; -import { of, Subject } from 'rxjs'; - -import { AuthService, CountryService } from 'vitamui-library'; -import type { Profile } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { HierarchyService } from '../../hierarchy.service'; -import { ProfileValidators } from '../../profile.validators'; -import { InformationTabComponent } from './information-tab.component'; - -@Component({ - selector: 'app-editable-textarea', - template: '{{value}}', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => EditableTextAreaStubComponent), - multi: true, - }, - ], - standalone: false, -}) -class EditableTextAreaStubComponent implements ControlValueAccessor { - @Input() - validator: Validator; - @Input() - asyncValidator: AsyncValidator; - value: string; - writeValue(value: string) { - this.value = value; - } - registerOnChange() {} - registerOnTouched() {} -} - -@Component({ - template: ` `, - standalone: false, -}) -class TestHostComponent { - profile: Profile = { - id: '1', - name: 'ProfileName', - description: 'Profile description...', - level: '', - customerId: 'customerId', - groupsCount: 1, - enabled: true, - usersCount: 42, - tenantName: 'tenant name', - tenantIdentifier: 420, - applicationName: 'CUSTOMERS_APP', - roles: [ - { - name: 'ROLE_MFA_USERS', - }, - { - name: 'ROLE_UPDATE_STANDARD_USERS', - }, - { - name: 'ROLE_GENERIC_USERS', - }, - ], - readonly: false, - externalParamId: null, - }; - readOnly = false; - - @ViewChild(InformationTabComponent, { static: false }) - component: InformationTabComponent; -} - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('Hierarchy InformationTabComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - const hierarchyServiceMock = { update: of({}), updated: new Subject() }; - const profileValidatorsSpy = { - nameExists: vi - .fn() - .mockName('ProfileValidators.nameExists') - .mockReturnValue(() => of(null)), - }; - const authServiceMock = { user: { level: '' } }; - - await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule], - schemas: [NO_ERRORS_SCHEMA], - declarations: [InformationTabComponent, TestHostComponent, EditableTextAreaStubComponent], - providers: [ - { provide: HierarchyService, useValue: hierarchyServiceMock }, - { provide: ProfileValidators, useValue: profileValidatorsSpy }, - { provide: AuthService, useValue: authServiceMock }, - { provide: CountryService, useValue: {} }, - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should have all the fields', () => { - let element = fixture.nativeElement.querySelector('vitamui-common-editable-input[formControlName=name]'); - expect(element).toBeTruthy(); - expect(element.textContent).toContain('ProfileName'); - expect(element.attributes.maxlength.value).toBe('100'); - - element = fixture.nativeElement.querySelector('vitamui-common-editable-textarea[formControlName=description]'); - expect(element).toBeTruthy(); - expect(element.textContent).toContain('Profile description...'); - expect(element.attributes.maxlength.value).toBe('250'); - - element = fixture.nativeElement.querySelector('vitamui-slide-toggle[formControlName=enabled]'); - expect(element).toBeTruthy(); - expect(element.textContent).toContain('HIERARCHY.INFORMATIONS.ACTIVE_SWITCH'); - }); - }); - - describe('Component', () => { - it('TODO', () => { - // TODO - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts index f9191032c90..651de9bc48a 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts @@ -35,15 +35,44 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { merge, of, Subscription } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { Profile } from 'vitamui-library'; -import { AuthService, buildValidators, diff } from 'vitamui-library'; +import { Profile, AuthService } from 'vitamui-library'; +import { + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, + buildValidators, + diff, + SlideToggleComponent, + TooltipDirective, + VitamUIFieldErrorComponent, +} from 'vitamui-library'; import { HierarchyService } from '../../hierarchy.service'; import { ProfileValidators } from '../../profile.validators'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const DEBOUNCE_TIME = 400; @@ -51,7 +80,36 @@ const DEBOUNCE_TIME = 400; selector: 'app-information-tab', templateUrl: './information-tab.component.html', styleUrls: ['./information-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + SlideToggleComponent, + TooltipDirective, + VitamUIFieldErrorComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class InformationTabComponent implements OnDestroy, OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.spec.ts index ae8c360ca96..401a5d907d3 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.spec.ts @@ -93,8 +93,7 @@ describe('HierarchyListComponent', () => { }; await TestBed.configureTestingModule({ - imports: [MatProgressSpinnerModule, VitamUICommonTestModule], - declarations: [HierarchyListComponent], + imports: [MatProgressSpinnerModule, VitamUICommonTestModule, HierarchyListComponent], providers: [ { provide: HierarchyService, useValue: hierarchyListServiceSpy }, { provide: Router, useValue: routerSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts index f505006f358..bafb31bcf0e 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts @@ -46,6 +46,9 @@ import { Operators, PageRequest, Profile, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, } from 'vitamui-library'; import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; @@ -53,6 +56,9 @@ import { ActivatedRoute } from '@angular/router'; import { DEFAULT_PAGE_SIZE } from '../../core/customer.service'; import { HierarchyService } from '../hierarchy.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -60,7 +66,7 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-hierarchy-list', templateUrl: './hierarchy-list.component.html', styleUrls: ['./hierarchy-list.component.scss'], - standalone: false, + imports: [NgClass, MatProgressSpinner, PipesModule, TranslatePipe, CommonModule, EllipsisDirective, InfiniteScrollDirective], }) export class HierarchyListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { hierarchyService: HierarchyService; diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.spec.ts deleted file mode 100644 index 9db09adebb9..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { HierarchyListModule } from './hierarchy-list.module'; - -describe('HierarchyListModule', () => { - let hierarchyListModule: HierarchyListModule; - - beforeEach(() => { - hierarchyListModule = new HierarchyListModule(); - }); - - it('should create an instance', () => { - expect(hierarchyListModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.ts deleted file mode 100644 index 283dbdb4776..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; - -import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { HierarchyListComponent } from './hierarchy-list.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, SharedModule, MatProgressSpinnerModule, VitamUICommonModule, TranslatePipe], - declarations: [HierarchyListComponent], - exports: [HierarchyListComponent], -}) -export class HierarchyListModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts index be55c3caf73..23ce00a1f7a 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts @@ -38,14 +38,27 @@ import { Component, OnInit, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { GlobalEventService, Profile, SidenavPage } from 'vitamui-library'; +import { VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent } from 'vitamui-library'; import { HierarchyCreateComponent } from './hierarchy-create/hierarchy-create.component'; import { HierarchyListComponent } from './hierarchy-list/hierarchy-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { HierarchyDetailComponent } from './hierarchy-detail/hierarchy-detail.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-hierarchy', templateUrl: './hierarchy.component.html', styleUrls: ['./hierarchy.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + HierarchyDetailComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + HierarchyListComponent, + TranslatePipe, + ], }) export class HierarchyComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.module.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.module.ts index 2106c275903..86f1e204057 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.module.ts @@ -42,10 +42,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../shared/shared.module'; -import { HierarchyCreateModule } from './hierarchy-create/hierarchy-create.module'; -import { HierarchyDetailModule } from './hierarchy-detail/hierarchy-detail.module'; -import { HierarchyListModule } from './hierarchy-list/hierarchy-list.module'; + import { HierarchyRoutingModule } from './hierarchy-routing.module'; import { HierarchyComponent } from './hierarchy.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -54,17 +51,13 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ CommonModule, VitamUICommonModule, - SharedModule, - HierarchyListModule, - HierarchyDetailModule, - HierarchyCreateModule, MatButtonToggleModule, MatProgressBarModule, ReactiveFormsModule, MatSidenavModule, HierarchyRoutingModule, TranslatePipe, + HierarchyComponent, ], - declarations: [HierarchyComponent], }) export class HierarchyModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts index c85134e7e58..896e9590d4e 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, SnackBarService } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts index 4384f71df7e..92824975142 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts @@ -35,21 +35,52 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Subscription } from 'rxjs'; -import { ApplicationId, AuthService, AuthUser, buildValidators, ConfirmDialogService, Profile, Role } from 'vitamui-library'; +import { + ApplicationId, + AuthService, + AuthUser, + buildValidators, + ConfirmDialogService, + Profile, + Role, + DialogHeaderComponent, + SlideToggleComponent, + InputComponent, + LevelInputComponent, + RoleComponent, + RoleToggleComponent, +} from 'vitamui-library'; import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { CustomerService } from '../../core/customer.service'; import { ProfileService } from '../profile.service'; import { ProfileValidators } from '../profile.validators'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-profile-create', templateUrl: './profile-create.component.html', styleUrls: ['./profile-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + SlideToggleComponent, + InputComponent, + MatDialogActions, + TranslatePipe, + CommonModule, + FormsModule, + LevelInputComponent, + RoleComponent, + RoleToggleComponent, + ], }) export class ProfileCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.module.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.module.ts deleted file mode 100644 index 6d239ebfeb7..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.module.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { RoleToggleModule, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { GroupAttributionModule } from '../../user/group-attribution/group-attribution.module'; -import { ProfileCreateComponent } from './profile-create.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - GroupAttributionModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - RoleToggleModule, - SharedModule, - VitamUICommonModule, - VitamUILibraryModule, - MatDialogModule, - TranslatePipe, - ], - declarations: [ProfileCreateComponent], -}) -export class ProfileCreateModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts index 39cf95130dd..98ff26f97af 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts @@ -35,22 +35,86 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { of, Subscription } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { AuthService, buildValidators, diff, Role } from 'vitamui-library'; -import type { Profile } from 'vitamui-library'; +import { + AuthService, + buildValidators, + diff, + Role, + SlideToggleComponent, + TooltipDirective, + VitamUIFieldErrorComponent, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + RoleComponent, + RoleToggleComponent, + SubLevelPipe, +} from 'vitamui-library'; +import { Profile } from 'vitamui-library'; import { ProfileService } from '../../profile.service'; import { ProfileValidators } from '../../profile.validators'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-information-tab', templateUrl: './information-tab.component.html', styleUrls: ['./information-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + SlideToggleComponent, + TooltipDirective, + VitamUIFieldErrorComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + RoleComponent, + RoleToggleComponent, + SubLevelPipe, + ], }) export class InformationTabComponent implements OnDestroy, OnInit, OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.spec.ts deleted file mode 100644 index 1c266cb0fed..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.spec.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { EMPTY, of, Subject } from 'rxjs'; -import { AuthService, BASE_URL, ENVIRONMENT, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; -import type { Profile } from 'vitamui-library'; -import { environment } from './../../../environments/environment'; - -import { Component, Input, NO_ERRORS_SCHEMA, ViewChild, NgModule } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; - -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { ProfileService } from '../profile.service'; -import { ProfileDetailComponent } from './profile-detail.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -@Component({ - selector: 'app-information-tab', - template: '', - standalone: false, -}) -class InformationTabStubComponent { - @Input() profile: Profile; - @Input() readOnly: boolean; -} - -@Component({ - selector: 'app-profile-group-tab', - template: '', - standalone: false, -}) -class ProfileGroupTabStubComponent { - @Input() profile: Profile; - @Input() readOnly: boolean; -} - -@Component({ - selector: 'app-side-panel', - template: ` `, - standalone: false, -}) -class SidePanelStubComponent { - @Input() popup: boolean; - @Input() popupUrl: string; -} - -@Component({ - template: '', - standalone: false, -}) -class TestHostComponent { - profile: any; - isPopup = false; - - @ViewChild(ProfileDetailComponent, { static: false }) component: ProfileDetailComponent; -} - -@NgModule({ declarations: [SidePanelStubComponent, TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('ProfileDetailComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - const authServiceMock = { user: { level: '' } }; - - const expectedProfile = { - id: '42', - name: 'Profile Name', - description: 'description', - level: '', - groupsCount: 0, - applicationName: 'USERS_APP', - enabled: true, - usersCount: 0, - tenant: { - id: '42', - name: 'tenant name', - identifier: 754123, - owner: { - id: 'owner_id', - code: '745987', - name: 'Owner name', - companyName: 'The company name', - address: { - street: 'rue des bois', - zipCode: '75019', - city: 'Paris', - country: 'FRANCE', - }, - customerId: 'customer_id', - readonly: false, - }, - ownerId: 'owner_id', - customerId: 'customer_id', - enabled: true, - proof: false, - readonly: false, - }, - tenantIdentifier: '42', - roles: ['role_name'], - readonly: false, - }; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [ - TestHostComponent, - ProfileDetailComponent, - SidePanelStubComponent, - InformationTabStubComponent, - ProfileGroupTabStubComponent, - ], - schemas: [NO_ERRORS_SCHEMA], - imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule, LoggerModule.forRoot(), VitamUICommonTestModule], - providers: [ - { provide: ActivatedRoute, useValue: { data: of({ isPopup: true, profile: expectedProfile }) } }, - { provide: ProfileService, useValue: { updated: new Subject() } }, - { provide: AuthService, useValue: authServiceMock }, - { provide: WINDOW_LOCATION, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - testhost.profile = expectedProfile; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should have a header', () => { - const elTitle = fixture.nativeElement.querySelector('vitamui-common-sidenav-header'); - expect(elTitle).toBeTruthy(); - }); - - it('should have a mat-tab-group', () => { - const elTabGroup = fixture.nativeElement.querySelector('.mat-mdc-tab-group'); - expect(elTabGroup).toBeTruthy(); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts index 7294e2e0a25..8d3354f1f71 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts @@ -36,16 +36,40 @@ */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { Subscription } from 'rxjs'; -import { AuthService, isLevelAllowed } from 'vitamui-library'; import type { Profile } from 'vitamui-library'; - +import { + AuthService, + isLevelAllowed, + OperationHistoryTabComponent, + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, +} from 'vitamui-library'; import { ProfileService } from '../profile.service'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { InformationTabComponent } from './information-tab/information-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-profile-detail', templateUrl: './profile-detail.component.html', styleUrls: ['./profile-detail.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + InformationTabComponent, + OperationHistoryTabComponent, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class ProfileDetailComponent implements OnInit, OnDestroy { private rngProfileService = inject(ProfileService); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.spec.ts deleted file mode 100644 index 9f7fa00a3c1..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { ProfileDetailModule } from './profile-detail.module'; - -describe('ProfileDetailModule', () => { - let profileDetailModule: ProfileDetailModule; - - beforeEach(() => { - profileDetailModule = new ProfileDetailModule(); - }); - - it('should create an instance', () => { - expect(profileDetailModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.ts deleted file mode 100644 index ea1a64fad35..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.module.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; - -import { RoleToggleModule, VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { InformationTabComponent } from './information-tab/information-tab.component'; -import { ProfileDetailComponent } from './profile-detail.component'; -import { ProfilePopupComponent } from './profile-popup.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - SharedModule, - MatMenuModule, - MatTabsModule, - ReactiveFormsModule, - VitamUICommonModule, - RoleToggleModule, - TranslatePipe, - ], - declarations: [ProfilePopupComponent, ProfileDetailComponent, InformationTabComponent], - exports: [ProfileDetailComponent], -}) -export class ProfileDetailModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-popup.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-popup.component.ts index 4766bd10f64..59cc03496c6 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-popup.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-popup.component.ts @@ -38,11 +38,12 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Profile } from 'vitamui-library'; +import { ProfileDetailComponent } from './profile-detail.component'; @Component({ selector: 'app-profile-popup', template: '', - standalone: false, + imports: [ProfileDetailComponent], }) export class ProfilePopupComponent { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts index 13d4719b5e6..4a922b58029 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts @@ -48,8 +48,14 @@ import { Operators, PageRequest, Profile, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, } from 'vitamui-library'; import { ProfileService } from '../profile.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -57,7 +63,7 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-profile-list', templateUrl: './profile-list.component.html', styleUrls: ['./profile-list.component.scss'], - standalone: false, + imports: [NgClass, MatProgressSpinner, PipesModule, TranslatePipe, CommonModule, EllipsisDirective, InfiniteScrollDirective], }) export class ProfileListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { rngProfileService: ProfileService; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.module.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.module.ts deleted file mode 100644 index 1fa02da7d1d..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; - -import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { ProfileListComponent } from './profile-list.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, SharedModule, MatProgressSpinnerModule, VitamUICommonModule, TranslatePipe], - declarations: [ProfileListComponent], - exports: [ProfileListComponent], -}) -export class ProfileListModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts index d9cdc211347..c702962b4ef 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts @@ -35,6 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { GlobalEventService, Profile, SidenavPage } from 'vitamui-library'; +import { VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent } from 'vitamui-library'; import { Component, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; @@ -42,12 +43,24 @@ import { ActivatedRoute } from '@angular/router'; import { ProfileCreateComponent } from './profile-create/profile-create.component'; import { ProfileListComponent } from './profile-list/profile-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { ProfileDetailComponent } from './profile-detail/profile-detail.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-profile', templateUrl: './profile.component.html', styleUrls: ['./profile.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + ProfileDetailComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ProfileListComponent, + TranslatePipe, + ], }) export class ProfileComponent extends SidenavPage { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts index 8222f322006..57045b4bd45 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts @@ -36,19 +36,14 @@ */ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatMenuModule } from '@angular/material/menu'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { LevelInputModule, VitamUICommonModule } from 'vitamui-library'; +import { VitamUICommonModule, LevelInputComponent } from 'vitamui-library'; -import { SharedModule } from '../shared/shared.module'; -import { GroupAttributionModule } from '../user/group-attribution/group-attribution.module'; -import { ProfileCreateModule } from './profile-create/profile-create.module'; -import { ProfileDetailModule } from './profile-detail/profile-detail.module'; -import { ProfileListModule } from './profile-list/profile-list.module'; import { ProfileRoutingModule } from './profile-routing.module'; import { ProfileComponent } from './profile.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -57,20 +52,16 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ CommonModule, VitamUICommonModule, - SharedModule, MatButtonToggleModule, MatMenuModule, - ProfileListModule, - ProfileDetailModule, MatProgressBarModule, ReactiveFormsModule, - ProfileCreateModule, - GroupAttributionModule, - LevelInputModule, MatSidenavModule, ProfileRoutingModule, TranslatePipe, + ProfileComponent, + FormsModule, + LevelInputComponent, ], - declarations: [ProfileComponent], }) export class ProfileModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts index 94c0e3236ec..0d675c5cddf 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts @@ -38,7 +38,8 @@ import { HttpTestingController, provideHttpClientTesting } from '@angular/common import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; -import { BASE_URL, Profile, SnackBarService } from 'vitamui-library'; +import { BASE_URL, Profile } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; import { ProfileService } from './profile.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts index f1f8bde004b..64403f239d4 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts @@ -36,8 +36,11 @@ */ import { ENTER } from '@angular/cdk/keycodes'; import { AfterContentInit, Component, ContentChildren, forwardRef, Input, QueryList } from '@angular/core'; -import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { VitamUIFieldErrorComponent } from 'vitamui-library'; +import { InputComponent } from 'vitamui-library'; +import { KeyValuePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; export const LIST_INPUT_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -50,7 +53,7 @@ export const LIST_INPUT_ACCESSOR: any = { templateUrl: './custom-params.component.html', styleUrls: ['./custom-params.component.scss'], providers: [LIST_INPUT_ACCESSOR], - standalone: false, + imports: [InputComponent, ReactiveFormsModule, KeyValuePipe, TranslatePipe], }) export class CustomParamsComponent implements AfterContentInit, ControlValueAccessor { @Input() keyPlaceholder: string; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.module.ts deleted file mode 100644 index d3972d07925..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { VitamUICommonModule } from 'vitamui-library'; -import { CustomParamsComponent } from './custom-params.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, ReactiveFormsModule, MatProgressSpinnerModule, VitamUICommonModule, TranslatePipe], - declarations: [CustomParamsComponent], - exports: [CustomParamsComponent], -}) -export class CustomParamsModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts index c0cffd973d0..33881976da8 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts @@ -46,7 +46,9 @@ import { DomainsInputComponent } from './domains-input.component'; @Component({ template: '', - standalone: false, + standalone: true, + imports: [DomainsInputComponent], + schemas: [NO_ERRORS_SCHEMA], }) export class TestHostComponent { @ViewChild(DomainsInputComponent, { static: false }) @@ -58,9 +60,6 @@ export class TestHostComponent { let testhost: TestHostComponent; let fixture: ComponentFixture; -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - describe('DomainsInputComponent', () => { beforeEach(async () => { const customerCreateValidatorsSpy = { @@ -68,8 +67,7 @@ describe('DomainsInputComponent', () => { }; await TestBed.configureTestingModule({ - imports: [FormsModule, ReactiveFormsModule, MatProgressSpinnerModule], - declarations: [TestHostComponent, DomainsInputComponent], + imports: [FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, DomainsInputComponent, TestHostComponent], providers: [{ provide: CustomerCreateValidators, useValue: customerCreateValidatorsSpy }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts index 8157ae25dde..edcc616b271 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts @@ -36,7 +36,9 @@ */ import { ENTER } from '@angular/cdk/keycodes'; import { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core'; -import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators } from '@angular/forms'; +import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; export const DOMAINS_INPUT_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -50,7 +52,7 @@ export const DOMAINS_INPUT_ACCESSOR: any = { templateUrl: './domains-input.component.html', styleUrls: ['./domains-input.component.scss'], providers: [DOMAINS_INPUT_ACCESSOR], - standalone: false, + imports: [ReactiveFormsModule, MatProgressSpinner, TranslatePipe], }) export class DomainsInputComponent implements ControlValueAccessor { @Input() placeholder: string; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.module.ts deleted file mode 100644 index 75bf83e67eb..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { VitamUICommonModule } from 'vitamui-library'; - -import { DomainsInputComponent } from './domains-input.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, ReactiveFormsModule, MatProgressSpinnerModule, VitamUICommonModule, TranslatePipe], - declarations: [DomainsInputComponent], - exports: [DomainsInputComponent], -}) -export class DomainsInputModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts index 170d4fe7b5e..088bd4615ac 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts @@ -35,8 +35,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, EventEmitter, forwardRef, Input, Output, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from 'vitamui-library'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CustomParamsComponent } from '../../custom-params/custom-params.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { KeyValuePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; export const EDITABLE_DOMAIN_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -50,7 +55,15 @@ export const EDITABLE_DOMAIN_INPUT_VALUE_ACCESSOR: any = { selector: 'editable-custom-params', templateUrl: './editable-custom-params.component.html', providers: [EDITABLE_DOMAIN_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [ + CdkOverlayOrigin, + CustomParamsComponent, + ReactiveFormsModule, + MatProgressSpinner, + CdkConnectedOverlay, + KeyValuePipe, + TranslatePipe, + ], }) export class EditableCustomParamsComponent extends EditableFieldComponent { array: any[] = []; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.spec.ts deleted file mode 100644 index e4131a604ff..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.spec.ts +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { of } from 'rxjs'; - -import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; -import { Component, EventEmitter, forwardRef, Input, NO_ERRORS_SCHEMA, Output, ViewChild, NgModule } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { CustomerCreateValidators } from '../../../customer/customer-create/customer-create.validators'; -import { EditableDomainInputComponent } from './editable-domain-input.component'; - -@Component({ - selector: 'app-domains-input', - template: '', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => DomainInputStubComponent), - multi: true, - }, - ], - standalone: false, -}) -class DomainInputStubComponent implements ControlValueAccessor { - @Input() - placeholder: string; - @Input() - selected: string; - @Input() - spinnerDiameter = 25; - - @Output() - selectedChange = new EventEmitter(); - - writeValue() {} - registerOnChange() {} - registerOnTouched() {} -} -@Component({ - template: ` - - `, - standalone: false, -}) -class TesthostComponent { - value: string[]; - defaultValue: string; - label = 'Test label'; - - @ViewChild(EditableDomainInputComponent, { static: false }) - component: EditableDomainInputComponent; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EditableDomainInputComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - let overlayContainerElement: HTMLElement; - - beforeEach(async () => { - const customerCreateValidatorsSpy = { - uniqueCode: vi - .fn() - .mockName('CustomerCreateValidators.uniqueCode') - .mockReturnValue(() => of(null)), - uniqueDomain: vi - .fn() - .mockName('CustomerCreateValidators.uniqueDomain') - .mockReturnValue(() => of(null)), - }; - - await TestBed.configureTestingModule({ - imports: [OverlayModule, FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, VitamUICommonTestModule], - declarations: [TesthostComponent, EditableDomainInputComponent, DomainInputStubComponent], - providers: [{ provide: CustomerCreateValidators, useValue: customerCreateValidatorsSpy }], - schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); - - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should call enterEditMode() on click', () => { - vi.spyOn(testhost.component, 'enterEditMode'); - const element = fixture.nativeElement.querySelector('.editable-field'); - element.click(); - expect(testhost.component.enterEditMode).toHaveBeenCalled(); - }); - - it('should display the label', () => { - const elLabel = fixture.nativeElement.querySelector('label'); - expect(elLabel.textContent).toContain('Test label'); - }); - - it('should display the list of domains', waitForAsync(() => { - testhost.value = ['test1.com', 'test2.com', 'test3.com']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - const elDomains = fixture.nativeElement.querySelectorAll( - '.editable-field .editable-field-content .editable-field-text-content > div', - ); - expect(elDomains.length).toBe(3); - expect(elDomains[0].textContent).toContain(testhost.value[0]); - expect(elDomains[1].textContent).toContain(testhost.value[1]); - expect(elDomains[2].textContent).toContain(testhost.value[2]); - }); - })); - - it('should display "SHARED.DOMAIN_INPUT.DEFAULT_DOMAIN" next to the selected domain', waitForAsync(() => { - testhost.value = ['test1.com', 'test2.com', 'test3.com', 'test4.com']; - testhost.defaultValue = testhost.value[1]; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - const elDomains = fixture.nativeElement.querySelectorAll( - '.editable-field .editable-field-content .editable-field-text-content > div', - ); - expect(elDomains.length).toBe(4); - expect(elDomains[1].textContent).toContain('SHARED.DOMAIN_INPUT.DEFAULT_DOMAIN'); - }); - })); - - it('should have a app-domains-input', () => { - const elDomainInput = fixture.nativeElement.querySelector('.editable-field-control > app-domains-input'); - expect(elDomainInput).toBeTruthy(); - }); - - it('should open then close the action buttons', () => { - testhost.component.enterEditMode(); - fixture.detectChanges(false); - expect(overlayContainerElement.querySelector('.editable-field-actions')).toBeTruthy(); - testhost.component.cancel(); - expect(testhost.component.editMode).toBe(false); - }); - - it('should have a confirm button', () => { - vi.spyOn(testhost.component, 'confirm'); - testhost.component.enterEditMode(); - testhost.component.control.markAsDirty(); - fixture.detectChanges(false); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-confirm') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.confirm).toHaveBeenCalled(); - }); - - it('should have a cancel button', () => { - vi.spyOn(testhost.component, 'cancel'); - testhost.component.enterEditMode(); - fixture.detectChanges(false); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-cancel') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.cancel).toHaveBeenCalled(); - }); - - it('should have a spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(true); - fixture.detectChanges(false); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeTruthy(); - }); - - it('should hide the spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(false); - fixture.detectChanges(false); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeFalsy(); - }); - }); - - describe('Class', () => { - it('should set the control value', waitForAsync(() => { - testhost.value = ['test1.com', 'test2.com']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toEqual(testhost.value); - }); - })); - - describe('canConfirm', () => { - it('should return true when the edit mode is active, the value has changed and is valid', () => { - testhost.component.editMode = true; - testhost.component.control.setValue(['test1.com', 'test2.com']); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return true when the edit mode is active, the selected value has changed and is valid', () => { - testhost.value = ['test1.com', 'test2.com']; - testhost.defaultValue = 'test1.com'; - fixture.detectChanges(); - testhost.component.editMode = true; - testhost.component.selected = 'test2.com'; - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return false if editMode is not active', () => { - testhost.component.editMode = false; - testhost.component.control.setValue(['test1.com', 'test2.com']); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pristine', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(['test1.com', 'test2.com']); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is invalid', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValidators(Validators.required); - testhost.component.control.setValue(null); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pending', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(['test1.com', 'test2.com']); - testhost.component.control.markAsDirty(); - testhost.component.control.markAsPending(); - expect(testhost.component.canConfirm).toBe(false); - }); - }); - - it('should emit a new value', waitForAsync(() => { - testhost.value = ['test1.com', 'test2.com']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue(['test1.com', 'test3.com', 'test4.com']); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual(['test1.com', 'test2.com']); - testhost.component.confirm(); - expect(testhost.value).toEqual(['test1.com', 'test3.com', 'test4.com']); - }); - })); - - it('should reverse the changes', waitForAsync(() => { - testhost.value = ['test1.com', 'test2.com']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue(['test1.com', 'test3.com', 'test4.com']); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual(['test1.com', 'test2.com']); - testhost.component.cancel(); - fixture.detectChanges(); - expect(testhost.value).toEqual(['test1.com', 'test2.com']); - expect(testhost.component.control.value).toEqual(['test1.com', 'test2.com']); - }); - })); - - it('should set the selected value', () => { - testhost.defaultValue = 'default.com'; - fixture.detectChanges(); - expect(testhost.component.defaultDomain).toBe('default.com'); - }); - - it('should emit a new selected value', () => { - testhost.value = ['test1.com', 'test2.com', 'default.com']; - testhost.defaultValue = 'default.com'; - fixture.detectChanges(); - expect(testhost.component.defaultDomain).toBe('default.com'); - testhost.component.enterEditMode(); - testhost.component.selected = 'test2.com'; - expect(testhost.defaultValue).toBe('default.com'); - testhost.component.confirm(); - expect(testhost.defaultValue).toBe('test2.com'); - }); - - it('should reverse the selected value', () => { - testhost.value = ['test1.com', 'test2.com', 'default.com']; - testhost.defaultValue = 'default.com'; - fixture.detectChanges(); - testhost.component.enterEditMode(); - expect(testhost.component.defaultDomain).toBe('default.com'); - testhost.component.selected = 'test2.com'; - testhost.component.cancel(); - expect(testhost.defaultValue).toBe('default.com'); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts index d249fb4b3f8..2809d329fc4 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts @@ -35,9 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, EventEmitter, forwardRef, Input, Output, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from 'vitamui-library'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { NgStyle } from '@angular/common'; +import { DomainsInputComponent } from '../../domains-input/domains-input.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; export const EDITABLE_DOMAIN_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -49,7 +54,7 @@ export const EDITABLE_DOMAIN_INPUT_VALUE_ACCESSOR: any = { selector: 'app-editable-domain-input', templateUrl: './editable-domain-input.component.html', providers: [EDITABLE_DOMAIN_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [CdkOverlayOrigin, NgStyle, DomainsInputComponent, ReactiveFormsModule, MatProgressSpinner, CdkConnectedOverlay, TranslatePipe], }) export class EditableDomainInputComponent extends EditableFieldComponent { @Input() diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts index 968c0432cb1..0bac057c454 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts @@ -34,40 +34,60 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { OverlayModule } from '@angular/cdk/overlay'; -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; +import { OverlayModule } from '@angular/cdk/overlay'; -import { LevelInputModule, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { CustomParamsModule } from '../custom-params/custom-params.module'; -import { DomainsInputModule } from '../domains-input/domains-input.module'; +import { VitamUICommonModule, VitamUILibraryModule, LevelInputComponent } from 'vitamui-library'; +import { CustomParamsComponent } from '../custom-params/custom-params.component'; +import { DomainsInputComponent } from '../domains-input/domains-input.component'; import { EditableCustomParamsComponent } from './editable-custom-params/editable-custom-params.component'; import { EditableDomainInputComponent } from './editable-domain-input/editable-domain-input.component'; import { EditableKeystoreComponent } from './editable-keystore/editable-keystore.component'; import { EditablePatternsComponent } from './editable-patterns/editable-patterns.component'; import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @NgModule({ imports: [ - CommonModule, - CustomParamsModule, - DomainsInputModule, + VitamUICommonModule, + VitamUILibraryModule, FormsModule, - LevelInputModule, + ReactiveFormsModule, MatButtonToggleModule, MatProgressSpinnerModule, MatSelectModule, OverlayModule, - ReactiveFormsModule, + TranslatePipe, + CustomParamsComponent, + DomainsInputComponent, + EditableDomainInputComponent, + EditablePatternsComponent, + EditableKeystoreComponent, + EditableCustomParamsComponent, + CommonModule, + LevelInputComponent, + ], + exports: [ + LevelInputComponent, VitamUICommonModule, VitamUILibraryModule, + FormsModule, + ReactiveFormsModule, + MatButtonToggleModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, TranslatePipe, + CustomParamsComponent, + DomainsInputComponent, + EditableDomainInputComponent, + EditablePatternsComponent, + EditableKeystoreComponent, + EditableCustomParamsComponent, ], - declarations: [EditableDomainInputComponent, EditablePatternsComponent, EditableKeystoreComponent, EditableCustomParamsComponent], - exports: [EditableDomainInputComponent, EditablePatternsComponent, EditableKeystoreComponent, EditableCustomParamsComponent], }) export class EditableFieldModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.spec.ts deleted file mode 100644 index 59b0b717634..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.spec.ts +++ /dev/null @@ -1,289 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; -import { Component, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { ReactiveFormsModule, Validators } from '@angular/forms'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of, throwError as observableThrowError } from 'rxjs'; - -import { AuthnRequestBindingEnum, IdentityProvider, newFile } from 'vitamui-library'; -import { input, VitamUICommonTestModule } from 'vitamui-library/testing'; -import { IdentityProviderService } from '../../../customer/customer-preview/sso-tab/identity-provider.service'; -import { EditableKeystoreComponent } from './editable-keystore.component'; - -@Component({ - template: ` `, - standalone: false, -}) -class TesthostComponent { - identityProvider: IdentityProvider = { - propagateLogout: false, - id: '1', - customerId: '2', - name: 'testIDP', - technicalName: 'Test IDP', - internal: false, - keystorePassword: null, - keystore: null, - idpMetadata: null, - patterns: ['test1.com', 'test2.com'], - enabled: true, - readonly: false, - authnRequestBinding: AuthnRequestBindingEnum.POST, - autoProvisioningEnabled: false, - authnRequestSigned: false, - maximumAuthenticationLifetime: 0, - wantsAssertionsSigned: false, - }; - disabled: boolean; - @ViewChild(EditableKeystoreComponent, { static: false }) - component: EditableKeystoreComponent; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EditableKeystoreComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - let overlayContainerElement: HTMLElement; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, OverlayModule, VitamUICommonTestModule, NoopAnimationsModule], - declarations: [TesthostComponent, EditableKeystoreComponent], - providers: [{ provide: IdentityProviderService, useValue: { updateKeystore: () => of(null) } }], - }).compileComponents(); - - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should call enterEditMode() on click', () => { - vi.spyOn(testhost.component, 'enterEditMode'); - const element = fixture.nativeElement.querySelector('.editable-field'); - element.click(); - expect(testhost.component.enterEditMode).toHaveBeenCalled(); - }); - - it('should open then close the action buttons', () => { - testhost.component.enterEditMode(); - fixture.detectChanges(false); - expect(testhost.component.editMode).toBe(true); - testhost.component.cancel(); - expect(testhost.component.editMode).toBe(false); - }); - - it('should have a confirm button', () => { - vi.spyOn(testhost.component, 'confirm'); - testhost.component.enterEditMode(); - testhost.component.file = newFile([''], 'test.jks'); - testhost.component.control.setValue('password1234'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(false); - const elButton = (overlayContainerElement.querySelector('.editable-field-actions button.editable-field-confirm') || - fixture.nativeElement.querySelector('.editable-field-actions button.editable-field-confirm')) as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.confirm).toHaveBeenCalled(); - }); - - it('should have a cancel button', () => { - vi.spyOn(testhost.component, 'cancel'); - testhost.component.enterEditMode(); - testhost.component.cancel(); - expect(testhost.component.cancel).toHaveBeenCalled(); - }); - - it('should have an input file', () => { - const elInput = fixture.nativeElement.querySelector('input[type=file]'); - expect(elInput).toBeTruthy(); - }); - - it('should have a password input', () => { - const elInput = fixture.nativeElement.querySelector('input[type=password]'); - expect(elInput).toBeTruthy(); - input(elInput, 'password1234'); - expect(testhost.component.control.value).toBe('password1234'); - }); - - it('should display the file name', waitForAsync(() => { - testhost.component.file = newFile([''], 'test.jks'); - testhost.component.editMode = true; - fixture.detectChanges(false); - const elFileName = fixture.nativeElement.querySelector('.vitamui-input-file-filename'); - expect(elFileName).toBeTruthy(); - expect(testhost.component.file.name).toBe('test.jks'); - })); - - it('should display the errors', () => { - testhost.component.control.setErrors({ badPassword: true }); - fixture.detectChanges(false); - expect(testhost.component.control.hasError('badPassword')).toBe(true); - }); - }); - - describe('Class', () => { - describe('canConfirm', () => { - it('should return true when the edit mode is active, the file and password are set', () => { - testhost.component.editMode = true; - testhost.component.file = newFile([''], 'test-file.txt'); - testhost.component.control.setValue('password'); - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return false if editMode is not active', () => { - testhost.component.editMode = false; - testhost.component.control.setValue(newFile([''], 'test-file.txt')); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pristine', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(newFile([''], 'test-file.txt')); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is invalid', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValidators(Validators.required); - testhost.component.control.setValue(null); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pending', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(newFile([''], 'test-file.txt')); - testhost.component.control.markAsDirty(); - testhost.component.control.markAsPending(); - expect(testhost.component.canConfirm).toBe(false); - }); - }); - - describe('setFile', () => { - it('should set the file', () => { - const expectedFile = newFile([''], 'test.jks'); - const mockFileList = { - item: () => expectedFile, - length: 1, - [Symbol.iterator]: function* () { - yield expectedFile; - }, - } as unknown as FileList; - testhost.component.setFile(mockFileList); - expect(testhost.component.file).toBe(expectedFile); - }); - }); - - describe('confirm', () => { - it('should call updateKeystore', () => { - const idpService = TestBed.inject(IdentityProviderService); - vi.spyOn(idpService, 'updateKeystore'); - testhost.component.editMode = true; - const expectedFile = newFile([''], 'test.jks'); - testhost.component.file = expectedFile; - testhost.component.control.setValue('password'); - testhost.component.confirm(); - expect(idpService.updateKeystore).toHaveBeenCalledWith(testhost.identityProvider.id, expectedFile, 'password'); - expect(testhost.component.editMode).toBe(false); - }); - - it('should not call updateKeystore', () => { - const idpService = TestBed.inject(IdentityProviderService); - vi.spyOn(idpService, 'updateKeystore'); - testhost.component.editMode = true; - const expectedFile = newFile([''], 'test.jks'); - testhost.component.file = expectedFile; - testhost.component.confirm(); - expect(idpService.updateKeystore).not.toHaveBeenCalled(); - testhost.component.file = null; - testhost.component.control.setValue('password'); - testhost.component.confirm(); - expect(idpService.updateKeystore).not.toHaveBeenCalled(); - }); - - it('should set the error', () => { - const idpService = TestBed.inject(IdentityProviderService); - vi.spyOn(idpService, 'updateKeystore').mockReturnValue(observableThrowError(null)); - testhost.component.editMode = true; - const expectedFile = newFile([''], 'test.jks'); - testhost.component.file = expectedFile; - testhost.component.control.setValue('password'); - testhost.component.confirm(); - expect(idpService.updateKeystore).toHaveBeenCalled(); - expect(testhost.component.control.errors).toEqual({ badPassword: true }); - }); - }); - - describe('cancel', () => { - it('should close the editMode', () => { - testhost.component.editMode = true; - testhost.component.cancel(); - expect(testhost.component.editMode).toBe(false); - }); - - it('should set the file to null', () => { - testhost.component.editMode = true; - testhost.component.file = newFile([''], 'test.jks'); - testhost.component.cancel(); - expect(testhost.component.file).toBeNull(); - }); - - it('should reset the password', () => { - testhost.component.editMode = true; - testhost.component.control.setValue('password'); - testhost.component.cancel(); - expect(testhost.component.control.value).toBeNull(); - }); - }); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts index 8130e5d7642..2b79c6dd4ad 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts @@ -34,18 +34,21 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { EditableFieldComponent, newFile } from 'vitamui-library'; -import type { IdentityProvider } from 'vitamui-library'; +import { EditableFieldComponent, IdentityProvider } from 'vitamui-library'; +import { newFile } from 'vitamui-library'; import { Component, ElementRef, Input, ViewChild, inject } from '@angular/core'; import { IdentityProviderService } from '../../../customer/customer-preview/sso-tab/identity-provider.service'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { ReactiveFormsModule } from '@angular/forms'; +import { TranslatePipe } from '@ngx-translate/core'; /*eslint no-use-before-define: "error"*/ @Component({ selector: 'app-editable-keystore', templateUrl: './editable-keystore.component.html', styleUrls: ['./editable-keystore.component.scss'], - standalone: false, + imports: [CdkOverlayOrigin, ReactiveFormsModule, CdkConnectedOverlay, TranslatePipe], }) export class EditableKeystoreComponent extends EditableFieldComponent { private identityProviderService = inject(IdentityProviderService); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.spec.ts deleted file mode 100644 index a77f02df596..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.spec.ts +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; -import { Component, forwardRef, Input, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelect } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { EditablePatternsComponent } from './editable-patterns.component'; - -@Component({ - selector: 'app-pattern', - template: '', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => PatternStubComponent), - multi: true, - }, - ], - standalone: false, -}) -class PatternStubComponent implements ControlValueAccessor { - @Input() - options: Array<{ - value: string; - disabled?: boolean; - }>; - @Input() - vitamuiMiniMode = false; - - @ViewChild('select', { static: true }) - select: MatSelect; - - writeValue() {} - registerOnChange() {} - registerOnTouched() {} -} - -@Component({ - template: ` `, - standalone: false, -}) -class TesthostComponent { - value: string[]; - options = [ - { value: 'test1.com', disabled: false }, - { value: 'test2.com', disabled: false }, - { value: 'test3.com', disabled: false }, - { value: 'test4.com', disabled: true }, - { value: 'test5.com', disabled: true }, - ]; - label = 'Test label'; - @ViewChild(EditablePatternsComponent, { static: false }) - component: EditablePatternsComponent; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EditablePatternsComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - let overlayContainerElement: HTMLElement; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [FormsModule, ReactiveFormsModule, OverlayModule, MatProgressSpinnerModule, NoopAnimationsModule, VitamUICommonTestModule], - declarations: [TesthostComponent, EditablePatternsComponent, PatternStubComponent], - }).compileComponents(); - - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should call enterEditMode() on click', () => { - vi.spyOn(testhost.component, 'enterEditMode'); - const element = fixture.nativeElement.querySelector('.editable-field'); - element.click(); - expect(testhost.component.enterEditMode).toHaveBeenCalled(); - }); - - it('should display the label', () => { - const elLabel = fixture.nativeElement.querySelector('label'); - expect(elLabel.textContent).toContain('Test label'); - }); - - it('should display the list of patterns', waitForAsync(() => { - testhost.value = ['test1.com', 'test3.com']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - const elPatterns = fixture.nativeElement.querySelectorAll( - '.editable-field .editable-field-content .editable-field-text-content > div', - ); - expect(elPatterns.length).toBe(2); - expect(elPatterns[0].textContent).toContain(testhost.value[0]); - expect(elPatterns[1].textContent).toContain(testhost.value[1]); - }); - })); - - it('should open then close the action buttons', () => { - testhost.component.enterEditMode(); - fixture.detectChanges(false); - expect(overlayContainerElement.querySelector('.editable-field-actions')).toBeTruthy(); - testhost.component.cancel(); - expect(testhost.component.editMode).toBe(false); - }); - - it('should have a confirm button', () => { - vi.spyOn(testhost.component, 'confirm'); - testhost.component.enterEditMode(); - testhost.component.control.setValue(['test1.com', 'test3.com']); - testhost.component.control.markAsDirty(); - fixture.detectChanges(false); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-confirm') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.confirm).toHaveBeenCalled(); - }); - - it('should have a cancel button', () => { - vi.spyOn(testhost.component, 'cancel'); - testhost.component.enterEditMode(); - fixture.detectChanges(false); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-cancel') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.cancel).toHaveBeenCalled(); - }); - - it('should have a spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(true); - fixture.detectChanges(false); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeTruthy(); - }); - - it('should hide the spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(false); - fixture.detectChanges(false); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeFalsy(); - }); - }); - - describe('Class', () => { - it('should set the control value', waitForAsync(() => { - testhost.value = ['test1.com', 'test3.com']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toBe(testhost.value); - }); - })); - - describe('canConfirm', () => { - it('should return true when the edit mode is active, the value has changed and is valid', () => { - testhost.component.editMode = true; - testhost.component.control.setValue(['test1.com', 'test3.com']); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return false if editMode is not active', () => { - testhost.component.editMode = false; - testhost.component.control.setValue(['test1.com', 'test3.com']); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pristine', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(['test1.com', 'test3.com']); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is invalid', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValidators(Validators.required); - testhost.component.control.setValue(null); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pending', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(['test1.com', 'test3.com']); - testhost.component.control.markAsDirty(); - testhost.component.control.markAsPending(); - expect(testhost.component.canConfirm).toBe(false); - }); - }); - - it('should emit a new value', waitForAsync(() => { - const originValue = ['test1.com', 'test3.com']; - const newValue = ['test2.com']; - testhost.value = originValue; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue(newValue); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual(originValue); - testhost.component.confirm(); - expect(testhost.value).toEqual(newValue); - }); - })); - - it('should reverse the changes', waitForAsync(() => { - const originValue = ['test1.com', 'test3.com']; - const newValue = ['test2.com']; - testhost.value = originValue; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue(newValue); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual(originValue); - testhost.component.cancel(); - fixture.detectChanges(); - expect(testhost.value).toEqual(originValue); - expect(testhost.component.control.value).toEqual(originValue); - }); - })); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts index 4b8432b6ba7..750644dfded 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts @@ -36,9 +36,12 @@ */ import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import { EditableFieldComponent, PatternComponent } from 'vitamui-library'; +import { EditableFieldComponent } from 'vitamui-library'; +import { PatternComponent } from 'vitamui-library'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; export const EDITABLE_PATTERNS_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -51,7 +54,7 @@ export const EDITABLE_PATTERNS_INPUT_VALUE_ACCESSOR: any = { selector: 'app-editable-patterns', templateUrl: './editable-patterns.component.html', providers: [EDITABLE_PATTERNS_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [CdkOverlayOrigin, PatternComponent, ReactiveFormsModule, MatProgressSpinner, CdkConnectedOverlay], }) export class EditablePatternsComponent extends EditableFieldComponent { private document = inject(DOCUMENT); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts deleted file mode 100644 index 30772a9c69a..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.spec.ts +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of } from 'rxjs'; -import { ApplicationApiService, ApplicationService, ProfileService, SelectComponent } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; - -import { ProfilesFormComponent } from './profiles-form.component'; - -const expectedProfiles = [ - { - id: '1', - name: 'profile 1', - description: 'description 1', - applicationName: 'CUSTOMERS_APP', - tenantIdentifier: 1, - tenantName: 'tenant 1', - tenant: { id: '11', name: 'tenant 1', identifier: 1 }, - }, - { - id: '2', - name: 'profile 2', - description: 'description 2', - applicationName: 'CUSTOMERS_APP', - tenantIdentifier: 2, - tenantName: 'tenant 2', - tenant: { id: '22', name: 'tenant 2', identifier: 2 }, - }, - { - id: '3', - name: 'profile 3', - description: 'description 3', - applicationName: 'USERS_APP', - tenantIdentifier: 1, - tenantName: 'tenant 1', - tenant: { id: '11', name: 'tenant 1', identifier: 1 }, - }, - { - id: '4', - name: 'profile 4', - description: 'description 4', - applicationName: 'GROUPS_APP', - tenantIdentifier: 3, - tenantName: 'tenant 3', - tenant: { id: '33', name: 'tenant 3', identifier: 3 }, - }, - { - id: '5', - name: 'profile 5', - description: 'description 5', - applicationName: 'PROFILES_APP', - tenantIdentifier: 4, - tenantName: 'tenant 4', - tenant: { id: '44', name: 'tenant 4', identifier: 4 }, - }, - { - id: '6', - name: 'profile 6', - description: 'description 6', - applicationName: 'CUSTOMERS_APP', - tenantIdentifier: 1, - tenantName: 'tenant 1', - tenant: { id: '11', name: 'tenant 1', identifier: 1 }, - }, -]; - -const expectedApp = [ - { - id: 'CUSTOMERS_APP', - identifier: 'CUSTOMERS_APP', - name: 'Organisations', - url: '', - }, - { - id: 'ARCHIVE_APP', - identifier: 'ARCHIVE_APP', - name: 'Archives', - url: '', - }, - { - id: 'USERS_APP', - identifier: 'USERS_APP', - name: 'Utilisateurs', - url: '', - }, - { - id: 'GROUPS_APP', - identifier: 'GROUPS_APP', - name: 'Groupes de profils', - url: '', - }, - { - id: 'PROFILES_APP', - identifier: 'PROFILES_APP', - name: 'Profils APP Utilisateurs', - url: '', - }, -]; - -@Component({ - template: ` `, - standalone: false, -}) -class TesthostComponent { - profiles: string[]; - - @ViewChild(ProfilesFormComponent, { static: false }) - component: ProfilesFormComponent; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('ProfilesFormComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ - FormsModule, - ReactiveFormsModule, - MatProgressSpinnerModule, - MatSelectModule, - NoopAnimationsModule, - VitamUICommonTestModule, - SelectComponent, - ], - declarations: [ProfilesFormComponent, TesthostComponent], - providers: [ - { provide: ProfileService, useValue: { list: () => of(expectedProfiles) } }, - { provide: ApplicationApiService, useValue: { listNames: () => of(expectedApp) } }, - { provide: ApplicationService, useValue: { list: () => of(expectedApp), buildApplications: () => expectedApp } }, - ], - schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should have 3 select inputs', () => { - const elInputs = fixture.nativeElement.querySelectorAll('vitamui-select'); - expect(elInputs.length).toBe(3); - }); - - it('should have an "Add" button', () => { - const elAddButton = fixture.nativeElement.querySelector('button[type=button]'); - expect(elAddButton).toBeTruthy(); - expect(elAddButton.textContent).toContain('COMMON.ADD'); - vi.spyOn(testhost.component, 'add'); - testhost.component.profileSelect.setValue(expectedProfiles[3].id); - fixture.detectChanges(); - elAddButton.click(); - expect(testhost.component.add).toHaveBeenCalled(); - }); - - it('should have a list of the profiles', () => { - testhost.component.profileIds = ['2', '5']; - fixture.detectChanges(); - const elHeaders = fixture.nativeElement.querySelectorAll('.vitamui-table-head'); - expect(elHeaders).toBeTruthy(); - - const elRows = fixture.nativeElement.querySelectorAll('.vitamui-row'); - expect(elRows.length).toBe(2); - const elCells = elRows[0].querySelectorAll('div'); - expect(elCells.length).toBe(4); - expect(elCells[0].textContent).toContain('Organisations'); - expect(elCells[1].textContent).toContain('tenant 2'); - expect(elCells[2].textContent).toContain('profile 2'); - const elDelButton = elCells[3].querySelector('button'); - expect(elDelButton).toBeTruthy(); - vi.spyOn(testhost.component, 'remove'); - elDelButton.click(); - expect(testhost.component.remove).toHaveBeenCalledWith(0); - }); - }); - - describe('Component', () => { - it('should fill the application tree', () => { - expect(testhost.component.applications).toEqual( - expect.arrayContaining([ - { - key: 'GROUPS_APP', - label: 'Groupes de profils', - children: [ - { - key: '3', - label: 'tenant 3', - children: [{ key: expectedProfiles[3].id, label: expectedProfiles[3].name, info: expectedProfiles[3].description }], - }, - ], - }, - { - key: 'CUSTOMERS_APP', - label: 'Organisations', - children: [ - { - key: '1', - label: 'tenant 1', - children: [ - { key: expectedProfiles[0].id, label: expectedProfiles[0].name, info: expectedProfiles[0].description }, - { key: expectedProfiles[5].id, label: expectedProfiles[5].name, info: expectedProfiles[5].description }, - ], - }, - { - key: '2', - label: 'tenant 2', - children: [{ key: expectedProfiles[1].id, label: expectedProfiles[1].name, info: expectedProfiles[1].description }], - }, - ], - }, - { - key: 'PROFILES_APP', - label: 'Profils APP Utilisateurs', - children: [ - { - key: '4', - label: 'tenant 4', - children: [{ key: expectedProfiles[4].id, label: expectedProfiles[4].name, info: expectedProfiles[4].description }], - }, - ], - }, - { - key: 'USERS_APP', - label: 'Utilisateurs', - children: [ - { - key: '1', - label: 'tenant 1', - children: [{ key: expectedProfiles[2].id, label: expectedProfiles[2].name, info: expectedProfiles[2].description }], - }, - ], - }, - ]), - ); - }); - - it('should add the profile Id to the list', () => { - testhost.component.profileSelect.setValue(expectedProfiles[3].id); - testhost.component.add(); - fixture.detectChanges(); - expect(testhost.profiles).toEqual(['4']); - }); - - it('should remove the profile Id from the list', waitForAsync(() => { - testhost.profiles = ['3', '4']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - testhost.component.remove(0); - fixture.detectChanges(); - expect(testhost.profiles).toEqual(['4']); - }); - })); - - it('should not show profiles which are already selected', waitForAsync(() => { - testhost.profiles = ['2']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - testhost.component.appSelect.setValue('ARCHIVE_APP'); - testhost.component.tenantSelect.setValue('2'); - fixture.detectChanges(); - expect(testhost.component.filteredProfiles.length).toBe(0); - }); - })); - - it('should toggle the tenant select', () => { - expect(testhost.component.tenantSelect.disabled).toBeTruthy(); - testhost.component.appSelect.setValue('CUSTOMERS_APP'); - expect(testhost.component.tenantSelect.disabled).toBeFalsy(); - }); - - it('should toggle the profile select', () => { - testhost.component.appSelect.setValue('CUSTOMERS_APP'); - expect(testhost.component.profileSelect.disabled).toBeTruthy(); - testhost.component.tenantSelect.setValue('1'); - expect(testhost.component.profileSelect.disabled).toBeFalsy(); - }); - - it('should not show the app 2', waitForAsync(() => { - testhost.profiles = ['3']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(testhost.component.applications.length).toBe(3); - expect(testhost.component.applications[0].key).toBe('GROUPS_APP'); - expect(testhost.component.applications[1].key).toBe('CUSTOMERS_APP'); - expect(testhost.component.applications[2].key).toBe('PROFILES_APP'); - }); - })); - - it('should not show the tenant 2', waitForAsync(() => { - testhost.profiles = ['2']; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - testhost.component.appSelect.setValue('CUSTOMERS_APP'); - expect(testhost.component.filteredTenants.length).toBe(1); - expect(testhost.component.filteredTenants[0].key).toBe('1'); - }); - })); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts index eabc7954d73..ad31303013e 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts @@ -35,11 +35,22 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, forwardRef, Input, OnInit, SimpleChanges, ViewChild, OnChanges, inject } from '@angular/core'; -import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators } from '@angular/forms'; +import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule } from '@angular/forms'; import { shareReplay } from 'rxjs/operators'; -import { ApplicationApiService, IdentifierName, Option, Profile, ProfileService, SelectComponent } from 'vitamui-library'; +import { + ApplicationApiService, + IdentifierName, + Option, + Profile, + ProfileService, + SelectComponent, + EllipsisDirective, +} from 'vitamui-library'; import { OptionTree } from './option-tree.interface'; import { zip } from 'rxjs'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { NgClass, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; export const PROFILES_FORM_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -52,7 +63,7 @@ export const PROFILES_FORM_VALUE_ACCESSOR: any = { templateUrl: './profiles-form.component.html', styleUrls: ['./profiles-form.component.scss'], providers: [PROFILES_FORM_VALUE_ACCESSOR], - standalone: false, + imports: [MatProgressSpinner, SelectComponent, ReactiveFormsModule, NgClass, TranslatePipe, CommonModule, EllipsisDirective], }) export class ProfilesFormComponent implements ControlValueAccessor, OnInit, OnChanges { private rngProfileService = inject(ProfileService); diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts deleted file mode 100644 index 1ba57538855..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.module.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { ProfilesFormComponent } from './profiles-form.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - ReactiveFormsModule, - MatProgressSpinnerModule, - MatSelectModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [ProfilesFormComponent], - exports: [ProfilesFormComponent], -}) -export class ProfilesFormModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts index c6e928e1a5b..d7db8eee913 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts @@ -34,24 +34,44 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { CollapseModule, LevelInputModule, VitamUICommonModule } from 'vitamui-library'; -import { DomainsInputModule } from './domains-input/domains-input.module'; -import { EditableFieldModule } from './editable-field/editable-field.module'; -import { ProfilesFormModule } from './profiles-form/profiles-form.module'; +import { VitamUICommonModule, LevelInputComponent, CollapseComponent } from 'vitamui-library'; +import { DomainsInputComponent } from './domains-input/domains-input.component'; +import { EditableCustomParamsComponent } from './editable-field/editable-custom-params/editable-custom-params.component'; +import { EditableDomainInputComponent } from './editable-field/editable-domain-input/editable-domain-input.component'; +import { EditableKeystoreComponent } from './editable-field/editable-keystore/editable-keystore.component'; +import { EditablePatternsComponent } from './editable-field/editable-patterns/editable-patterns.component'; +import { ProfilesFormComponent } from './profiles-form/profiles-form.component'; +import { FormsModule } from '@angular/forms'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @NgModule({ imports: [ + VitamUICommonModule, + DomainsInputComponent, + EditableDomainInputComponent, + EditablePatternsComponent, + EditableKeystoreComponent, + EditableCustomParamsComponent, + ProfilesFormComponent, CommonModule, - CollapseModule, - DomainsInputModule, - EditableFieldModule, - ProfilesFormModule, - LevelInputModule, + FormsModule, + LevelInputComponent, + TranslatePipe, + CollapseComponent, + ], + exports: [ + CollapseComponent, + LevelInputComponent, VitamUICommonModule, + DomainsInputComponent, + EditableDomainInputComponent, + EditablePatternsComponent, + EditableKeystoreComponent, + EditableCustomParamsComponent, + ProfilesFormComponent, ], - exports: [CollapseModule, DomainsInputModule, EditableFieldModule, ProfilesFormModule, LevelInputModule, VitamUICommonModule], }) export class SharedModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts index 61da85ab597..eef59cec2e9 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AuthService, BASE_URL, CriteriaSearchQuery, ENVIRONMENT, LoggerModule, Operators } from 'vitamui-library'; +import { AuthService, BASE_URL, CriteriaSearchQuery, ENVIRONMENT } from 'vitamui-library'; +import { LoggerModule, Operators } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts index cd0bca25536..5084c0662c5 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts @@ -36,7 +36,8 @@ */ import { Observable, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; -import { CriteriaSearchQuery, Customer, MenuOption, Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Customer, MenuOption } from 'vitamui-library'; +import { Operators } from 'vitamui-library'; import { HttpParams } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts index 34f3387e41c..22b7c077d5f 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts @@ -51,6 +51,8 @@ import { Profile, SubrogationModalService, SubrogationUser, + EllipsisDirective, + InfiniteScrollDirective, } from 'vitamui-library'; import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; @@ -58,6 +60,9 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { SubrogationService } from '../../subrogation.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; const MINIMUM_CRITICALITY = 0; const AVERAGE_CRITICALITY = 1; @@ -67,7 +72,7 @@ const MAXIMUM_CRITICALITY = 2; selector: 'app-subrogate-user-list', templateUrl: './subrogate-user-list.component.html', styleUrls: ['./subrogate-user-list.component.scss'], - standalone: false, + imports: [NgClass, MatProgressSpinner, TranslatePipe, CommonModule, EllipsisDirective, InfiniteScrollDirective], }) export class SubrogateUserListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { subrogationService: SubrogationService; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts index 95edf9bb737..08ae28c530d 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts @@ -46,14 +46,26 @@ import { GlobalEventService, MenuOption, SubrogationModalService, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, } from 'vitamui-library'; import { CustomerSelectService } from '../customer-select.service'; +import { MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; +import { SubrogateUserListComponent } from './subrogate-user-list/subrogate-user-list.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-subrogate-user', templateUrl: './subrogate-user.component.html', styleUrls: ['./subrogate-user.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + SubrogateUserListComponent, + TranslatePipe, + ], }) export class SubrogateUserComponent extends AppRootComponent implements OnInit, OnDestroy { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts index 341793760fc..47173aa6a66 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.module.ts @@ -44,7 +44,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../shared/shared.module'; + import { SubrogateUserListComponent } from './subrogate-user/subrogate-user-list/subrogate-user-list.component'; import { SubrogateUserComponent } from './subrogate-user/subrogate-user.component'; import { SubrogationRoutingModule } from './subrogation-routing.module'; @@ -61,11 +61,11 @@ import { TranslatePipe } from '@ngx-translate/core'; MatSelectModule, MatSidenavModule, ReactiveFormsModule, - SharedModule, SubrogationRoutingModule, VitamUICommonModule, TranslatePipe, + SubrogateUserListComponent, + SubrogateUserComponent, ], - declarations: [SubrogateUserListComponent, SubrogateUserComponent], }) export class SubrogationModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts index 2eef1e68cab..4aafb522c4e 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts @@ -38,9 +38,12 @@ import { User } from 'vitamui-library'; import { Component, forwardRef, OnInit, inject } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { GroupSelection } from '../group-selection.interface'; import { UserService } from '../user.service'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { GroupListComponent } from './group-list/group-list.component'; +import { TranslatePipe } from '@ngx-translate/core'; export const GROUP_ATTRIBUTION_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -54,7 +57,7 @@ export const GROUP_ATTRIBUTION_VALUE_ACCESSOR: any = { templateUrl: './group-attribution.component.html', styleUrls: ['./group-attribution.component.scss'], providers: [GROUP_ATTRIBUTION_VALUE_ACCESSOR], - standalone: false, + imports: [CdkScrollable, MatDialogContent, GroupListComponent, MatDialogActions, TranslatePipe], }) export class GroupAttributionComponent implements OnInit { private userService = inject(UserService); diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts index ee28cad22b9..28fd5e54625 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts @@ -34,19 +34,30 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { CollapseDirectiveModule, VitamUICommonModule } from 'vitamui-library'; +import { VitamUICommonModule, CollapseContainerDirective, CollapseDirective, CollapseTriggerForDirective } from 'vitamui-library'; import { SharedModule } from '../../shared/shared.module'; import { GroupAttributionComponent } from './group-attribution.component'; import { GroupDetailComponent } from './group-detail/group-detail.component'; import { GroupListComponent } from './group-list/group-list.component'; import { MatDialogModule } from '@angular/material/dialog'; import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @NgModule({ - imports: [CommonModule, SharedModule, CollapseDirectiveModule, VitamUICommonModule, MatDialogModule, TranslatePipe], - declarations: [GroupAttributionComponent, GroupDetailComponent, GroupListComponent], + imports: [ + SharedModule, + VitamUICommonModule, + MatDialogModule, + TranslatePipe, + GroupAttributionComponent, + GroupDetailComponent, + GroupListComponent, + CollapseContainerDirective, + CollapseDirective, + CollapseTriggerForDirective, + CommonModule, + ], exports: [GroupAttributionComponent, GroupDetailComponent, GroupListComponent], }) export class GroupAttributionModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts index 3b1a2c624e9..6c9d91a527b 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts @@ -35,14 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnInit, inject } from '@angular/core'; -import type { Group, Profile } from 'vitamui-library'; +import { Group, Profile } from 'vitamui-library'; +import { TooltipDirective, EllipsisDirective } from 'vitamui-library'; import { GroupService } from '../../../group/group.service'; +import { TitleCasePipe, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-group-detail', templateUrl: './group-detail.component.html', styleUrls: ['./group-detail.component.scss'], - standalone: false, + imports: [TooltipDirective, TitleCasePipe, TranslatePipe, CommonModule, EllipsisDirective], }) export class GroupDetailComponent implements OnInit { private groupService = inject(GroupService); diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts index 935d2dfbb49..f0603a97da4 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts @@ -36,13 +36,32 @@ */ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { Profile } from 'vitamui-library'; +import { + Profile, + SearchBarComponent, + CollapseContainerDirective, + CollapseDirective, + CollapseTriggerForDirective, + EllipsisDirective, +} from 'vitamui-library'; import { GroupSelection } from './../../group-selection.interface'; +import { GroupDetailComponent } from '../group-detail/group-detail.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-group-list', templateUrl: './group-list.component.html', styleUrls: ['./group-list.component.scss'], - standalone: false, + imports: [ + SearchBarComponent, + GroupDetailComponent, + TranslatePipe, + CollapseContainerDirective, + CollapseDirective, + CollapseTriggerForDirective, + CommonModule, + EllipsisDirective, + ], }) export class GroupListComponent implements OnInit { data = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts index 26bb7b443ad..c1122bd3744 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts @@ -35,8 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, ValidationErrors, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, ValidationErrors, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Observable, Subscription } from 'rxjs'; import { AdminUserProfile, @@ -52,6 +52,13 @@ import { OtpState, StartupService, UserInfo, + DialogHeaderComponent, + StepperComponent, + SlideToggleComponent, + InputComponent, + SelectComponent, + NextStepComponent, + PreviousStepComponent, } from 'vitamui-library'; import { GroupSelection } from './../group-selection.interface'; import { UserInfoService } from './../user-info.service'; @@ -59,6 +66,11 @@ import { UserInfoService } from './../user-info.service'; import { distinctUntilChanged, map, tap } from 'rxjs/operators'; import { UserService } from '../user.service'; import { UserCreateValidators } from './user-create.validators'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { GroupListComponent } from '../group-attribution/group-list/group-list.component'; +import { TranslatePipe } from '@ngx-translate/core'; const emailFirstPartValidator: RegExp = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+$/; @@ -66,7 +78,24 @@ const emailFirstPartValidator: RegExp = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+$/; selector: 'app-user-create', templateUrl: './user-create.component.html', styleUrls: ['./user-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + SlideToggleComponent, + InputComponent, + SelectComponent, + MatButtonToggleGroup, + MatButtonToggle, + MatDialogActions, + NextStepComponent, + GroupListComponent, + PreviousStepComponent, + TranslatePipe, + ], }) export class UserCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.module.ts b/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.module.ts deleted file mode 100644 index dd63bce37c1..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.module.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatSelectModule } from '@angular/material/select'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { GroupAttributionModule } from '../group-attribution/group-attribution.module'; -import { UserCreateComponent } from './user-create.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - GroupAttributionModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatSelectModule, - ReactiveFormsModule, - SharedModule, - VitamUICommonModule, - VitamUILibraryModule, - MatDialogModule, - TranslatePipe, - ], - declarations: [UserCreateComponent], -}) -export class UserCreateModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts index c0f2c25640f..e839213a062 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { buildCriteriaFromFilters, Criterion, Operators, QueryOperator, CriteriaSearchQuery } from 'vitamui-library'; +import { Criterion, CriteriaSearchQuery } from 'vitamui-library'; +import { buildCriteriaFromFilters, Operators, QueryOperator } from 'vitamui-library'; const USER_FILTER_CONVERTER: Readonly<{ [key: string]: (values: any[]) => Array }> = { status: (statusList: string[]): CriteriaSearchQuery[] => { diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts index d2a22473afe..c6f27c5fa7c 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts @@ -47,8 +47,18 @@ import { PageRequest, Role, SnackBarService, + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + OrderByButtonComponent, + TableFilterSearchComponent, + PipesModule, + EllipsisDirective, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, } from 'vitamui-library'; -import type { AdminUserProfile, Group, User } from 'vitamui-library'; +import { AdminUserProfile, Group, User } from 'vitamui-library'; import { Component, @@ -67,6 +77,9 @@ import { import { CustomerService } from '../../core/customer.service'; import { UserService } from '../user.service'; import { buildCriteriaFromUserFilters } from './user-criteria-builder.util'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { UpperCasePipe, DatePipe, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -74,7 +87,23 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-user-list', templateUrl: './user-list.component.html', styleUrls: ['./user-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + OrderByButtonComponent, + TableFilterSearchComponent, + MatProgressSpinner, + UpperCasePipe, + DatePipe, + PipesModule, + TranslatePipe, + CommonModule, + EllipsisDirective, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, + ], }) export class UserListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { private customerService = inject(CustomerService); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.module.ts b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.module.ts deleted file mode 100644 index c2bdcb72433..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.module.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { VitamUICommonModule } from 'vitamui-library'; - -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { RouterModule } from '@angular/router'; - -import { SharedModule } from '../../shared/shared.module'; -import { UserListComponent } from './user-list.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, RouterModule, MatProgressSpinnerModule, VitamUICommonModule, SharedModule, MatSelectModule, TranslatePipe], - declarations: [UserListComponent], - exports: [UserListComponent], -}) -export class UserListModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts index 795a3041275..3cf9c05b2f5 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts @@ -39,18 +39,19 @@ import { FormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { Subject } from 'rxjs'; -import { AuthService, isRootLevel } from 'vitamui-library'; -import type { AdminUserProfile, Group, Profile, User } from 'vitamui-library'; +import { AuthService, AdminUserProfile, Group, Profile, User } from 'vitamui-library'; +import { isRootLevel, TooltipDirective } from 'vitamui-library'; import { GroupService } from '../../../group/group.service'; import { GroupAttributionComponent } from '../../group-attribution/group-attribution.component'; import { GroupSelection } from '../../group-selection.interface'; import { UserService } from '../../user.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-user-group-tab', templateUrl: './user-group-tab.component.html', styleUrls: ['./user-group-tab.component.scss'], - standalone: false, + imports: [TooltipDirective, TranslatePipe], }) export class UserGroupTabComponent implements OnChanges, OnDestroy { groupAttrDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.spec.ts deleted file mode 100644 index b36ccac8add..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.spec.ts +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { EMPTY, of } from 'rxjs'; -import { - AdminUserProfile, - AuthService, - BASE_URL, - CountryService, - Customer, - LoggerModule, - OtpState, - User, - UserInfo, - WINDOW_LOCATION, -} from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { UserCreateValidators } from '../../user-create/user-create.validators'; -import { UserInfoService } from '../../user-info.service'; -import { UserService } from '../../user.service'; -import { UserInfoTabComponent } from './user-information-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -let expectedUser: User = { - id: 'idUser', - identifier: '8', - email: 'eDeviller@test-domain.com', - firstname: 'Emmanuel', - lastname: 'Deviller', - mobile: '', - userInfoId: '', - phone: '', - level: '', - groupId: 'profile_group_id', - customerId: '42', - otp: false, - status: 'ENABLED', - type: 'ENABLED', - subrogeable: false, - nbFailedAttempts: 0, - lastConnection: '2018-07-04T16:00:00.126+02:00', - readonly: false, - address: { - street: '13 rue faubourg', - zipCode: '75009', - city: 'paris', - country: 'france', - }, - siteCode: '001', - disablingDate: null, - centerCodes: ['000001'], - autoProvisioningEnabled: false, -}; -let userInfolanguage: UserInfo = { - id: '1', - language: 'fr', -}; -let expectedCustomer: Customer = { - id: 'idCustomer', - identifier: '1', - enabled: true, - readonly: false, - hasCustomGraphicIdentity: false, - code: '154785', - name: 'nom du client', - companyName: 'nom de la société', - passwordRevocationDelay: 6, - otp: OtpState.DEACTIVATED, - idp: true, - address: { - street: '85 rue des bois', - zipCode: '75013', - city: 'Paris', - country: 'France', - }, - language: 'FRENCH', - emailDomains: ['domain.com'], - defaultEmailDomain: 'domain.com', - owners: [ - { - id: 'znvuzhvyvg', - identifier: '41', - code: '254791', - name: 'owner name', - companyName: 'company name', - address: { - street: '85 rue des bois', - zipCode: '75013', - city: 'Paris', - country: 'France', - }, - customerId: 'idCustomer', - readonly: false, - }, - ], - themeColors: {}, - gdprAlert: false, - gdprAlertDelay: 72, - portalMessages: {}, - portalTitles: {}, -}; - -let expectedAdminUserProfile: AdminUserProfile = { - multifactorAllowed: true, - createUser: true, - genericAllowed: true, - anonymizationAllowed: false, - standardAttrsAllowed: true, - type: 'type', - profilGroupIds: ['profile_group_id'], - profilGroup: [ - { - id: 'profile_group_id', - name: 'profile_group_name', - description: 'Une description du profil group', - }, - ], -}; - -@Component({ - template: ` `, - standalone: false, -}) -class TestHostComponent { - user = expectedUser; - customer = expectedCustomer; - readOnly = false; - adminUserProfile = expectedAdminUserProfile; - userInfo = userInfolanguage; - - @ViewChild(UserInfoTabComponent, { static: false }) - component: UserInfoTabComponent; -} - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('UserInfoTabComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - expectedUser = { - id: 'idUser', - identifier: '8', - email: 'eDeviller@test-domain.com', - firstname: 'Emmanuel', - lastname: 'Deviller', - mobile: '', - userInfoId: '', - phone: '', - level: '', - groupId: 'profile_group_id', - customerId: '42', - otp: false, - status: 'ENABLED', - type: 'ENABLED', - subrogeable: false, - nbFailedAttempts: 0, - lastConnection: '2018-07-04T16:00:00.126+02:00', - readonly: false, - address: { - street: '13 rue faubourg', - zipCode: '75009', - city: 'paris', - country: 'france', - }, - siteCode: '001', - disablingDate: null, - centerCodes: ['000001'], - autoProvisioningEnabled: false, - }; - expectedCustomer = { - id: 'idCustomer', - identifier: '41', - enabled: true, - readonly: false, - hasCustomGraphicIdentity: false, - code: '154785', - name: 'nom du client', - companyName: 'nom de la société', - passwordRevocationDelay: 6, - otp: OtpState.DEACTIVATED, - idp: true, - address: { - street: '85 rue des bois', - zipCode: '75013', - city: 'Paris', - country: 'France', - }, - language: 'FRENCH', - emailDomains: ['domain.com'], - defaultEmailDomain: 'domain.com', - owners: [ - { - id: 'znvuzhvyvg', - identifier: '41', - code: '254791', - name: 'owner name', - companyName: 'company name', - address: { - street: '85 rue des bois', - zipCode: '75013', - city: 'Paris', - country: 'France', - }, - customerId: 'idCustomer', - readonly: false, - }, - ], - themeColors: {}, - gdprAlert: false, - gdprAlertDelay: 72, - portalMessages: {}, - portalTitles: {}, - }; - expectedAdminUserProfile = { - multifactorAllowed: true, - createUser: true, - genericAllowed: true, - anonymizationAllowed: false, - standardAttrsAllowed: true, - type: 'type', - profilGroupIds: ['profile_group_id'], - profilGroup: [ - { - id: 'profile_group_id', - name: 'profile_group_name', - description: 'Une description du profil group', - }, - ], - }; - userInfolanguage = { - id: '1', - language: 'fr', - }; - const userServiceSpy = { - patch: vi.fn().mockName('UserService.patch').mockReturnValue(of({})), - }; - const userInfoServiceSpy = { - patch: vi.fn().mockName('UserInfoService.patch').mockReturnValue(of({})), - }; - - const userCreateValidatorsSpy = { - uniqueEmail: vi - .fn() - .mockName('userCreateValidators.uniqueEmail') - .mockReturnValue(() => of(null)), - }; - - await TestBed.configureTestingModule({ - imports: [LoggerModule.forRoot(), MatButtonToggleModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], - declarations: [UserInfoTabComponent, TestHostComponent], - schemas: [NO_ERRORS_SCHEMA], - providers: [ - { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: UserService, useValue: userServiceSpy }, - { provide: UserInfoService, useValue: userInfoServiceSpy }, - { provide: UserCreateValidators, useValue: userCreateValidatorsSpy }, - { provide: AuthService, useValue: { user: {} } }, - { provide: CountryService, useValue: { getAvailableCountries: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }) - .overrideComponent(UserInfoTabComponent, { set: { template: '' } }) - .compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - - testhost.user = expectedUser; - testhost.userInfo = userInfolanguage; - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should have the correct fields', () => { - expect(testhost.component.form.get('id')).toBeDefined(); - expect(testhost.component.form.get('firstname')).toBeDefined(); - expect(testhost.component.form.get('lastname')).toBeDefined(); - expect(testhost.component.form.get('email')).toBeDefined(); - expect(testhost.component.form.get('mobile')).toBeDefined(); - expect(testhost.component.form.get('phone')).toBeDefined(); - expect(testhost.component.form.get('language')).toBeDefined(); - expect(testhost.component.form.get('otp')).toBeDefined(); - expect(testhost.component.form.get('type')).toBeDefined(); - expect(testhost.component.form.get('customerId')).toBeDefined(); - expect(testhost.component.form.get('groupId')).toBeDefined(); - expect(testhost.component.form.get('code')).toBeDefined(); - }); - - it('should have the email validator', () => { - const emailControl = testhost.component.form.get('email'); - emailControl.setValue('name'); - expect(emailControl.valid).toBeFalsy(); - emailControl.setValue('name@'); - expect(emailControl.valid).toBeFalsy(); - emailControl.setValue('name@domaine.test'); - expect(emailControl.valid).toBeTruthy(); - }); - - it('should disable then enable the form', () => { - testhost.component.readOnly = true; - testhost.component.ngOnChanges({ - readOnly: { previousValue: false, currentValue: true, firstChange: false, isFirstChange: () => false }, - }); - expect(testhost.component.form.disabled).toBe(true); - testhost.component.readOnly = false; - testhost.component.ngOnChanges({ - readOnly: { previousValue: true, currentValue: false, firstChange: false, isFirstChange: () => false }, - }); - expect(testhost.component.form.disabled).toBe(false); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts index b69a6b3ea1e..36feee2dafe 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts @@ -35,16 +35,48 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { merge, of } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { AdminUserProfile, CountryOption, Customer, User, UserInfo } from 'vitamui-library'; -import { CountryService, diff, Option, OtpState, StartupService } from 'vitamui-library'; +import { AdminUserProfile, CountryOption, Customer, User, UserInfo, CountryService, Option, StartupService } from 'vitamui-library'; +import { + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, + diff, + OtpState, + VitamUIFieldErrorComponent, + FormFieldValueWrapperComponent, + SelectComponent, + SlideToggleComponent, + TooltipDirective, + PipesModule, +} from 'vitamui-library'; import { UserInfoService } from '../../user-info.service'; import { UserCreateValidators } from '../../user-create/user-create.validators'; import { UserService } from '../../user.service'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatSelectModule } from '@angular/material/select'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { CommonModule } from '@angular/common'; const UPDATE_DEBOUNCE_TIME = 200; @@ -52,7 +84,39 @@ const UPDATE_DEBOUNCE_TIME = 200; selector: 'app-user-info-tab', templateUrl: './user-information-tab.component.html', styleUrls: ['./user-information-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + VitamUIFieldErrorComponent, + FormFieldValueWrapperComponent, + SelectComponent, + SlideToggleComponent, + TooltipDirective, + PipesModule, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FormsModule, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, + ], }) export class UserInfoTabComponent implements OnChanges, OnInit { private userService = inject(UserService); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-popup.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-popup.component.ts index 00753e79e56..bc49be40d22 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-popup.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-popup.component.ts @@ -40,11 +40,12 @@ import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { CustomerService } from '../../core/customer.service'; +import { UserPreviewComponent } from './user-preview.component'; @Component({ selector: 'app-profile-group-popup', template: '', - standalone: false, + imports: [UserPreviewComponent], }) export class UserPopupComponent { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts index 69e2664faa4..a575748de62 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts @@ -35,23 +35,60 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { AuthService, isLevelAllowed, StartupService } from 'vitamui-library'; -import type { AdminUserProfile, Customer, Group, User, UserInfo } from 'vitamui-library'; +import { + AuthService, + isLevelAllowed, + StartupService, + VitamuiMenuButtonComponent, + MultiOperationHistoryTabComponent, + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, +} from 'vitamui-library'; +import { AdminUserProfile, Customer, Group, User, UserInfo } from 'vitamui-library'; import { UserInfoService } from './../user-info.service'; import { UserApiService } from '../../core/api/user-api.service'; import { GroupService } from '../../group/group.service'; import { GroupSelection } from '../group-selection.interface'; import { UserService } from '../user.service'; +import { MatMenuItem } from '@angular/material/menu'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { UserInfoTabComponent } from './user-information-tab/user-information-tab.component'; +import { UserGroupTabComponent } from './user-group-tab/user-group-tab.component'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-user-preview', templateUrl: './user-preview.component.html', styleUrls: ['./user-preview.component.scss'], - standalone: false, + imports: [ + VitamuiMenuButtonComponent, + MatMenuItem, + MatTabGroup, + MatTab, + UserInfoTabComponent, + UserGroupTabComponent, + MultiOperationHistoryTabComponent, + CdkScrollable, + MatDialogContent, + MatDialogActions, + MatDialogClose, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class UserPreviewComponent implements OnDestroy, OnInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.module.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.module.ts deleted file mode 100644 index 26e22e0c926..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.module.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; - -import { VitamUICommonModule, VitamUILibraryModule, CommonTooltipModule } from 'vitamui-library'; -import { SharedModule } from '../../shared/shared.module'; -import { UserGroupTabComponent } from './user-group-tab/user-group-tab.component'; -import { UserInfoTabComponent } from './user-information-tab/user-information-tab.component'; -import { UserPopupComponent } from './user-popup.component'; -import { UserPreviewComponent } from './user-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatDialogModule, - MatMenuModule, - MatTabsModule, - ReactiveFormsModule, - RouterModule, - SharedModule, - TranslatePipe, - VitamUICommonModule, - VitamUILibraryModule, - CommonTooltipModule, - ], - declarations: [UserPopupComponent, UserPreviewComponent, UserInfoTabComponent, UserGroupTabComponent], - exports: [UserPreviewComponent], -}) -export class UserPreviewModule {} diff --git a/ui/ui-frontend/projects/identity/src/app/user/user.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user.component.ts index de4b636eb38..47e6140edee 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user.component.ts @@ -52,18 +52,32 @@ import { SidenavPage, User, SnackBarService, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, } from 'vitamui-library'; import { CustomerService } from '../core/customer.service'; import { GroupService } from '../group/group.service'; import { UserCreateComponent } from './user-create/user-create.component'; import { UserListComponent } from './user-list/user-list.component'; import { UserService } from './user.service'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { UserPreviewComponent } from './user-preview/user-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-user', templateUrl: './user.component.html', styleUrls: ['./user.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + UserPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + UserListComponent, + TranslatePipe, + ], }) export class UserComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user.module.ts b/ui/ui-frontend/projects/identity/src/app/user/user.module.ts index e03ea939d1d..d6b181c1191 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user.module.ts @@ -42,11 +42,6 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonModule } from 'vitamui-library'; -import { SharedModule } from '../shared/shared.module'; -import { GroupAttributionModule } from './group-attribution/group-attribution.module'; -import { UserCreateModule } from './user-create/user-create.module'; -import { UserListModule } from './user-list/user-list.module'; -import { UserPreviewModule } from './user-preview/user-preview.module'; import { UserRoutingModule } from './user-routing.module'; import { UserComponent } from './user.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -55,18 +50,13 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ CommonModule, VitamUICommonModule, - SharedModule, - UserCreateModule, - UserListModule, MatDialogModule, MatMenuModule, - UserPreviewModule, - GroupAttributionModule, MatSidenavModule, FormsModule, UserRoutingModule, TranslatePipe, + UserComponent, ], - declarations: [UserComponent], }) export class UserModule {} diff --git a/ui/ui-frontend/projects/identity/src/main.ts b/ui/ui-frontend/projects/identity/src/main.ts index a76b446c356..ae6d664d7cc 100644 --- a/ui/ui-frontend/projects/identity/src/main.ts +++ b/ui/ui-frontend/projects/identity/src/main.ts @@ -34,16 +34,43 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; +import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { WINDOW_LOCATION } from 'vitamui-library'; +import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { DatePipe } from '@angular/common'; +import { CoreModule } from './app/core/core.module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { AppRoutingModule } from './app/app-routing.module'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.log(err)); +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom( + AuthenticationModule.forRoot(), + CoreModule, + BrowserAnimationsModule, + BrowserModule, + VitamUICommonModule.forRoot(), + AppRoutingModule, + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), + provideI18n(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { provide: WINDOW_LOCATION, useValue: window.location }, + DatePipe, + ], +}).catch((err) => console.log(err)); diff --git a/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts index ddec3fc99d7..c799da36acf 100644 --- a/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts @@ -49,14 +49,14 @@ import { AppComponent } from './app.component'; @Component({ selector: 'router-outlet', template: '', - standalone: false, + imports: [MatSidenavModule, NoopAnimationsModule], }) class RouterOutletStubComponent {} @Component({ selector: 'vitamui-common-subrogation-banner', template: '', - standalone: false, + imports: [MatSidenavModule, NoopAnimationsModule], }) class SubrogationBannerStubComponent {} @@ -64,8 +64,7 @@ describe('AppComponent', () => { beforeEach(async () => { const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {}, getPlatformName: () => '' }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule], - declarations: [AppComponent, SubrogationBannerStubComponent, RouterOutletStubComponent], + imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/ingest/src/app/app.component.ts b/ui/ui-frontend/projects/ingest/src/app/app.component.ts index 195b00794d1..6c8d436f952 100644 --- a/ui/ui-frontend/projects/ingest/src/app/app.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/app.component.ts @@ -37,12 +37,14 @@ import { Component, inject } from '@angular/core'; import { Title } from '@angular/platform-browser'; import { StartupService } from 'vitamui-library'; +import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [HeaderModule, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule], }) export class AppComponent { title = 'Ingest App'; diff --git a/ui/ui-frontend/projects/ingest/src/app/app.module.ts b/ui/ui-frontend/projects/ingest/src/app/app.module.ts deleted file mode 100644 index a2d54c8efdb..00000000000 --- a/ui/ui-frontend/projects/ingest/src/app/app.module.ts +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { DatePipe, registerLocaleData } from '@angular/common'; -import { default as localeFr } from '@angular/common/locales/fr'; -import { LOCALE_ID, NgModule } from '@angular/core'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { CoreModule } from './core/core.module'; -import { HoldingFillingSchemeModule } from './holding-filling-scheme/holding-filling-scheme.module'; -import { IngestModule } from './ingest/ingest.module'; -import { provideNativeDateAdapter } from '@angular/material/core'; - -registerLocaleData(localeFr, 'fr'); - -@NgModule({ - declarations: [AppComponent], - imports: [ - AuthenticationModule.forRoot(), - CoreModule, - BrowserAnimationsModule, - BrowserModule, - VitamUICommonModule.forRoot(), - AppRoutingModule, - IngestModule, - HoldingFillingSchemeModule, - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ], - providers: [ - provideI18n(), - provideNativeDateAdapter(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { - provide: WINDOW_LOCATION, - useValue: window.location, - }, - DatePipe, - BytesPipe, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts index 76879423c30..49a3946e1c7 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts @@ -37,7 +37,8 @@ import { TestBed } from '@angular/core/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { IngestApiService } from './ingest-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts index ed7405de55e..54389c431d9 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts @@ -38,7 +38,8 @@ import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpRequest } from '@an import { Injectable, inject } from '@angular/core'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { BASE_URL, PageRequest, PaginatedHttpClient, PaginatedResponse, VitamuiHttpHeaders } from 'vitamui-library'; +import { BASE_URL, PageRequest, PaginatedHttpClient, PaginatedResponse } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { IngestType } from '../common/ingest-type.enum'; @Injectable({ diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts index 2353d9888e2..329f715ee24 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts @@ -39,7 +39,8 @@ import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, BytesPipe, ConfirmDialogService, LoggerModule, StartupService } from 'vitamui-library'; +import { BASE_URL, BytesPipe, ConfirmDialogService, StartupService } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { UploadComponent } from './upload.component'; import { UploadService } from './upload.service'; @@ -62,8 +63,7 @@ describe('UploadComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [UploadComponent], - imports: [MatProgressBarModule, LoggerModule.forRoot()], + imports: [MatProgressBarModule, LoggerModule.forRoot(), UploadComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts index 2a58d918bea..19acaa480d3 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts @@ -35,14 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnInit, ViewChild } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { SnackBarService, StartupService } from 'vitamui-library'; +import { DialogHeaderComponent, FileSelectorComponent } from 'vitamui-library'; import { IngestType } from './ingest-type.enum'; import { UploadService } from './upload.service'; import { MatSnackBarRef } from '@angular/material/snack-bar'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { CdkScrollable } from '@angular/cdk/scrolling'; const FILE_MAX_SIZE = 10737418240; @@ -50,7 +52,15 @@ const FILE_MAX_SIZE = 10737418240; selector: 'app-upload', templateUrl: './upload.component.html', styleUrls: ['./upload.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + CdkScrollable, + MatDialogContent, + FileSelectorComponent, + ReactiveFormsModule, + MatDialogActions, + TranslatePipe, + ], }) export class UploadComponent implements OnInit { data = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.module.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.module.ts deleted file mode 100644 index 8593940e4dc..00000000000 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.module.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { UploadComponent } from './upload.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatDialogModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [UploadComponent], -}) -export class UploadModule {} diff --git a/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts b/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts index 46c612ff254..15b08025f73 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts @@ -37,7 +37,8 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NgModule, inject } from '@angular/core'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts index 33a289278f6..c59290a9081 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts @@ -57,7 +57,19 @@ import { HoldingFillingSchemeComponent } from './holding-filling-scheme.componen @Component({ selector: 'app-ingest-list', template: '', - standalone: false, + imports: [ + MatDatepickerModule, + MatMenuModule, + MatSidenavModule, + InjectorModule, + RouterTestingModule, + VitamUICommonTestModule, + BrowserAnimationsModule, + RouterTestingModule, + NoopAnimationsModule, + SearchBarComponent, + MatDialogModule, + ], }) class IngestListStubComponent {} @@ -89,8 +101,9 @@ describe('HoldingFilingSchemeComponent', () => { NoopAnimationsModule, SearchBarComponent, MatDialogModule, + HoldingFillingSchemeComponent, + IngestListStubComponent, ], - declarations: [HoldingFillingSchemeComponent, IngestListStubComponent], providers: [ FormBuilder, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts index 92de1cd564e..9a2152e050f 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts @@ -38,14 +38,26 @@ import { Component, OnInit, inject } from '@angular/core'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { GlobalEventService, SidenavPage } from 'vitamui-library'; +import { VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent } from 'vitamui-library'; import { IngestType } from '../core/common/ingest-type.enum'; import { UploadComponent } from '../core/common/upload.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { UploadTrackingComponent } from '../shared/upload-tracking/upload-tracking.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-holding-filling-scheme', templateUrl: './holding-filling-scheme.component.html', styleUrls: ['./holding-filling-scheme.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + UploadTrackingComponent, + TranslatePipe, + ], }) export class HoldingFillingSchemeComponent extends SidenavPage implements OnInit { private router = inject(Router); diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.module.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.module.ts index 9b5af872927..45b877c1e1f 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.module.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.module.ts @@ -43,8 +43,6 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonModule } from 'vitamui-library'; -import { UploadModule } from '../core/common/upload.module'; -import { UploadTrackingModule } from '../shared/upload-tracking/upload-tracking.module'; import { HoldingFillingSchemeRoutingModule } from './holding-filling-scheme-routing.module'; import { HoldingFillingSchemeComponent } from './holding-filling-scheme.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -58,11 +56,9 @@ import { TranslatePipe } from '@ngx-translate/core'; MatProgressBarModule, MatSidenavModule, ReactiveFormsModule, - UploadModule, - UploadTrackingModule, VitamUICommonModule, TranslatePipe, + HoldingFillingSchemeComponent, ], - declarations: [HoldingFillingSchemeComponent], }) export class HoldingFillingSchemeModule {} diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.spec.ts index 4333f524f37..ab91286b2c9 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.spec.ts @@ -52,8 +52,7 @@ describe('IngestListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [IngestListComponent], - imports: [], + imports: [IngestListComponent], providers: [{ provide: IngestService, useValue: ingestServiceMock }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts index 893135f3d96..3ff0654889c 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts @@ -37,12 +37,15 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { Subject, merge } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { Direction, InfiniteScrollTable, PageRequest } from 'vitamui-library'; -import { DEFAULT_PAGE_SIZE } from 'vitamui-library'; +import { InfiniteScrollTable, DEFAULT_PAGE_SIZE } from 'vitamui-library'; +import { Direction, PageRequest, OrderByButtonComponent, PipesModule, InfiniteScrollDirective } from 'vitamui-library'; import { IngestStatus } from '../../models/logbook-event.interface'; import type { LogbookOperation } from '../../models/logbook-event.interface'; import { ingestStatus, ingestStatusVisualColor } from '../../models/logbook-event.interface'; import { IngestService } from '../ingest.service'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -55,7 +58,7 @@ export class IngestFilters { selector: 'app-ingest-list', templateUrl: './ingest-list.component.html', styleUrls: ['./ingest-list.component.scss'], - standalone: false, + imports: [OrderByButtonComponent, MatProgressSpinner, PipesModule, TranslatePipe, CommonModule, InfiniteScrollDirective], }) export class IngestListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { ingestService: IngestService; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.module.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.module.ts deleted file mode 100644 index a6f503ee0a4..00000000000 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { VitamUICommonModule } from 'vitamui-library'; -import { IngestListComponent } from './ingest-list.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [IngestListComponent], - imports: [CommonModule, MatProgressSpinnerModule, VitamUICommonModule, TranslatePipe], - exports: [IngestListComponent], -}) -export class IngestListModule {} diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts index f5f01d99bc0..5f5034642f7 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts @@ -48,9 +48,8 @@ describe('IngestErrorsDetailsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [IngestErrorsDetailsTabComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [], + imports: [IngestErrorsDetailsTabComponent], providers: [ { provide: IngestService, useValue: {} }, { provide: EventDisplayHelperService, useValue: {} }, diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts index 84bea1d00fa..03119792ce0 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts @@ -36,16 +36,26 @@ */ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; +import { + MatTreeNestedDataSource, + MatTree, + MatTreeNodeDef, + MatTreeNode, + MatTreeNodeToggle, + MatNestedTreeNode, + MatTreeNodeOutlet, +} from '@angular/material/tree'; import type { LogbookOperation } from '../../../models/logbook-event.interface'; import type { Event } from '../event'; import { EventDisplayHelperService } from '../event-display-helper.service'; +import { NgClass } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-errors-details-tab', templateUrl: './ingest-errors-details-tab.component.html', styleUrls: ['./ingest-errors-details-tab.component.css'], - standalone: false, + imports: [MatTree, MatTreeNodeDef, MatTreeNode, MatTreeNodeToggle, NgClass, MatNestedTreeNode, MatTreeNodeOutlet, TranslatePipe], }) export class IngestErrorsDetailsTabComponent implements OnInit, OnChanges { private eventDisplayHelper = inject(EventDisplayHelperService); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.spec.ts index 340be2b2317..908ed03547b 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.spec.ts @@ -46,8 +46,7 @@ describe('EventDisplayComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [EventDisplayComponent], - imports: [], + imports: [EventDisplayComponent], providers: [{ provide: IngestService, useValue: {} }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts index ba15c75e8bc..93a61407018 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts @@ -34,14 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit } from '@angular/core'; +import { Component, Input, OnInit, forwardRef } from '@angular/core'; import { Event } from '../../../event'; +import { EventTypeLabelComponent } from 'vitamui-library'; +import { NgClass } from '@angular/common'; @Component({ selector: 'app-vitam-event-display', templateUrl: './event-display.component.html', styleUrls: ['./event-display.component.scss'], - standalone: false, + imports: [EventTypeLabelComponent, NgClass, forwardRef(() => EventDisplayComponent)], }) export class EventDisplayComponent implements OnInit { @Input() event: Event; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.spec.ts index 394d59eeb94..09b96e53147 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.spec.ts @@ -55,8 +55,7 @@ describe('IngestEventDetailComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [IngestEventDetailComponent], - imports: [MatMenuModule, BrowserAnimationsModule], + imports: [MatMenuModule, BrowserAnimationsModule, IngestEventDetailComponent], providers: [ { provide: IngestService, useValue: {} }, { diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts index e8e4eea5794..c0fb145b017 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts @@ -38,12 +38,13 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@ang import type { LogbookOperation } from '../../../../models/logbook-event.interface'; import type { Event } from '../../event'; import { EventDisplayHelperService } from '../../event-display-helper.service'; +import { EventDisplayComponent } from './event-display/event-display.component'; @Component({ selector: 'app-ingest-event-detail', templateUrl: './ingest-event-detail.component.html', styleUrls: ['./ingest-event-detail.component.scss'], - standalone: false, + imports: [EventDisplayComponent], }) export class IngestEventDetailComponent implements OnInit, OnChanges { private eventDisplayHelper = inject(EventDisplayHelperService); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.spec.ts index 25f26d6008b..9f9ced87f58 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.spec.ts @@ -48,8 +48,7 @@ describe('IngestInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [IngestInformationTabComponent], - imports: [VitamUICommonTestModule], + imports: [VitamUICommonTestModule, IngestInformationTabComponent], providers: [ { provide: ApplicationService, useValue: { getUrl$: () => of('') } }, { provide: IngestReferentialService, useValue: { resolveNames: () => of({}) } }, diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts index 3e3c23bc452..c7add204495 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts @@ -35,7 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, inject } from '@angular/core'; -import { ApplicationId, ApplicationService } from 'vitamui-library'; +import { ApplicationService } from 'vitamui-library'; +import { ApplicationId, DataComponent, PipesModule } from 'vitamui-library'; import { IngestStatus } from '../../../models/logbook-event.interface'; import type { AgIdExtDeflateJson, @@ -47,12 +48,15 @@ import { ingestHasEvents, ingestLastEvent, ingestStatus } from '../../../models/ import { Observable, ReplaySubject, of } from 'rxjs'; import { catchError, map, startWith, switchMap } from 'rxjs/operators'; import { IngestReferentialService } from '../../../core/service/ingest-referential.service'; +import { IngestEventDetailComponent } from './ingest-event-detail/ingest-event-detail.component'; +import { AsyncPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-information-tab', templateUrl: './ingest-information-tab.component.html', styleUrls: ['./ingest-information-tab.component.scss'], - standalone: false, + imports: [DataComponent, IngestEventDetailComponent, AsyncPipe, PipesModule, TranslatePipe], }) export class IngestInformationTabComponent implements OnChanges { private applicationService = inject(ApplicationService); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts index c67de15c525..32d705bcebd 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts @@ -46,10 +46,7 @@ import { IngestService } from '../ingest.service'; import { IngestPreviewComponent } from './ingest-preview.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: string): string { return value; @@ -59,13 +56,18 @@ class MockTruncatePipe implements PipeTransform { describe('IngestPreviewComponent test:', () => { let component: IngestPreviewComponent; let fixture: ComponentFixture; - const logbookOperation: LogbookOperation = { id: 'aeeaaaaaaoem5lyiaa3lialtbt3j6haaaaaq', agIdExt: {}, events: [{}] }; + const logbookOperation: LogbookOperation = { + id: 'aeeaaaaaaoem5lyiaa3lialtbt3j6haaaaaq', + agIdExt: {}, + events: [ + { id: 'ev1', evParentId: null, evType: 'INGEST', evDateTime: '2020-01-01T00:00:00', evDetData: null, outcome: 'OK', outMessg: '' }, + ], + }; beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [IngestPreviewComponent, MockTruncatePipe], schemas: [NO_ERRORS_SCHEMA], - imports: [MatMenuModule], + imports: [MatMenuModule, IngestPreviewComponent, MockTruncatePipe], providers: [ { provide: LogbookService, useValue: {} }, { diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts index a11082a2a26..55270d5a4f1 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts @@ -37,16 +37,46 @@ import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, inject } from '@angular/core'; import { first } from 'rxjs/operators'; import { LogbookService } from 'vitamui-library'; +import { + VitamuiMenuButtonComponent, + TooltipDirective, + PipesModule, + CommonTooltipComponent, + VitamuiSidenavHeaderComponent, +} from 'vitamui-library'; import { IngestStatus } from '../../models/logbook-event.interface'; import type { LogbookOperation } from '../../models/logbook-event.interface'; import { ingestStatus, ingestStatusVisualColor } from '../../models/logbook-event.interface'; import { IngestService } from '../ingest.service'; +import { MatMenuItem } from '@angular/material/menu'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { IngestInformationTabComponent } from './ingest-information-tab/ingest-information-tab.component'; +import { IngestErrorsDetailsTabComponent } from './ingest-errors-details-tab/ingest-errors-details-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-ingest-preview', templateUrl: './ingest-preview.component.html', styleUrls: ['./ingest-preview.component.scss'], - standalone: false, + imports: [ + VitamuiMenuButtonComponent, + MatMenuItem, + TooltipDirective, + MatTabGroup, + MatTab, + IngestInformationTabComponent, + IngestErrorsDetailsTabComponent, + PipesModule, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + VitamuiSidenavHeaderComponent, + ], }) export class IngestPreviewComponent implements OnInit, OnChanges { private logbookService = inject(LogbookService); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.module.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.module.ts deleted file mode 100644 index 8fef3ca5dd2..00000000000 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.module.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatTreeModule } from '@angular/material/tree'; -import { RouterModule } from '@angular/router'; - -import { VitamUICommonModule } from 'vitamui-library'; -import { IngestErrorsDetailsTabComponent } from './ingest-errors-details-tab/ingest-errors-details-tab.component'; -import { EventDisplayComponent } from './ingest-information-tab/ingest-event-detail/event-display/event-display.component'; -import { IngestEventDetailComponent } from './ingest-information-tab/ingest-event-detail/ingest-event-detail.component'; -import { IngestInformationTabComponent } from './ingest-information-tab/ingest-information-tab.component'; -import { IngestPreviewComponent } from './ingest-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ - IngestPreviewComponent, - IngestInformationTabComponent, - IngestEventDetailComponent, - EventDisplayComponent, - IngestErrorsDetailsTabComponent, - ], - imports: [ - CommonModule, - RouterModule, - VitamUICommonModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - MatTreeModule, - TranslatePipe, - ], - exports: [IngestPreviewComponent, IngestInformationTabComponent, IngestEventDetailComponent, EventDisplayComponent], - schemas: [CUSTOM_ELEMENTS_SCHEMA], -}) -export class IngestPreviewModule {} diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts index 3c8b9f1daef..c7eba6740cf 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts @@ -38,9 +38,7 @@ import type { Mock } from 'vitest'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDatepickerModule } from '@angular/material/datepicker'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { IngestComponent } from './ingest.component'; @@ -58,7 +56,7 @@ import { IngestService } from './ingest.service'; @Component({ selector: 'app-ingest-list', template: '', - standalone: false, + imports: [MatDatepickerModule, MatMenuModule, MatSidenavModule, VitamUICommonTestModule], }) export class IngestListStubComponent { emitOrderChange() {} @@ -88,15 +86,12 @@ describe('IngestComponent test:', () => { MatMenuModule, MatSidenavModule, InjectorModule, - RouterTestingModule, VitamUICommonTestModule, - BrowserAnimationsModule, LoggerModule.forRoot(), - RouterTestingModule, - NoopAnimationsModule, SearchBarComponent, + IngestComponent, + IngestListStubComponent, ], - declarations: [IngestComponent, IngestListStubComponent], providers: [ FormBuilder, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts index a1aea50a786..911596d1187 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts @@ -35,22 +35,55 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, HostListener, inject, OnInit, viewChild } from '@angular/core'; -import { FormBuilder } from '@angular/forms'; +import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { AdminUserProfile, Direction, GlobalEventService, SearchBarComponent, SidenavPage } from 'vitamui-library'; +import { + AdminUserProfile, + Direction, + GlobalEventService, + SearchBarComponent, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + TooltipDirective, + VitamuiMenuButtonComponent, + DatepickerComponent, +} from 'vitamui-library'; import { IngestList } from '../core/common/ingest-list'; import { IngestType } from '../core/common/ingest-type.enum'; import { UploadComponent } from '../core/common/upload.component'; import { UploadService } from '../core/common/upload.service'; import { LogbookOperation } from '../models/logbook-event.interface'; import { IngestListComponent } from './ingest-list/ingest-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { IngestPreviewComponent } from './ingest-preview/ingest-preview.component'; +import { NgStyle } from '@angular/common'; +import { MatMenuItem } from '@angular/material/menu'; +import { UploadTrackingComponent } from '../shared/upload-tracking/upload-tracking.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest', templateUrl: './ingest.component.html', styleUrls: ['./ingest.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + IngestPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + TooltipDirective, + NgStyle, + VitamuiMenuButtonComponent, + MatMenuItem, + ReactiveFormsModule, + DatepickerComponent, + UploadTrackingComponent, + IngestListComponent, + TranslatePipe, + ], }) export class IngestComponent extends SidenavPage implements OnInit { private readonly route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.module.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.module.ts index 144f0a707b9..cc4180ddea2 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.module.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.module.ts @@ -43,10 +43,6 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonModule } from 'vitamui-library'; -import { UploadModule } from '../core/common/upload.module'; -import { UploadTrackingModule } from '../shared/upload-tracking/upload-tracking.module'; -import { IngestListModule } from './ingest-list/ingest-list.module'; -import { IngestPreviewModule } from './ingest-preview/ingest-preview.module'; import { IngestRoutingModule } from './ingest-routing.module'; import { IngestComponent } from './ingest.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -54,19 +50,15 @@ import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ imports: [ CommonModule, - IngestListModule, - IngestPreviewModule, IngestRoutingModule, MatDatepickerModule, MatDialogModule, MatMenuModule, MatSidenavModule, ReactiveFormsModule, - UploadModule, - UploadTrackingModule, VitamUICommonModule, TranslatePipe, + IngestComponent, ], - declarations: [IngestComponent], }) export class IngestModule {} diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts index 0c8b4739b95..a7dbdb0e886 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts @@ -37,7 +37,8 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; +import { SearchService, SnackBarService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { IngestApiService } from '../core/api/ingest-api.service'; import { LogbookOperation } from '../models/logbook-event.interface'; diff --git a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts index 99ede0d20af..6a8ed43e68b 100644 --- a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts @@ -55,8 +55,7 @@ describe('UploadTrackingComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatProgressBarModule, NoopAnimationsModule, LoggerModule.forRoot()], - declarations: [UploadTrackingComponent], + imports: [MatProgressBarModule, NoopAnimationsModule, LoggerModule.forRoot(), UploadTrackingComponent], providers: [FormBuilder, { provide: UploadService, useValue: UploadServiceSpy }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.ts b/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.ts index a5af38b7178..274f32f11a6 100644 --- a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.ts @@ -37,12 +37,16 @@ import { Component, inject } from '@angular/core'; import { IngestList } from '../../core/common/ingest-list'; import { UploadService } from '../../core/common/upload.service'; +import { MatProgressBar } from '@angular/material/progress-bar'; +import { DecimalPipe, KeyValuePipe } from '@angular/common'; +import { PipesModule } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-upload-tracking', templateUrl: './upload-tracking.component.html', styleUrls: ['./upload-tracking.component.scss'], - standalone: false, + imports: [MatProgressBar, DecimalPipe, KeyValuePipe, PipesModule, TranslatePipe], }) export class UploadTrackingComponent { private uploadSipService = inject(UploadService); diff --git a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.module.ts b/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.module.ts deleted file mode 100644 index 4c21f18019a..00000000000 --- a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.module.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { PipesModule, VitamUICommonModule } from 'vitamui-library'; -import { UploadTrackingComponent } from './upload-tracking.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - PipesModule, - ReactiveFormsModule, - VitamUICommonModule, - TranslatePipe, - ], - - declarations: [UploadTrackingComponent], - exports: [UploadTrackingComponent], -}) -export class UploadTrackingModule {} diff --git a/ui/ui-frontend/projects/ingest/src/main.ts b/ui/ui-frontend/projects/ingest/src/main.ts index a76b446c356..3e18e6b0541 100644 --- a/ui/ui-frontend/projects/ingest/src/main.ts +++ b/ui/ui-frontend/projects/ingest/src/main.ts @@ -34,16 +34,53 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; +import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { WINDOW_LOCATION, BytesPipe } from 'vitamui-library'; +import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { DatePipe } from '@angular/common'; +import { CoreModule } from './app/core/core.module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { AppRoutingModule } from './app/app-routing.module'; +import { IngestModule } from './app/ingest/ingest.module'; +import { HoldingFillingSchemeModule } from './app/holding-filling-scheme/holding-filling-scheme.module'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.log(err)); +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom( + AuthenticationModule.forRoot(), + CoreModule, + BrowserAnimationsModule, + BrowserModule, + VitamUICommonModule.forRoot(), + AppRoutingModule, + IngestModule, + HoldingFillingSchemeModule, + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), + provideI18n(), + provideNativeDateAdapter(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { + provide: WINDOW_LOCATION, + useValue: window.location, + }, + DatePipe, + BytesPipe, + ], +}).catch((err) => console.log(err)); diff --git a/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts index 4f4bc5ccacd..d6457404bc6 100644 --- a/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts @@ -61,8 +61,7 @@ describe('AppComponent', () => { beforeEach(async () => { const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {} }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent], - declarations: [AppComponent], + imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/pastis/src/app/app.component.ts b/ui/ui-frontend/projects/pastis/src/app/app.component.ts index be41b4b9407..42dd11bea4e 100644 --- a/ui/ui-frontend/projects/pastis/src/app/app.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/app.component.ts @@ -36,12 +36,15 @@ */ import { Component } from '@angular/core'; import { environment } from '../environments/environment'; +import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { MatToolbar } from '@angular/material/toolbar'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [HeaderModule, MatToolbar, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule], }) export class AppComponent { title = 'Pastis Application'; diff --git a/ui/ui-frontend/projects/pastis/src/app/app.module.ts b/ui/ui-frontend/projects/pastis/src/app/app.module.ts index 90b36c80e16..519b561e9e5 100644 --- a/ui/ui-frontend/projects/pastis/src/app/app.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/app.module.ts @@ -34,79 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { DatePipe, registerLocaleData } from '@angular/common'; +import { registerLocaleData } from '@angular/common'; import { default as localeFr } from '@angular/common/locales/fr'; -import { inject, LOCALE_ID, NgModule, provideAppInitializer } from '@angular/core'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { - AuthenticationModule, - BASE_URL, - ENVIRONMENT, - InjectorModule, - LoggerModule, - provideI18n, - StartupService, - ThemeService, - VitamUICommonModule, - WINDOW_LOCATION, -} from 'vitamui-library'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; import { PastisConfiguration } from './core/classes/pastis-configuration'; -import { NoAuthenticationModule } from './standalone/no-authentication.module'; -import { StandaloneStartupService } from './standalone/standalone-startup.service'; -import { StandaloneThemeService } from './standalone/standalone-theme.service'; -import { provideNativeDateAdapter } from '@angular/material/core'; export function PastisConfigurationFactory(appConfig: PastisConfiguration) { return () => appConfig.initConfiguration(); } registerLocaleData(localeFr, 'fr'); - -const startupServiceClass = environment.standalone ? StandaloneStartupService : StartupService; -const themeServiceClass = environment.standalone ? StandaloneThemeService : ThemeService; -const authenticationModuleClass = environment.standalone ? NoAuthenticationModule : AuthenticationModule.forRoot(); - -@NgModule({ - declarations: [AppComponent], - imports: [ - authenticationModuleClass, - InjectorModule, - LoggerModule.forRoot(), - BrowserAnimationsModule, - BrowserModule, - VitamUICommonModule.forRoot(), - AppRoutingModule, - MatToolbarModule, - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ], - providers: [ - provideI18n(), - provideNativeDateAdapter(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { provide: WINDOW_LOCATION, useValue: window.location }, - PastisConfiguration, - { provide: BASE_URL, useValue: './pastis-api' }, - { provide: ENVIRONMENT, useValue: environment }, - provideAppInitializer(() => { - const initializerFn = PastisConfigurationFactory(inject(PastisConfiguration)); - return initializerFn(); - }), - { provide: StartupService, useClass: startupServiceClass }, - { provide: ThemeService, useClass: themeServiceClass }, - DatePipe, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts b/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts index 7bfad6b7b1d..5f6cc9dd347 100644 --- a/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts @@ -38,13 +38,11 @@ import { CommonModule } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NgModule, inject } from '@angular/core'; import { throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; -import { PastisMaterialModule } from '../material.module'; -import { SharedModule } from '../shared/shared.module'; @NgModule({ declarations: [], exports: [VitamUICommonModule], - imports: [CommonModule, VitamUICommonModule, PastisMaterialModule, SharedModule], + imports: [CommonModule, VitamUICommonModule], providers: [provideHttpClient(withInterceptorsFromDi())], }) export class CoreModule { diff --git a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts index 14522811809..a4a424b6fa8 100644 --- a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts @@ -86,12 +86,26 @@ import { SpinnerOverlayService } from 'vitamui-library'; import { tap } from 'rxjs/operators'; import { ProfileType } from '../models/profile-type.enum'; import { ProfileVersion } from '../models/profile-version.enum'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { MatButton } from '@angular/material/button'; +import { MatIcon } from '@angular/material/icon'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { FileTreeMetadataComponent } from '../profile/edit-profile/file-tree-metadata/file-tree-metadata.component'; @Component({ selector: 'app-home', templateUrl: './main.component.html', styleUrls: ['./main.component.scss'], - standalone: false, + imports: [ + MatProgressSpinner, + MatButton, + MatIcon, + MatSidenavContainer, + MatSidenav, + EditProfileComponent, + MatSidenavContent, + FileTreeMetadataComponent, + ], }) export class MainComponent implements OnInit, OnDestroy { fileService = inject(FileService); diff --git a/ui/ui-frontend/projects/pastis/src/app/material.module.ts b/ui/ui-frontend/projects/pastis/src/app/material.module.ts deleted file mode 100644 index 8c76846f682..00000000000 --- a/ui/ui-frontend/projects/pastis/src/app/material.module.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { NgModule } from '@angular/core'; - -import { MatButtonModule } from '@angular/material/button'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCardModule } from '@angular/material/card'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatOptionModule, MatRippleModule } from '@angular/material/core'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatGridListModule } from '@angular/material/grid-list'; -import { MatIconModule } from '@angular/material/icon'; -import { MatInputModule } from '@angular/material/input'; -import { MatListModule } from '@angular/material/list'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatSortModule } from '@angular/material/sort'; -import { MatTableModule } from '@angular/material/table'; -import { MatTabsModule } from '@angular/material/tabs'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { MatTreeModule } from '@angular/material/tree'; - -@NgModule({ - imports: [ - MatButtonModule, - MatToolbarModule, - MatProgressSpinnerModule, - MatGridListModule, - MatSidenavModule, - MatCardModule, - MatDatepickerModule, - MatSelectModule, - MatOptionModule, - MatCheckboxModule, - MatRadioModule, - MatTreeModule, - MatTableModule, - MatSortModule, - MatProgressBarModule, - MatMenuModule, - MatRippleModule, - MatTabsModule, - MatFormFieldModule, - MatInputModule, - MatListModule, - MatIconModule, - MatDialogModule, - MatDividerModule, - MatButtonToggleModule, - ], - exports: [ - MatButtonModule, - MatMenuModule, - MatToolbarModule, - MatCardModule, - MatProgressSpinnerModule, - MatGridListModule, - MatSidenavModule, - MatTabsModule, - MatFormFieldModule, - MatInputModule, - MatListModule, - MatDatepickerModule, - MatSelectModule, - MatOptionModule, - MatCheckboxModule, - MatRadioModule, - MatTreeModule, - MatDialogModule, - MatTableModule, - MatSortModule, - MatProgressBarModule, - MatRippleModule, - MatIconModule, - MatDividerModule, - MatButtonToggleModule, - ], -}) -export class PastisMaterialModule {} diff --git a/ui/ui-frontend/projects/pastis/src/app/pastis/pastis.module.ts b/ui/ui-frontend/projects/pastis/src/app/pastis/pastis.module.ts index 8a9585e521b..698cbe10566 100644 --- a/ui/ui-frontend/projects/pastis/src/app/pastis/pastis.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/pastis/pastis.module.ts @@ -57,7 +57,7 @@ import { MainComponent } from '../main/main.component'; import { FileTreeModule } from '../profile/edit-profile/file-tree/file-tree.module'; import { ProfileModule } from '../profile/profile.module'; import { SedaVisualizerComponent } from '../seda-visualizer/seda-visualizer.component'; -import { SharedModule } from '../shared/shared.module'; + import { UserActionAddMetadataComponent } from '../user-actions/add-metadata/add-metadata.component'; import { UserActionRemoveMetadataComponent } from '../user-actions/remove-metadata/remove-metadata.component'; import { UserActionsModule } from '../user-actions/user-actions.module'; @@ -68,7 +68,6 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ CoreModule, ProfileModule, - SharedModule, UserActionsModule, FileTreeModule, CommonModule, @@ -93,8 +92,11 @@ import { TranslatePipe } from '@ngx-translate/core'; MatIconModule, MatTabsModule, TranslatePipe, + MainComponent, + UserActionRemoveMetadataComponent, + UserActionAddMetadataComponent, + SedaVisualizerComponent, ], - declarations: [MainComponent, UserActionRemoveMetadataComponent, UserActionAddMetadataComponent, SedaVisualizerComponent], exports: [], schemas: [CUSTOM_ELEMENTS_SCHEMA], }) diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts index 782213ec452..eace3a1fc8e 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts @@ -36,8 +36,10 @@ */ import { Component, computed, effect, Injector, OnDestroy, OnInit, signal, inject } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatDialogRef } from '@angular/material/dialog'; -import { ApplicationService, MiscValidators, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { MatDialogRef, MatDialogModule } from '@angular/material/dialog'; +import { MatRadioModule } from '@angular/material/radio'; +import { ApplicationService, Option } from 'vitamui-library'; +import { MiscValidators, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { ProfileType } from '../../models/profile-type.enum'; import { ProfileVersionOptions } from '../../models/profile-version.enum'; import { TranslateService } from '@ngx-translate/core'; @@ -45,7 +47,7 @@ import { ProfileService } from '../../core/services/profile.service'; import { Subscription } from 'rxjs'; import { Notice } from '../../models/notice.model'; -import { PastisMaterialModule } from '../../material.module'; + import { PastisGenericPopupComponent } from '../../shared/pastis-generic-popup/pastis-generic-popup.component'; import { IdentifierExistsValidator } from '../../validators/IdentifierExistsValidator'; @@ -56,9 +58,10 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUILibraryModule, ReactiveFormsModule, VitamUICommonModule, - PastisMaterialModule, PastisGenericPopupComponent, TranslatePipe, + MatDialogModule, + MatRadioModule, ], selector: 'app-create-profil-notice', templateUrl: './create-profil-notice.component.html', diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts index 113716db568..f88d9564bd5 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts @@ -72,11 +72,16 @@ The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { ProfileType } from '../../models/profile-type.enum'; import { ProfileVersion, ProfileVersionOptions } from '../../models/profile-version.enum'; import { PastisDialogData } from '../../shared/pastis-dialog/classes/pastis-dialog-data'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { DialogHeaderComponent, TooltipDirective } from 'vitamui-library'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { PastisGenericPopupComponent } from '../../shared/pastis-generic-popup/pastis-generic-popup.component'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { TranslatePipe } from '@ngx-translate/core'; export interface CreateProfileFormResult { profileType: ProfileType; @@ -88,7 +93,19 @@ export interface CreateProfileFormResult { selector: 'pastis-create-profile', templateUrl: './create-profile.component.html', styleUrls: ['./create-profile.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + CdkScrollable, + MatDialogContent, + FormsModule, + ReactiveFormsModule, + PastisGenericPopupComponent, + TooltipDirective, + MatRadioGroup, + MatRadioButton, + MatDialogActions, + TranslatePipe, + ], }) export class CreateProfileComponent implements OnInit { private fb = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts index 98f420276a1..544d206a2c7 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts @@ -72,7 +72,7 @@ The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; -import { MatTabChangeEvent } from '@angular/material/tabs'; +import { MatTabChangeEvent, MatTabGroup, MatTab, MatTabContent } from '@angular/material/tabs'; import { BehaviorSubject, Subscription } from 'rxjs'; import { environment } from '../../../environments/environment'; import { FileService } from '../../core/services/file.service'; @@ -83,15 +83,17 @@ import { ProfileType } from '../../models/profile-type.enum'; import { FileTreeComponent } from './file-tree/file-tree.component'; import { FileTreeService } from './file-tree/file-tree.service'; import { Logger } from 'vitamui-library'; +import { ChipComponent } from 'vitamui-library'; import { filter } from 'rxjs/operators'; import { BreadcrumbService } from '../../core/services/breadcrumb.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'pastis-edit-profile', templateUrl: './edit-profile.component.html', styleUrls: ['./edit-profile.component.scss'], - standalone: false, + imports: [ChipComponent, MatTabGroup, MatTab, MatTabContent, FileTreeComponent, TranslatePipe], }) export class EditProfileComponent implements OnInit, OnDestroy, AfterViewInit { profileService = inject(ProfileService); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts index e7a170eacc5..c3b6443e2d3 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts @@ -72,9 +72,21 @@ The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { MatCheckboxChange } from '@angular/material/checkbox'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { MatTableDataSource } from '@angular/material/table'; +import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog'; +import { + MatTableDataSource, + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + MatCellDef, + MatCell, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, +} from '@angular/material/table'; import { FileService } from 'projects/pastis/src/app/core/services/file.service'; import { PopupService } from 'projects/pastis/src/app/core/services/popup.service'; import { SedaService } from 'projects/pastis/src/app/core/services/seda.service'; @@ -85,13 +97,81 @@ import { AttributeData } from '../../../../models/edit-attribute-models'; import { CardinalityConstants, DataTypeConstants, FileNode, TypeConstants, ValueOrDataConstants } from '../../../../models/file-node'; import { SedaData } from '../../../../models/seda-data'; import { FileTreeMetadataService } from '../file-tree-metadata.service'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { NgStyle, NgClass, CommonModule } from '@angular/common'; +import { + TooltipDirective, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, +} from 'vitamui-library'; +import { MatSelect, MatOption, MatSelectModule } from '@angular/material/select'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatFormFieldModule } from '@angular/material/form-field'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'pastis-edit-attributes', templateUrl: './attributes.component.html', styleUrls: ['./attributes.component.scss'], - standalone: false, + imports: [ + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + MatCheckbox, + MatCellDef, + MatCell, + FormsModule, + NgStyle, + NgClass, + TooltipDirective, + MatSelect, + MatOption, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + ReactiveFormsModule, + SubLevelPipe, + ], }) export class AttributesPopupComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts index 2096118d092..9c056cb7199 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts @@ -40,7 +40,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterModule } from '@angular/router'; -import { BASE_URL, LoggerModule, ProfileService, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ProfileService, WINDOW_LOCATION } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { PastisApiService } from '../../../core/api/api.pastis.service'; import { PastisConfiguration } from '../../../core/classes/pastis-configuration'; import { FileService } from '../../../core/services/file.service'; @@ -85,8 +86,7 @@ describe('FileTreeMetadataComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [FileTreeMetadataComponent], - imports: [RouterModule.forRoot([], {}), LoggerModule.forRoot()], + imports: [RouterModule.forRoot([], {}), LoggerModule.forRoot(), FileTreeMetadataComponent], providers: [ FileTreeMetadataService, FileService, diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts index 80cc4cdf318..c3b30282047 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts @@ -36,12 +36,49 @@ */ import { CdkTextareaAutosize } from '@angular/cdk/text-field'; import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild, ViewEncapsulation, inject } from '@angular/core'; -import { MatTableDataSource } from '@angular/material/table'; +import { + MatTableDataSource, + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + MatCellDef, + MatCell, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, +} from '@angular/material/table'; import { Router } from '@angular/router'; -import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; +import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; import { environment } from 'projects/pastis/src/environments/environment'; import { mergeMap, Subscription } from 'rxjs'; -import { DatePatternConstants, Logger, Option, SnackBarService, StartupService } from 'vitamui-library'; +import { + DatePatternConstants, + Logger, + Option, + SnackBarService, + StartupService, + ChipComponent, + TooltipDirective, + VitamuiBannerComponent, + SelectComponent, + InputComponent, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, +} from 'vitamui-library'; import { FileService } from '../../../core/services/file.service'; import { ProfileService } from '../../../core/services/profile.service'; import { SedaService } from '../../../core/services/seda.service'; @@ -68,6 +105,28 @@ import { AttributesPopupComponent } from './attributes/attributes.component'; import { FileTreeMetadataService } from './file-tree-metadata.service'; import { filter, map, tap } from 'rxjs/operators'; import { BreadcrumbService } from '../../../core/services/breadcrumb.service'; +import { MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; +import { PastisTitleBreadcrumbComponent } from '../../../shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component'; +import { PastisBreadcrumbComponent } from '../../../shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component'; +import { AllowAdditionalPropertiesComponent } from '../../../user-actions/allow-additional-properties/allow-additional-properties.component'; +import { UserActionSaveProfileComponent } from '../../../user-actions/save-profile/save-profile.component'; +import { UserActionsDownloadDocComponent } from '../../../user-actions/download-doc/download-doc.component'; +import { PastisPopupMetadataLanguageComponent } from '../../../shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatIcon } from '@angular/material/icon'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatSelect, MatOption, MatSelectModule } from '@angular/material/select'; +import { MatIconButton } from '@angular/material/button'; +import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; +import { MatDivider } from '@angular/material/list'; +import { MatCheckbox } from '@angular/material/checkbox'; +import { MatDialogTitle, MatDialogModule } from '@angular/material/dialog'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { OverlayModule } from '@angular/cdk/overlay'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { MatFormFieldModule } from '@angular/material/form-field'; const FILE_TREE_METADATA_TRANSLATE_PATH = 'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA'; const ADD_PUA_CONTROL_TRANSLATE_PATH = 'USER_ACTION.ADD_PUA_CONTROL'; @@ -104,7 +163,69 @@ function constantToTranslate() { // Encapsulation has to be disabled in order for the // component style to apply to the select panel. encapsulation: ViewEncapsulation.None, - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenavContent, + PastisTitleBreadcrumbComponent, + ChipComponent, + PastisBreadcrumbComponent, + TooltipDirective, + AllowAdditionalPropertiesComponent, + UserActionSaveProfileComponent, + UserActionsDownloadDocComponent, + PastisPopupMetadataLanguageComponent, + VitamuiBannerComponent, + MatTable, + MatColumnDef, + MatHeaderCellDef, + MatHeaderCell, + MatCellDef, + MatCell, + NgClass, + MatIcon, + FormsModule, + MatSelect, + MatOption, + MatIconButton, + MatMenuTrigger, + MatMenu, + MatDivider, + MatMenuItem, + MatCheckbox, + MatHeaderRowDef, + MatHeaderRow, + MatRowDef, + MatRow, + MatDialogTitle, + MatRadioGroup, + MatRadioButton, + SelectComponent, + InputComponent, + TranslatePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + ReactiveFormsModule, + SubLevelPipe, + ], }) export class FileTreeMetadataComponent implements OnInit, OnDestroy { profileService = inject(ProfileService); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts index c66864d972b..0b50f596787 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts @@ -72,7 +72,7 @@ The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { environment } from '../../../../environments/environment'; import { FileService } from '../../../core/services/file.service'; @@ -89,9 +89,22 @@ import { UserActionRemoveMetadataComponent } from '../../../user-actions/remove- import { FileTreeMetadataService } from '../file-tree-metadata/file-tree-metadata.service'; import { FileTreeService } from './file-tree.service'; import { Logger, SnackBarService } from 'vitamui-library'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; +import { TooltipDirective } from 'vitamui-library'; +import { + MatTreeNestedDataSource, + MatTree, + MatTreeNodeDef, + MatNestedTreeNode, + MatTreeNodeToggle, + MatTreeNodeOutlet, +} from '@angular/material/tree'; import { NestedTreeControl } from '@angular/cdk/tree'; import { filter, map, tap } from 'rxjs/operators'; +import { MatListItem, MatDivider } from '@angular/material/list'; +import { NgClass, NgStyle } from '@angular/common'; +import { MatIcon } from '@angular/material/icon'; +import { MatIconButton } from '@angular/material/button'; +import { ModifyTextButtonComponent } from '../../../shared/modify-text-button/modify-text-button.component'; const FILE_TREE_TRANSLATE_PATH = 'PROFILE.EDIT_PROFILE.FILE_TREE'; @@ -131,7 +144,22 @@ function constantToTranslate() { selector: 'pastis-file-tree', templateUrl: './file-tree.component.html', styleUrls: ['./file-tree.component.scss'], - standalone: false, + imports: [ + MatTree, + MatTreeNodeDef, + MatNestedTreeNode, + MatListItem, + NgClass, + NgStyle, + MatDivider, + MatIcon, + MatIconButton, + MatTreeNodeToggle, + ModifyTextButtonComponent, + TooltipDirective, + MatTreeNodeOutlet, + TranslatePipe, + ], }) export class FileTreeComponent implements OnInit, OnDestroy { fileTreeService = inject(FileTreeService); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts index fab4ea2c60f..c12c1124012 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts @@ -74,38 +74,81 @@ knowledge of the CeCILL-C license and that you accept its terms. import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { SharedModule } from '../../../shared/shared.module'; + import { UserActionsModule } from '../../../user-actions/user-actions.module'; import { MatTableModule } from '@angular/material/table'; -import { PastisMaterialModule } from '../../../material.module'; import { MAT_RIPPLE_GLOBAL_OPTIONS } from '@angular/material/core'; -import { EditableFieldModule, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { + VitamUICommonModule, + VitamUILibraryModule, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + SubLevelPipe, +} from 'vitamui-library'; import { CoreModule } from '../../../core/core.module'; import { AttributesPopupComponent } from '../file-tree-metadata/attributes/attributes.component'; import { FileTreeMetadataComponent } from '../file-tree-metadata/file-tree-metadata.component'; import { FileTreeComponent } from './file-tree.component'; import { TranslatePipe } from '@ngx-translate/core'; +import { MatInputModule } from '@angular/material/input'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatDialogModule } from '@angular/material/dialog'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatSelectModule } from '@angular/material/select'; +import { MatButtonToggleModule } from '@angular/material/button-toggle'; +import { OverlayModule } from '@angular/cdk/overlay'; @NgModule({ imports: [ CommonModule, CoreModule, - EditableFieldModule, FormsModule, MatTableModule, - PastisMaterialModule, ReactiveFormsModule, - SharedModule, UserActionsModule, VitamUICommonModule, VitamUILibraryModule, TranslatePipe, + FileTreeMetadataComponent, + FileTreeComponent, + AttributesPopupComponent, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + LevelInputComponent, + MatButtonToggleModule, + MatDialogModule, + MatFormFieldModule, + MatInputModule, + MatProgressSpinnerModule, + MatSelectModule, + OverlayModule, + SubLevelPipe, ], exports: [FileTreeComponent, FileTreeMetadataComponent], providers: [{ provide: MAT_RIPPLE_GLOBAL_OPTIONS, useValue: { disabled: true } }], - declarations: [FileTreeMetadataComponent, FileTreeComponent, AttributesPopupComponent], }) export class FileTreeModule {} diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts index 33863bfa881..af5d831fa5a 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts @@ -72,12 +72,27 @@ The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { MatDialog, MatDialogConfig, MatDialogModule } from '@angular/material/dialog'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { filter, of, Subscription, switchMap } from 'rxjs'; -import { Direction, GlobalEventService, SidenavPage, SnackBarService, StartupService } from 'vitamui-library'; +import { + Direction, + GlobalEventService, + SidenavPage, + SnackBarService, + StartupService, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + OrderByButtonComponent, + TooltipDirective, + PipesModule, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + DialogHeaderComponent, + InfiniteScrollDirective, +} from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { ProfileService } from '../../core/services/profile.service'; @@ -94,6 +109,14 @@ import { Profile } from '../../models/profile'; import { ArchivalProfileUnit } from '../../models/archival-profile-unit'; import { NoticeService } from '../../core/services/notice.service'; import { map } from 'rxjs/operators'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { ProfilePreviewComponent } from '../profile-preview/profile-preview.component'; +import { PastisPopupOptionComponent } from '../../shared/pastis-popup-option/pastis-popup-option.component'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatMenuItem } from '@angular/material/menu'; +import { FilterByStringNamePipe } from './pipes/filterByStringName.pipe'; +import { FilterByTypePipe } from './pipes/filterByType.pipe'; const POPUP_CREATION_PATH = 'PROFILE.POP_UP_CREATION'; const POPUP_UPLOAD_PATH = 'PROFILE.POP_UP_UPLOAD_FILE'; @@ -103,7 +126,30 @@ const POPUP_UPLOAD_PATH = 'PROFILE.POP_UP_UPLOAD_FILE'; selector: 'pastis-list-profile', templateUrl: './list-profile.component.html', styleUrls: ['./list-profile.component.scss'], - standalone: false, + imports: [ + MatProgressSpinner, + MatSidenavContainer, + MatSidenav, + ProfilePreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + PastisPopupOptionComponent, + NgClass, + OrderByButtonComponent, + TooltipDirective, + MatMenuItem, + PipesModule, + TranslatePipe, + FilterByStringNamePipe, + FilterByTypePipe, + ClosePopupDialogComponent, + CommonConfirmDialogComponent, + CommonModule, + DialogHeaderComponent, + InfiniteScrollDirective, + MatDialogModule, + ], }) export class ListProfileComponent extends SidenavPage implements OnInit, OnDestroy { private profileService = inject(ProfileService); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByStringName.pipe.ts b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByStringName.pipe.ts index 8f3f0859859..b2282bd344a 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByStringName.pipe.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByStringName.pipe.ts @@ -37,10 +37,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ProfileDescription } from '../../../models/profile-description.model'; -@Pipe({ - name: 'filterByStringName', - standalone: false, -}) +@Pipe({ name: 'filterByStringName' }) export class FilterByStringNamePipe implements PipeTransform { constructor() {} private listOfProfiles: ProfileDescription[]; diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByType.pipe.ts b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByType.pipe.ts index 446eb8e2bb9..9abdb0fa04b 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByType.pipe.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/pipes/filterByType.pipe.ts @@ -37,10 +37,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ProfileDescription } from '../../../models/profile-description.model'; -@Pipe({ - name: 'filterByType', - standalone: false, -}) +@Pipe({ name: 'filterByType' }) export class FilterByTypePipe implements PipeTransform { transform(listOfProfiles: ProfileDescription[], typeToFilter: string): ProfileDescription[] { if (!listOfProfiles) { diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts index 258acf0532f..d3ced558786 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts @@ -35,22 +35,25 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { ProfileService } from '../../../../core/services/profile.service'; import { ProfileType } from '../../../../models/profile-type.enum'; -import { MiscValidators, SnackBarService } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; +import { MiscValidators, SlideToggleComponent, InputComponent } from 'vitamui-library'; import type { Profile } from '../../../../models/profile'; import type { ArchivalProfileUnit } from '../../../../models/archival-profile-unit'; import type { ProfileDescription } from '../../../../models/profile-description.model'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'profile-information-tab', templateUrl: './profile-information-tab.component.html', styleUrls: ['./profile-information-tab.component.scss'], - standalone: false, + imports: [FormsModule, ReactiveFormsModule, SlideToggleComponent, InputComponent, MatProgressSpinner, TranslatePipe], }) export class ProfileInformationTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts index ff259585781..830083c4b87 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts @@ -34,12 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { ActivatedRoute, Router } from '@angular/router'; import { Observable } from 'rxjs'; import { ConfirmActionComponent, SnackBarService } from 'vitamui-library'; +import { VitamuiMenuButtonComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { ProfileService } from '../../core/services/profile.service'; @@ -48,13 +49,36 @@ import type { ProfileDescription } from '../../models/profile-description.model' import { ProfileResponse } from '../../models/profile-response'; import { ProfileType } from '../../models/profile-type.enum'; import { ProfileInformationTabComponent } from './profile-information-tab/profile-information-tab/profile-information-tab.component'; +import { MatMenuItem } from '@angular/material/menu'; +import { NgTemplateOutlet, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; + +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'profile-preview', templateUrl: './profile-preview.component.html', styleUrls: ['./profile-preview.component.scss'], - standalone: false, + imports: [ + VitamuiMenuButtonComponent, + MatMenuItem, + NgTemplateOutlet, + MatTabGroup, + MatTab, + ProfileInformationTabComponent, + MatProgressSpinner, + forwardRef(() => ProfilePreviewComponent), + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class ProfilePreviewComponent implements AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.module.ts b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.module.ts deleted file mode 100644 index ac95327de49..00000000000 --- a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.module.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatIconModule } from '@angular/material/icon'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { ProfileInformationTabComponent } from './profile-information-tab/profile-information-tab/profile-information-tab.component'; -import { ProfilePreviewComponent } from './profile-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatSidenavModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - MatIconModule, - TranslatePipe, - ], - - declarations: [ProfilePreviewComponent, ProfileInformationTabComponent], - exports: [ProfilePreviewComponent], -}) -export class ProfilePreviewModule {} diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/profile.module.ts b/ui/ui-frontend/projects/pastis/src/app/profile/profile.module.ts index c0bee5b0e13..9eab2347015 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/profile.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/profile.module.ts @@ -75,7 +75,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { CoreModule } from './../core/core.module'; import { FileTreeModule } from './../profile/edit-profile/file-tree/file-tree.module'; -import { SharedModule } from './../shared/shared.module'; import { MatIconModule } from '@angular/material/icon'; import { MatTabsModule } from '@angular/material/tabs'; @@ -83,14 +82,14 @@ import { MatTabsModule } from '@angular/material/tabs'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { PastisMaterialModule } from '../material.module'; + import { UserActionsModule } from '../user-actions/user-actions.module'; import { CreateProfileComponent } from './create-profile/create-profile.component'; import { EditProfileComponent } from './edit-profile/edit-profile.component'; import { ListProfileComponent } from './list-profile/list-profile.component'; import { FilterByStringNamePipe } from './list-profile/pipes/filterByStringName.pipe'; import { FilterByTypePipe } from './list-profile/pipes/filterByType.pipe'; -import { ProfilePreviewModule } from './profile-preview/profile-preview.module'; + import { PastisGenericPopupComponent } from '../shared/pastis-generic-popup/pastis-generic-popup.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -103,17 +102,18 @@ import { TranslatePipe } from '@ngx-translate/core'; MatIconModule, MatSlideToggleModule, MatTabsModule, - PastisMaterialModule, - ProfilePreviewModule, ReactiveFormsModule, - SharedModule, UserActionsModule, VitamUICommonModule, VitamUILibraryModule, PastisGenericPopupComponent, TranslatePipe, + CreateProfileComponent, + EditProfileComponent, + ListProfileComponent, + FilterByStringNamePipe, + FilterByTypePipe, ], exports: [CreateProfileComponent, EditProfileComponent, ListProfileComponent, FilterByStringNamePipe, FilterByTypePipe], - declarations: [CreateProfileComponent, EditProfileComponent, ListProfileComponent, FilterByStringNamePipe, FilterByTypePipe], }) export class ProfileModule {} diff --git a/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts b/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts index c1c035effa2..00a137b9ce8 100644 --- a/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts @@ -88,7 +88,6 @@ interface ExtendedHierachyNode extends d3.HierarchyNode { selector: 'pastis-seda-visualizer', templateUrl: './seda-visualizer.component.html', styleUrls: ['./seda-visualizer.component.scss'], - standalone: false, }) export class SedaVisualizerComponent implements OnInit { private pastisService = inject(PastisApiService); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/modify-text-button/modify-text-button.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/modify-text-button/modify-text-button.component.ts index dd1d3e2517f..1bf4350ca88 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/modify-text-button/modify-text-button.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/modify-text-button/modify-text-button.component.ts @@ -36,13 +36,14 @@ */ import { Component, EventEmitter, Input, Output } from '@angular/core'; import type { FileNode } from '../../models/file-node'; +import { FormsModule } from '@angular/forms'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'modify-text-button', templateUrl: './modify-text-button.component.html', styleUrls: ['./modify-text-button.component.scss'], - standalone: false, + imports: [FormsModule], }) export class ModifyTextButtonComponent { @Input() diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts index a388c258ba5..ff86a7edcfd 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts @@ -39,13 +39,14 @@ import { TenantSelectionService } from 'vitamui-library'; import { PastisConfiguration } from '../../../core/classes/pastis-configuration'; import { BreadcrumbDataMetadata } from '../../../models/breadcrumb'; import { PastisPopupMetadataLanguageService } from '../../pastis-popup-metadata-language/pastis-popup-metadata-language.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'pastis-breadcrumb', templateUrl: './pastis-breadcrumb.component.html', styleUrls: ['./pastis-breadcrumb.component.scss'], - standalone: false, + imports: [TranslatePipe], }) export class PastisBreadcrumbComponent { private metadataLanguageService = inject(PastisPopupMetadataLanguageService); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts index 15cefd96915..7cab285ac2f 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts @@ -36,6 +36,7 @@ */ import { Location } from '@angular/common'; import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; +import { PastisBreadcrumbComponent } from '../pastis-breadcrumb/pastis-breadcrumb.component'; //TODO: delete ? @Component({ @@ -43,7 +44,7 @@ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; selector: 'pastis-title-breadcrumb', templateUrl: './pastis-title-breadcrumb.component.html', styleUrls: ['./pastis-title-breadcrumb.component.scss'], - standalone: false, + imports: [PastisBreadcrumbComponent], }) export class PastisTitleBreadcrumbComponent { private location = inject(Location); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts index dd450f5f3af..7b6cba1bf13 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts @@ -71,13 +71,15 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { ComponentPortal } from '@angular/cdk/portal'; +import { ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal'; import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { PopupService } from '../../../core/services/popup.service'; import { SedaService } from '../../../core/services/seda.service'; import { PastisDialogData } from '../classes/pastis-dialog-data'; +import { DialogHeaderComponent } from 'vitamui-library'; +import { CdkScrollable } from '@angular/cdk/scrolling'; const PASTIS_DIALOG_CONFIRM_TRANSLATE_PATH = 'PASTIS_DIALOG_CONFIRM'; @@ -86,7 +88,7 @@ const PASTIS_DIALOG_CONFIRM_TRANSLATE_PATH = 'PASTIS_DIALOG_CONFIRM'; selector: 'pastis-pastis-dialog-confirm', templateUrl: './pastis-dialog-confirm.component.html', styleUrls: ['./pastis-dialog-confirm.component.scss'], - standalone: false, + imports: [DialogHeaderComponent, CdkScrollable, MatDialogContent, CdkPortalOutlet, MatDialogActions, MatDialogClose], }) export class PastisDialogConfirmComponent implements OnInit { dialogConfirmRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.spec.ts index e67be72a832..70deec3816a 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.spec.ts @@ -83,8 +83,7 @@ describe('PastisPopupMetadataLanguageComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [PastisPopupMetadataLanguageComponent], - imports: [], + imports: [PastisPopupMetadataLanguageComponent], providers: [PastisPopupMetadataLanguageService], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts index b44718746c1..95684cd9e53 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts @@ -74,13 +74,15 @@ knowledge of the CeCILL-C license and that you accept its terms. import { Component, OnInit, inject } from '@angular/core'; import { PastisPopupMetadataLanguageService } from './pastis-popup-metadata-language.service'; +import { NgClass } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'pastis-popup-metadata-language', templateUrl: './pastis-popup-metadata-language.component.html', styleUrls: ['./pastis-popup-metadata-language.component.scss'], - standalone: false, + imports: [NgClass, TranslatePipe], }) export class PastisPopupMetadataLanguageComponent implements OnInit { private metadataLanguageService = inject(PastisPopupMetadataLanguageService); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts index 47d46faf7e7..f278497d3f2 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts @@ -56,8 +56,7 @@ describe('PastisPopupOptionComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [PastisPopupOptionComponent], - imports: [RouterTestingModule], + imports: [RouterTestingModule, PastisPopupOptionComponent], providers: [ PastisConfiguration, { provide: BASE_URL, useValue: '/pastis-api' }, diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts index 47e59bbf4da..e2248077923 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts @@ -37,7 +37,7 @@ import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; +import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; import { environment } from 'projects/pastis/src/environments/environment'; import { Subscription } from 'rxjs'; import { NoticeService } from '../../core/services/notice.service'; @@ -47,6 +47,8 @@ import { Profile } from '../../models/profile'; import { ProfileType } from '../../models/profile-type.enum'; import { SnackBarService } from 'vitamui-library'; import { CreateProfilNoticeComponent } from '../../profile/create-profil-notice/create-profil-notice.component'; +import { MatMenuItem } from '@angular/material/menu'; +import { MatDivider } from '@angular/material/list'; function constantToTranslate(edit: boolean) { if (edit) { @@ -73,7 +75,7 @@ function constantToTranslate(edit: boolean) { selector: 'pastis-popup-option', templateUrl: './pastis-popup-option.component.html', styleUrls: ['./pastis-popup-option.component.scss'], - standalone: false, + imports: [MatMenuItem, MatDivider, TranslatePipe], }) export class PastisPopupOptionComponent implements OnInit, OnDestroy { private router = inject(Router); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.spec.ts index 2d0c0dc61bb..370c44d60e2 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.spec.ts @@ -81,7 +81,7 @@ describe('PastisUnderConstructionComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [PastisUnderConstructionComponent], + imports: [PastisUnderConstructionComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.ts index ddb81c428d5..4afdb60db7f 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-under-construction/pastis-under-construction.component.ts @@ -78,6 +78,5 @@ import { Component } from '@angular/core'; selector: 'pastis-under-construction', templateUrl: './pastis-under-construction.component.html', styleUrls: ['./pastis-under-construction.component.scss'], - standalone: false, }) export class PastisUnderConstructionComponent {} diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/shared.module.ts b/ui/ui-frontend/projects/pastis/src/app/shared/shared.module.ts deleted file mode 100644 index ac5e47cb852..00000000000 --- a/ui/ui-frontend/projects/pastis/src/app/shared/shared.module.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -/* -Copyright © CINES - Centre Informatique National pour l'Enseignement Supérieur (2020) - -[dad@cines.fr] - -This software is a computer program whose purpose is to provide -a web application to create, edit, import and export archive -profiles based on the french SEDA standard -(https://redirect.francearchives.fr/seda/). - - -This software is governed by the CeCILL-C license under French law and -abiding by the rules of distribution of free software. You can use, -modify and/ or redistribute the software under the terms of the CeCILL-C -license as circulated by CEA, CNRS and INRIA at the following URL -"http://www.cecill.info". - -As a counterpart to the access to the source code and rights to copy, -modify and redistribute granted by the license, users are provided only -with a limited warranty and the software's author, the holder of the -economic rights, and the successive licensors have only limited -liability. - -In this respect, the user's attention is drawn to the risks associated -with loading, using, modifying and/or developing or reproducing the -software by the user in light of its specific status of free software, -that may mean that it is complicated to manipulate, and that also -therefore means that it is reserved for developers and experienced -professionals having in-depth computer knowledge. Users are therefore -encouraged to load and test the software's suitability as regards their -requirements in conditions enabling the security of their systems and/or -data to be ensured and, more generally, to use and operate it in the -same conditions as regards security. - -The fact that you are presently reading this means that you have had -knowledge of the CeCILL-C license and that you accept its terms. -*/ -import { PortalModule } from '@angular/cdk/portal'; -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { PastisMaterialModule } from '../material.module'; -import { ModifyTextButtonComponent } from './modify-text-button/modify-text-button.component'; -import { PastisBreadcrumbComponent } from './pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component'; -import { PastisTitleBreadcrumbComponent } from './pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component'; -import { PastisDialogConfirmComponent } from './pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component'; -import { PastisPopupMetadataLanguageComponent } from './pastis-popup-metadata-language/pastis-popup-metadata-language.component'; -import { PastisPopupOptionComponent } from './pastis-popup-option/pastis-popup-option.component'; -import { PastisUnderConstructionComponent } from './pastis-under-construction/pastis-under-construction.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ - PastisUnderConstructionComponent, - PastisPopupMetadataLanguageComponent, - PastisDialogConfirmComponent, - PastisBreadcrumbComponent, - PastisTitleBreadcrumbComponent, - PastisPopupOptionComponent, - ModifyTextButtonComponent, - ], - imports: [ - CommonModule, - FormsModule, - PastisMaterialModule, - MatSlideToggleModule, - PortalModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - exports: [ - PastisUnderConstructionComponent, - PastisMaterialModule, - PastisDialogConfirmComponent, - PastisPopupMetadataLanguageComponent, - PastisBreadcrumbComponent, - PastisTitleBreadcrumbComponent, - PastisPopupOptionComponent, - ModifyTextButtonComponent, - ], -}) -export class SharedModule {} diff --git a/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts b/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts index 53a06ac6f48..c825387e37f 100644 --- a/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts +++ b/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts @@ -36,7 +36,8 @@ */ import { Injectable, inject } from '@angular/core'; import { Observable, of, Subject } from 'rxjs'; -import { AppConfiguration, ApplicationId, AuthService, AuthUser, Logger, WINDOW_LOCATION } from 'vitamui-library'; +import { AppConfiguration, AuthService, AuthUser, Logger, WINDOW_LOCATION } from 'vitamui-library'; +import { ApplicationId } from 'vitamui-library'; import { StandaloneThemeService } from './standalone-theme.service'; const WARNING_DURATION = 2000; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts index 48ddf3ea2ae..0686f295e3c 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts @@ -71,7 +71,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, Pipe, PipeTransform, TemplateRef, inject } from '@angular/core'; +import { Component, OnDestroy, OnInit, Pipe, PipeTransform, TemplateRef, inject, forwardRef } from '@angular/core'; import { MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { FileService } from '../../core/services/file.service'; @@ -83,13 +83,28 @@ import { ProfileType } from '../../models/profile-type.enum'; import { SedaCardinalityConstants, SedaData, SedaElementConstants } from '../../models/seda-data'; import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component'; import { PastisPopupMetadataLanguageService } from '../../shared/pastis-popup-metadata-language/pastis-popup-metadata-language.service'; +import { VitamuiBannerComponent, TooltipDirective } from 'vitamui-library'; +import { MatDivider, MatList, MatSelectionList } from '@angular/material/list'; +import { NgStyle } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'pastis-user-action-add-metadata', templateUrl: './add-metadata.component.html', styleUrls: ['./add-metadata.component.scss'], - standalone: false, + imports: [ + VitamuiBannerComponent, + MatDivider, + MatList, + NgStyle, + MatSelectionList, + FormsModule, + TooltipDirective, + forwardRef(() => FilterByNamePipe), + TranslatePipe, + ], }) export class UserActionAddMetadataComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); @@ -265,10 +280,7 @@ export class UserActionAddMetadataComponent implements OnInit, OnDestroy { } } -@Pipe({ - name: 'filterByName', - standalone: false, -}) +@Pipe({ name: 'filterByName' }) export class FilterByNamePipe implements PipeTransform { transform(listOfElements: SedaData[], nameToFilter: string, sedaLanguage: boolean): SedaData[] { if (!listOfElements) { diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts index f61be66d7fa..4e5788a9fe1 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts @@ -73,11 +73,15 @@ knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; import { MatDialogRef } from '@angular/material/dialog'; -import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; +import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; import { environment } from 'projects/pastis/src/environments/environment'; import { PopupService } from '../../core/services/popup.service'; import { PastisDialogData } from '../../shared/pastis-dialog/classes/pastis-dialog-data'; import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component'; +import { MatDivider, MatList, MatSelectionList } from '@angular/material/list'; +import { NgStyle } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { TooltipDirective } from 'vitamui-library'; const ADD_PUA_CONTROL_TRANSLATE_PATH = 'USER_ACTION.ADD_PUA_CONTROL'; @@ -95,7 +99,7 @@ function constantToTranslate() { selector: 'pastis-user-action-add-metadata', templateUrl: './add-pua-control.component.html', styleUrls: ['./add-pua-control.component.scss'], - standalone: false, + imports: [MatDivider, MatList, NgStyle, MatSelectionList, FormsModule, TooltipDirective, TranslatePipe], }) export class UserActionAddPuaControlComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.spec.ts index b955e8acdf6..c403b2d2595 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.spec.ts @@ -46,8 +46,7 @@ describe('AllowAdditionalPropertiesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AllowAdditionalPropertiesComponent], - imports: [FormsModule, SlideToggleComponent], + imports: [FormsModule, SlideToggleComponent, AllowAdditionalPropertiesComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.ts index f7ddf69e99c..5b96ef8ebb4 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/allow-additional-properties/allow-additional-properties.component.ts @@ -35,13 +35,15 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { SlideToggleComponent } from 'vitamui-library'; +import { FormsModule } from '@angular/forms'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'allow-additional-properties', templateUrl: './allow-additional-properties.component.html', styleUrls: ['./allow-additional-properties.component.scss'], - standalone: false, + imports: [SlideToggleComponent, FormsModule], }) export class AllowAdditionalPropertiesComponent implements OnInit { @Output() stateToggleButton = new EventEmitter(); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.spec.ts index dea6c30396e..f2e67d92e6d 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.spec.ts @@ -44,7 +44,7 @@ describe('DownloadDocComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [UserActionsDownloadDocComponent], + imports: [UserActionsDownloadDocComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.ts index 5eecadf2b22..937ddf7d1cb 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/download-doc/download-doc.component.ts @@ -78,6 +78,5 @@ import { Component } from '@angular/core'; selector: 'pastis-user-action-download-doc', templateUrl: './download-doc.component.html', styleUrls: ['./download-doc.component.scss'], - standalone: false, }) export class UserActionsDownloadDocComponent {} diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts index 4bbd8825db6..b1faf191139 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts @@ -44,7 +44,6 @@ import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis- selector: 'duplicate-metadata', templateUrl: './duplicate-metadata.component.html', styleUrls: ['./duplicate-metadata.component.scss'], - standalone: false, }) export class DuplicateMetadataComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts index c3aa42a9dc5..713d93875d3 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts @@ -81,7 +81,6 @@ import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis- selector: 'pastis-user-action-remove-metadata', templateUrl: './remove-metadata.component.html', styleUrls: ['./remove-metadata.component.scss'], - standalone: false, }) export class UserActionRemoveMetadataComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts index 9cbf0714f73..1e3595b844c 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts @@ -36,15 +36,16 @@ */ import { Component, OnDestroy, OnInit, signal, inject } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatDialogRef } from '@angular/material/dialog'; +import { MatDialogRef, MatDialogModule } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { ProfileType } from '../../models/profile-type.enum'; -import { ApplicationService, MiscValidators, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ApplicationService, Option } from 'vitamui-library'; +import { MiscValidators, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { Notice } from '../../models/notice.model'; import { ProfileService } from '../../core/services/profile.service'; import { Subscription } from 'rxjs'; import { ProfileDescription } from '../../models/profile-description.model'; -import { PastisMaterialModule } from '../../material.module'; + import { PastisGenericPopupComponent } from '../../shared/pastis-generic-popup/pastis-generic-popup.component'; import { Router } from '@angular/router'; @@ -58,9 +59,9 @@ import { TranslatePipe } from '@ngx-translate/core'; ReactiveFormsModule, FormsModule, VitamUICommonModule, - PastisMaterialModule, PastisGenericPopupComponent, TranslatePipe, + MatDialogModule, ], selector: 'app-save-profile-popup', templateUrl: './save-profile-popup.component.html', diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts index d3bc4053b5b..2a348ab91b8 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts @@ -76,7 +76,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, LoggerModule, StartupService } from 'vitamui-library'; +import { BASE_URL, StartupService } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { ProfileService } from '../../core/services/profile.service'; import { FileTreeMetadataService } from '../../profile/edit-profile/file-tree-metadata/file-tree-metadata.service'; @@ -109,8 +110,7 @@ describe('UserActionOpenProfileComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [UserActionSaveProfileComponent], - imports: [RouterTestingModule, LoggerModule.forRoot()], + imports: [RouterTestingModule, LoggerModule.forRoot(), UserActionSaveProfileComponent], providers: [ ProfileService, FileTreeMetadataService, diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts index d90d5538018..2c4f28ead24 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts @@ -76,7 +76,8 @@ import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; import { EMPTY, filter, mergeMap, Observable, of, Subscription } from 'rxjs'; -import { ApplicationId, SnackBarService, StartupService } from 'vitamui-library'; +import { SnackBarService, StartupService } from 'vitamui-library'; +import { ApplicationId } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { FileService } from '../../core/services/file.service'; import { NoticeService } from '../../core/services/notice.service'; @@ -130,7 +131,6 @@ function constantToTranslate(edit: boolean) { selector: 'pastis-user-action-save-profile', templateUrl: './save-profile.component.html', styleUrls: ['./save-profile.component.scss'], - standalone: false, }) export class UserActionSaveProfileComponent implements OnInit, OnDestroy { private profileService = inject(ProfileService); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts index 883a8664964..5e6c9a09bde 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts @@ -35,13 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; import { ProfileService } from '../../core/services/profile.service'; import { ProfileDescription } from '../../models/profile-description.model'; import { ProfileType } from '../../models/profile-type.enum'; import { PastisDialogDataCreate } from '../save-profile/save-profile.component'; import { Option } from 'vitamui-library'; +import { DialogHeaderComponent, SelectComponent } from 'vitamui-library'; +import { FormsModule } from '@angular/forms'; +import { CdkScrollable } from '@angular/cdk/scrolling'; const POPUP_CREATION_CHOICE_PATH = 'PROFILE.POP_UP_CREATION_NOTICE.CHOICE'; @@ -55,7 +58,7 @@ function constantToTranslate() { selector: 'select-notice', templateUrl: './select-notice.component.html', styleUrls: ['./select-notice.component.scss'], - standalone: false, + imports: [DialogHeaderComponent, FormsModule, CdkScrollable, MatDialogContent, SelectComponent, MatDialogActions, TranslatePipe], }) export class SelectNoticeComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/user-actions.module.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/user-actions.module.ts index ef4d77a5ab6..858857cc578 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/user-actions.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/user-actions.module.ts @@ -79,8 +79,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import { VitamUILibraryModule } from 'vitamui-library'; import { CoreModule } from '../core/core.module'; -import { PastisMaterialModule } from '../material.module'; -import { SharedModule } from '../shared/shared.module'; + import { FilterByNamePipe } from './add-metadata/add-metadata.component'; import { UserActionAddPuaControlComponent } from './add-pua-control/add-pua-control.component'; import { AllowAdditionalPropertiesComponent } from './allow-additional-properties/allow-additional-properties.component'; @@ -92,15 +91,6 @@ import { PastisGenericPopupComponent } from '../shared/pastis-generic-popup/past import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [ - AllowAdditionalPropertiesComponent, - DuplicateMetadataComponent, - FilterByNamePipe, - SelectNoticeComponent, - UserActionAddPuaControlComponent, - UserActionSaveProfileComponent, - UserActionsDownloadDocComponent, - ], imports: [ CommonModule, CoreModule, @@ -108,12 +98,17 @@ import { TranslatePipe } from '@ngx-translate/core'; MatFormFieldModule, MatInputModule, MatSlideToggleModule, - PastisMaterialModule, ReactiveFormsModule, - SharedModule, VitamUILibraryModule, PastisGenericPopupComponent, TranslatePipe, + AllowAdditionalPropertiesComponent, + DuplicateMetadataComponent, + FilterByNamePipe, + SelectNoticeComponent, + UserActionAddPuaControlComponent, + UserActionSaveProfileComponent, + UserActionsDownloadDocComponent, ], exports: [ UserActionSaveProfileComponent, diff --git a/ui/ui-frontend/projects/pastis/src/main.ts b/ui/ui-frontend/projects/pastis/src/main.ts index 4c5ce61ea70..9017b9df914 100644 --- a/ui/ui-frontend/projects/pastis/src/main.ts +++ b/ui/ui-frontend/projects/pastis/src/main.ts @@ -34,11 +34,38 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID, provideAppInitializer, inject, importProvidersFrom } from '@angular/core'; +import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; +import { PastisConfigurationFactory } from './app/app.module'; import { environment } from './environments/environment'; +import { + provideI18n, + WINDOW_LOCATION, + BASE_URL, + ENVIRONMENT, + AuthenticationModule, + ThemeService, + StartupService, + InjectorModule, + LoggerModule, + VitamUICommonModule, +} from 'vitamui-library'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { PastisConfiguration } from './app/core/classes/pastis-configuration'; +import { NoAuthenticationModule } from './app/standalone/no-authentication.module'; +import { StandaloneThemeService } from './app/standalone/standalone-theme.service'; +import { StandaloneStartupService } from './app/standalone/standalone-startup.service'; +import { DatePipe } from '@angular/common'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { AppRoutingModule } from './app/app-routing.module'; +import { MatToolbarModule } from '@angular/material/toolbar'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { AppComponent } from './app/app.component'; + +const startupServiceClass = environment.standalone ? StandaloneStartupService : StartupService; +const themeServiceClass = environment.standalone ? StandaloneThemeService : ThemeService; +const authenticationModuleClass = environment.standalone ? NoAuthenticationModule : AuthenticationModule.forRoot(); if (environment.production) { enableProdMode(); @@ -48,6 +75,38 @@ if (environment.standalone) { document.title = 'PASTIS'; document.getElementById('favicon').setAttribute('href', '../assets/favicon.ico'); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.error(err)); +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom( + authenticationModuleClass, + InjectorModule, + LoggerModule.forRoot(), + BrowserAnimationsModule, + BrowserModule, + VitamUICommonModule.forRoot(), + AppRoutingModule, + MatToolbarModule, + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), + provideI18n(), + provideNativeDateAdapter(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { provide: WINDOW_LOCATION, useValue: window.location }, + PastisConfiguration, + { provide: BASE_URL, useValue: './pastis-api' }, + { provide: ENVIRONMENT, useValue: environment }, + provideAppInitializer(() => { + const initializerFn = PastisConfigurationFactory(inject(PastisConfiguration)); + return initializerFn(); + }), + { provide: StartupService, useClass: startupServiceClass }, + { provide: ThemeService, useClass: themeServiceClass }, + DatePipe, + ], +}).catch((err) => console.error(err)); diff --git a/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts b/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts index 97ea58c8caf..c4ac5d45f39 100644 --- a/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts +++ b/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts @@ -36,7 +36,8 @@ */ import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; -import { AccountComponent, AnalyticsResolver, AppGuard, ApplicationId, AuthGuard } from 'vitamui-library'; +import { AccountComponent, AnalyticsResolver, AppGuard, AuthGuard } from 'vitamui-library'; +import { ApplicationId } from 'vitamui-library'; import { PortalComponent } from './portal/portal.component'; const routes: Routes = [ diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index d0663383858..d50517c3705 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -40,7 +40,8 @@ import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { ActivatedRoute, Router } from '@angular/router'; import { EMPTY, Observable, of } from 'rxjs'; -import { AuthService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; +import { AuthService, BASE_URL, ENVIRONMENT, StartupService } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../environments/environment.prod'; @@ -60,7 +61,7 @@ class FakeLoader implements TranslateLoader { @Component({ selector: 'router-outlet', template: '', - standalone: false, + imports: [InjectorModule, VitamUICommonTestModule, BrowserAnimationsModule], }) class RouterOutletStubComponent {} @@ -76,8 +77,14 @@ describe('AppComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [AppComponent, RouterOutletStubComponent], - imports: [InjectorModule, VitamUICommonTestModule, BrowserAnimationsModule, LoggerModule.forRoot()], + imports: [ + InjectorModule, + VitamUICommonTestModule, + BrowserAnimationsModule, + LoggerModule.forRoot(), + RouterOutletStubComponent, + AppComponent, + ], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.ts b/ui/ui-frontend/projects/portal/src/app/app.component.ts index e77b1e779cd..c46c98cbf45 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.ts @@ -36,12 +36,14 @@ */ import { Component, OnInit, inject } from '@angular/core'; import { Logger, StartupService } from 'vitamui-library'; +import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [HeaderModule, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule], }) export class AppComponent implements OnInit { private startupService = inject(StartupService); diff --git a/ui/ui-frontend/projects/portal/src/app/app.module.ts b/ui/ui-frontend/projects/portal/src/app/app.module.ts index 75013831073..2c103a64b0f 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.module.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.module.ts @@ -37,27 +37,8 @@ import { registerLocaleData } from '@angular/common'; import { HttpBackend, HttpClient } from '@angular/common/http'; import { default as localeFr } from '@angular/common/locales/fr'; -import { LOCALE_ID, NgModule, TransferState } from '@angular/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { AngularSvgIconModule, SvgLoader } from 'angular-svg-icon'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; +import { TransferState } from '@angular/core'; import { ApplicationSvgLoader } from './application-svg-loader'; -import { PortalModule } from './portal/portal.module'; -import { - AuthenticationModule, - BASE_URL, - ENVIRONMENT, - InjectorModule, - LoggerModule, - provideI18n, - VitamUICommonModule, - WINDOW_LOCATION, -} from 'vitamui-library'; registerLocaleData(localeFr, 'fr'); @@ -67,41 +48,3 @@ export function ApplicationSvgLoaderFactory(handler: HttpBackend, transferState: suffix: '.svg', }); } - -@NgModule({ - declarations: [AppComponent], - imports: [ - AuthenticationModule.forRoot(), - BrowserModule, - BrowserAnimationsModule, - PortalModule, - VitamUICommonModule.forRoot(), - InjectorModule, - MatDialogModule, - AppRoutingModule, - LoggerModule.forRoot(), - AngularSvgIconModule.forRoot({ - loader: { - provide: SvgLoader, - useFactory: ApplicationSvgLoaderFactory, - deps: [HttpBackend, TransferState], - }, - }), - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ], - providers: [ - provideI18n(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { provide: BASE_URL, useValue: '/portal-api' }, - { provide: ENVIRONMENT, useValue: environment }, - { provide: WINDOW_LOCATION, useValue: window.location }, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts b/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts index b25ad86ec8b..53c10a0b86c 100644 --- a/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts +++ b/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts @@ -36,7 +36,8 @@ */ import { Component, Input, ViewChild } from '@angular/core'; import { MatTabGroup, MatTabsModule } from '@angular/material/tabs'; -import { Category, VitamUICommonModule } from 'vitamui-library'; +import { Category } from 'vitamui-library'; +import { VitamUICommonModule } from 'vitamui-library'; import { ContentTypeEnum } from './content.enum'; import { Content } from './content.interface'; import { CommonModule } from '@angular/common'; diff --git a/ui/ui-frontend/projects/portal/src/main.ts b/ui/ui-frontend/projects/portal/src/main.ts index a76b446c356..ffcaeb236fa 100644 --- a/ui/ui-frontend/projects/portal/src/main.ts +++ b/ui/ui-frontend/projects/portal/src/main.ts @@ -34,16 +34,65 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID, TransferState, importProvidersFrom } from '@angular/core'; +import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; +import { ApplicationSvgLoaderFactory } from './app/app.module'; import { environment } from './environments/environment'; +import { + provideI18n, + BASE_URL, + ENVIRONMENT, + WINDOW_LOCATION, + AuthenticationModule, + VitamUICommonModule, + InjectorModule, + LoggerModule, +} from 'vitamui-library'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { PortalModule } from './app/portal/portal.module'; +import { MatDialogModule } from '@angular/material/dialog'; +import { AppRoutingModule } from './app/app-routing.module'; +import { AngularSvgIconModule, SvgLoader } from 'angular-svg-icon'; +import { HttpBackend } from '@angular/common/http'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.log(err)); +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom( + AuthenticationModule.forRoot(), + BrowserModule, + BrowserAnimationsModule, + PortalModule, + VitamUICommonModule.forRoot(), + InjectorModule, + MatDialogModule, + AppRoutingModule, + LoggerModule.forRoot(), + AngularSvgIconModule.forRoot({ + loader: { + provide: SvgLoader, + useFactory: ApplicationSvgLoaderFactory, + deps: [HttpBackend, TransferState], + }, + }), + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), + provideI18n(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { provide: BASE_URL, useValue: '/portal-api' }, + { provide: ENVIRONMENT, useValue: environment }, + { provide: WINDOW_LOCATION, useValue: window.location }, + ], +}).catch((err) => console.log(err)); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.ts index 5dfe3ddc77f..369b737ed5a 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.ts @@ -63,7 +63,6 @@ import { AccessContractCreateValidators } from './access-contract-create.validat import { finalize, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { AccessContractPreviewModule } from '../access-contract-preview/access-contract-preview.module'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatFormFieldModule } from '@angular/material/form-field'; @@ -72,6 +71,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatRadioModule } from '@angular/material/radio'; import { MatSelectModule } from '@angular/material/select'; import { SharedModule } from '../../../../../identity/src/app/shared/shared.module'; +import { AccessContractAuthorizationsUpdateComponent } from '../access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ @@ -79,7 +79,6 @@ import { TranslatePipe } from '@ngx-translate/core'; templateUrl: './access-contract-create.component.html', styleUrls: ['./access-contract-create.component.scss'], imports: [ - AccessContractPreviewModule, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -90,6 +89,7 @@ import { TranslatePipe } from '@ngx-translate/core'; ReactiveFormsModule, SelectComponent, SharedModule, + AccessContractAuthorizationsUpdateComponent, VitamUICommonModule, VitamUILibraryModule, TranslatePipe, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts index 4c1b9527f36..b36721a8ea6 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts @@ -59,9 +59,8 @@ describe('AccessContractListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AccessContractListComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [VitamUICommonTestModule, MatProgressSpinnerModule], + imports: [VitamUICommonTestModule, MatProgressSpinnerModule, AccessContractListComponent], providers: [ { provide: BASE_URL, useValue: '' }, { provide: AccessContractService, useValue: accessContractServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts index a9933867e82..4f924923f13 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts @@ -37,7 +37,24 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { finalize, merge, Subject } from 'rxjs'; import { debounceTime, takeUntil } from 'rxjs/operators'; -import { AccessContract, DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, PageRequest, AccessContractService } from 'vitamui-library'; +import { + AccessContract, + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollTable, + PageRequest, + AccessContractService, + TableFilterDirective, + OrderByButtonComponent, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -45,7 +62,19 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-access-contract-list', templateUrl: './access-contract-list.component.html', styleUrls: ['./access-contract-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + OrderByButtonComponent, + NgClass, + MatProgressSpinner, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class AccessContractListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { accessContractService: AccessContractService; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts index 2415db81466..1834727483c 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts @@ -41,7 +41,8 @@ import { of } from 'rxjs'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractAuthorizationsTabComponent } from './access-contract-authorizations-tab.component'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; -import { AccessContract, Status, AgencyService } from 'vitamui-library'; +import { AccessContract, AgencyService } from 'vitamui-library'; +import { Status } from 'vitamui-library'; describe('AccessContractUsageAndServicesTabComponent', () => { let component: AccessContractAuthorizationsTabComponent; @@ -79,8 +80,7 @@ describe('AccessContractUsageAndServicesTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule, MatDialogModule], - declarations: [AccessContractAuthorizationsTabComponent], + imports: [ReactiveFormsModule, VitamUICommonTestModule, MatDialogModule, AccessContractAuthorizationsTabComponent], providers: [ { provide: MatDialog, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts index f8d1827e0e6..033ee3d03b4 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts @@ -36,18 +36,19 @@ */ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import type { AccessContract, AccessContractDisplay, Option, VitamuiSelectOptions } from 'vitamui-library'; -import { AccessRightType } from 'vitamui-library'; -import { accessRightTypeOf, AgencyService } from 'vitamui-library'; +import { AccessContract, AccessContractDisplay, Option, VitamuiSelectOptions, AccessRightType, AgencyService } from 'vitamui-library'; +import { accessRightTypeOf } from 'vitamui-library'; import { MatDialog } from '@angular/material/dialog'; import { AccessContractAuthorizationsUpdateComponent } from './access-contract-authorizations-update/access-contract-authorizations-update.component'; import { RULE_TYPES } from '../../../rule/rules.constants'; +import { NgClass } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-access-contract-authorizations-tab', templateUrl: './access-contract-authorizations-tab.component.html', styleUrls: ['./access-contract-authorizations-tab.component.scss'], - standalone: false, + imports: [NgClass, TranslatePipe], }) export class AccessContractAuthorizationsTabComponent implements OnInit { private agencyService = inject(AgencyService); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts index 9a09dc9d711..3ca642de045 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts @@ -38,7 +38,8 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { AccessContractService, AgencyService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { AccessContractService, AgencyService } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractAuthorizationsUpdateComponent } from './access-contract-authorizations-update.component'; @@ -62,8 +63,7 @@ describe('AccessContractAuthorizationsUpdateComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [AccessContractAuthorizationsUpdateComponent], - imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot()], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), AccessContractAuthorizationsUpdateComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, FormBuilder, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts index edc5adbd06a..9d4ef0e3bf0 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, ValidationErrors, ValidatorFn } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, ValidationErrors, ValidatorFn, ReactiveFormsModule } from '@angular/forms'; import { AccessContract, AccessRightType, @@ -44,15 +44,38 @@ import { AccessContractDisplay, AccessContractService, AgencyService, + DialogHeaderComponent, + SelectComponent, + SlideToggleComponent, + TooltipDirective, + NextStepComponent, + PreviousStepComponent, } from 'vitamui-library'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { RULE_TYPES } from '../../../../rule/rules.constants'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-access-contract-authorizations-update', templateUrl: './access-contract-authorizations-update.component.html', styleUrls: ['./access-contract-authorizations-update.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + MatRadioGroup, + MatRadioButton, + SelectComponent, + SlideToggleComponent, + TooltipDirective, + MatDialogActions, + NextStepComponent, + PreviousStepComponent, + TranslatePipe, + ], }) export class AccessContractAuthorizationsUpdateComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.spec.ts index 742c707d37e..43220d3902a 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.spec.ts @@ -55,7 +55,7 @@ describe.skip('AccessContractInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AccessContractInformationTabComponent], + imports: [AccessContractInformationTabComponent], providers: [ FormBuilder, AccessContractCreateValidators, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts index 4ab0bff1b94..c7c893ca1c2 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts @@ -35,20 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { AccessContract, Option } from 'vitamui-library'; -import { AccessContractService, diff } from 'vitamui-library'; +import { AccessContract, Option, AccessContractService } from 'vitamui-library'; +import { diff, SlideToggleComponent, InputComponent, PipesModule } from 'vitamui-library'; import { RULE_TYPES } from '../../../rule/rules.constants'; import { AccessContractCreateValidators } from '../../access-contract-create/access-contract-create.validators'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-access-contract-information-tab', templateUrl: './access-contract-information-tab.component.html', styleUrls: ['./access-contract-information-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, InputComponent, FormsModule, PipesModule, TranslatePipe], }) export class AccessContractInformationTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts index 5f1f7ed44b5..48b869681dd 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts @@ -95,9 +95,8 @@ describe('AccessContractNodesTabComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [AccessContractNodesTabComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [LoggerModule.forRoot()], + imports: [LoggerModule.forRoot(), AccessContractNodesTabComponent], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts index 0fe2e1af72a..f1179a76e01 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts @@ -37,16 +37,16 @@ import { HttpHeaders } from '@angular/common/http'; import { Component, Input, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import type { AccessContract } from 'vitamui-library'; +import { AccessContract, ExternalParametersService, SearchUnitApiService, SnackBarService } from 'vitamui-library'; import { ExternalParameters, VitamuiHttpHeaders } from 'vitamui-library'; -import { ExternalParametersService, SearchUnitApiService, SnackBarService } from 'vitamui-library'; import { AccessContractNodeUpdateComponent } from './access-contract-nodes-update/access-contract-node-update.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-access-contract-nodes-tab', templateUrl: './access-contract-nodes-tab.component.html', styleUrls: ['./access-contract-nodes-tab.component.scss'], - standalone: false, + imports: [TranslatePipe], }) export class AccessContractNodesTabComponent { private unitService = inject(SearchUnitApiService); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts index 686a67a4972..0971481d286 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts @@ -119,8 +119,7 @@ describe.skip('AccessContractNodeUpdateComponent', () => { open: vi.fn().mockName('SnackBarService.open'), }; await TestBed.configureTestingModule({ - declarations: [AccessContractNodeUpdateComponent], - imports: [ReactiveFormsModule, VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot()], + imports: [ReactiveFormsModule, VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), AccessContractNodeUpdateComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: expectedCustomer, logo: null } }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts index 6971fc01a90..f96bca213ca 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts @@ -35,15 +35,46 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { AccessContract, FilingPlanMode, AccessContractService } from 'vitamui-library'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { + AccessContract, + FilingPlanMode, + AccessContractService, + DialogHeaderComponent, + SlideToggleComponent, + TooltipDirective, + FilingPlanComponent, +} from 'vitamui-library'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatButtonModule } from '@angular/material/button'; +import { MatTreeModule } from '@angular/material/tree'; +import { CommonModule } from '@angular/common'; +import { MatCheckboxModule } from '@angular/material/checkbox'; @Component({ selector: 'app-access-contract-node-update', templateUrl: './access-contract-node-update.component.html', styleUrls: ['./access-contract-node-update.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + SlideToggleComponent, + TooltipDirective, + MatDialogActions, + TranslatePipe, + CommonModule, + FilingPlanComponent, + FormsModule, + MatButtonModule, + MatCheckboxModule, + MatProgressSpinnerModule, + MatTreeModule, + ], }) export class AccessContractNodeUpdateComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts index dbac343a2c6..0ccee35a808 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts @@ -34,21 +34,43 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import type { AccessContract } from 'vitamui-library'; -import { AccessContractService, ConfirmActionComponent } from 'vitamui-library'; +import { AccessContract, AccessContractService, ConfirmActionComponent } from 'vitamui-library'; +import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; import { AccessContractInformationTabComponent } from './access-contract-information-tab/access-contract-information-tab.component'; import { AccessContractAuthorizationsTabComponent } from './access-contract-authorizations-tab/access-contract-authorizations-tab.component'; import { AccessContractWriteAccessTabComponent } from './access-contract-write-access-tab/access-contract-write-access-tab.component'; +import { AccessContractNodesTabComponent } from './access-contract-nodes-tab/access-contract-nodes-tab.component'; + +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-access-contract-preview', templateUrl: './access-contract-preview.component.html', styleUrls: ['./access-contract-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + AccessContractInformationTabComponent, + AccessContractAuthorizationsTabComponent, + AccessContractWriteAccessTabComponent, + AccessContractNodesTabComponent, + OperationHistoryTabComponent, + forwardRef(() => AccessContractPreviewComponent), + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class AccessContractPreviewComponent implements AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.module.ts deleted file mode 100644 index 30b909afb33..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.module.ts +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { SelectComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { AccessContractInformationTabComponent } from './access-contract-information-tab/access-contract-information-tab.component'; -import { AccessContractNodesTabComponent } from './access-contract-nodes-tab/access-contract-nodes-tab.component'; -import { AccessContractNodeUpdateComponent } from './access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component'; -import { AccessContractPreviewComponent } from './access-contract-preview.component'; -import { AccessContractAuthorizationsTabComponent } from './access-contract-authorizations-tab/access-contract-authorizations-tab.component'; -import { AccessContractWriteAccessTabComponent } from './access-contract-write-access-tab/access-contract-write-access-tab.component'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { AccessContractAuthorizationsUpdateComponent } from './access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component'; -import { MatRadioModule } from '@angular/material/radio'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MatButtonToggleModule, - MatDialogModule, - MatFormFieldModule, - MatInputModule, - MatMenuModule, - MatOptionModule, - MatProgressSpinnerModule, - MatRadioModule, - MatSelectModule, - MatSidenavModule, - MatTabsModule, - ReactiveFormsModule, - RouterModule, - SelectComponent, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [ - AccessContractPreviewComponent, - AccessContractInformationTabComponent, - AccessContractAuthorizationsTabComponent, - AccessContractWriteAccessTabComponent, - AccessContractNodesTabComponent, - AccessContractNodeUpdateComponent, - AccessContractAuthorizationsUpdateComponent, - ], - exports: [AccessContractPreviewComponent, AccessContractAuthorizationsUpdateComponent], -}) -export class AccessContractPreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.spec.ts index ff5e0b07d7a..4faf2b54f0c 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.spec.ts @@ -54,8 +54,7 @@ describe.skip('AccessContractWriteAccessTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule], - declarations: [AccessContractWriteAccessTabComponent], + imports: [ReactiveFormsModule, VitamUICommonTestModule, AccessContractWriteAccessTabComponent], providers: [FormBuilder, { provide: AccessContractService, useValue: {} }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts index aa6a4be7270..8e904c40368 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts @@ -35,18 +35,28 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { AccessContract, Option } from 'vitamui-library'; -import { AccessContractService, diff } from 'vitamui-library'; +import { AccessContract, Option, AccessContractService } from 'vitamui-library'; +import { diff, SlideToggleComponent, TooltipDirective, SelectComponent } from 'vitamui-library'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-access-contract-write-access-tab', templateUrl: './access-contract-write-access-tab.component.html', styleUrls: ['./access-contract-write-access-tab.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + SlideToggleComponent, + TooltipDirective, + MatButtonToggleGroup, + MatButtonToggle, + SelectComponent, + TranslatePipe, + ], }) export class AccessContractWriteAccessTabComponent implements OnInit { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index 67b51666e74..4bb644b0e61 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -39,7 +39,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { AccessContractService, ApplicationService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AccessContractService, ApplicationService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; @@ -50,7 +51,7 @@ import { of } from 'rxjs'; @Component({ selector: 'app-access-contract-preview', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class AccessContractPreviewStub { @Input() @@ -60,7 +61,7 @@ class AccessContractPreviewStub { @Component({ selector: 'app-access-contract-list', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class AccessContractListStub {} @@ -78,7 +79,6 @@ describe('AccessContractComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AccessContractComponent, AccessContractListStub, AccessContractPreviewStub], imports: [ VitamUICommonTestModule, RouterTestingModule, @@ -87,6 +87,9 @@ describe('AccessContractComponent', () => { NoopAnimationsModule, MatSidenavModule, MatDialogModule, + AccessContractComponent, + AccessContractListStub, + AccessContractPreviewStub, ], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts index 0a333be31a6..d3e86d7bc9e 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts @@ -38,7 +38,7 @@ import { HttpResponse } from '@angular/common/http'; import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { AccessContract, AccessContractService, @@ -48,6 +48,9 @@ import { GlobalEventService, SidenavPage, SnackBarService, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, } from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; @@ -57,6 +60,9 @@ import { DownloadSnackBarService } from '../core/service/download-snack-bar.serv import { AccessContractCreateComponent } from './access-contract-create/access-contract-create.component'; import { AccessContractListComponent } from './access-contract-list/access-contract-list.component'; import { finalize, shareReplay } from 'rxjs/operators'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { AccessContractPreviewComponent } from './access-contract-preview/access-contract-preview.component'; +import { MatMenuItem } from '@angular/material/menu'; const IMPORT_FILE_MODEL_NAME = 'Import_access_contrat_template.csv'; @@ -64,7 +70,18 @@ const IMPORT_FILE_MODEL_NAME = 'Import_access_contrat_template.csv'; selector: 'app-access', templateUrl: './access-contract.component.html', styleUrls: ['./access-contract.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + AccessContractPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + AccessContractListComponent, + TranslatePipe, + ], }) export class AccessContractComponent extends SidenavPage implements OnInit, OnDestroy { override globalEventService: GlobalEventService; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.module.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.module.ts index be572940929..621a2189996 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.module.ts @@ -45,10 +45,9 @@ import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule } from 'vitamui-library'; -import { ImportDialogModule } from '../shared/import-dialog/import-dialog.module'; import { AccessContractListComponent } from './access-contract-list/access-contract-list.component'; -import { AccessContractPreviewModule } from './access-contract-preview/access-contract-preview.module'; + import { AccessContractRoutingModule } from './access-contract-routing.module'; import { AccessContractComponent } from './access-contract.component'; import { AccessContractCreateComponent } from './access-contract-create/access-contract-create.component'; @@ -68,10 +67,9 @@ import { TranslatePipe } from '@ngx-translate/core'; MatTabsModule, AccessContractRoutingModule, AccessContractCreateComponent, - AccessContractPreviewModule, - ImportDialogModule, TranslatePipe, + AccessContractComponent, + AccessContractListComponent, ], - declarations: [AccessContractComponent, AccessContractListComponent], }) export class AccessContractModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts index e4831bac753..d0d6e7058a8 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts @@ -35,17 +35,20 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { AfterViewChecked, ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Observable, Subscription } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { OjectUtils } from 'vitamui-library'; +import { OjectUtils, VitamuiMultiInputsModule, SelectComponent } from 'vitamui-library'; import { AccessionRegistersService } from '../accession-register.service'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { AsyncPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-accession-register-advanced-search', templateUrl: './accession-register-advanced-search.component.html', styleUrls: ['./accession-register-advanced-search.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, VitamuiMultiInputsModule, SelectComponent, MatRadioGroup, MatRadioButton, AsyncPipe, TranslatePipe], }) export class AccessionRegisterAdvancedSearchComponent implements OnInit, OnDestroy, AfterViewChecked { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts index ff2293c12fc..dff2b7dec77 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts @@ -37,13 +37,16 @@ import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; import { Observable } from 'rxjs'; import { FacetDetails } from 'vitamui-library'; +import { VitamUICommonModule, LogbookOperationFacetComponent } from 'vitamui-library'; import { AccessionRegistersService } from '../accession-register.service'; +import { AsyncPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-accession-register-facets', templateUrl: './accession-register-facets.component.html', styleUrls: ['./accession-register-facets.component.scss'], - standalone: false, + imports: [VitamUICommonModule, LogbookOperationFacetComponent, AsyncPipe, TranslatePipe], }) export class AccessionRegisterFacetsComponent implements OnInit { accessionRegistersService = inject(AccessionRegistersService); diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts index 5a171b43e5c..64c77f7f077 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts @@ -39,7 +39,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { BehaviorSubject, Observable, of } from 'rxjs'; -import { Direction, InfiniteScrollTable, PageRequest, SearchService } from 'vitamui-library'; +import { SearchService } from 'vitamui-library'; +import { Direction, InfiniteScrollTable, PageRequest } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessionRegistersService } from '../accession-register.service'; import { AccessionRegisterListComponent } from './accession-register-list.component'; @@ -77,9 +78,8 @@ describe('AccessionRegisterListComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [AccessionRegisterListComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [VitamUICommonTestModule, MatProgressSpinnerModule], + imports: [VitamUICommonTestModule, MatProgressSpinnerModule, AccessionRegisterListComponent], providers: [ { provide: AccessionRegistersService, useValue: accessionRegistersService }, { provide: SearchService, useValue: searchService }, diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts index 30b7301783f..954022f30ce 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts @@ -37,15 +37,43 @@ import { Component, EventEmitter, Input, LOCALE_ID, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { withLatestFrom } from 'rxjs/operators'; -import { AccessionRegisterDetail, DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, OjectUtils, PageRequest } from 'vitamui-library'; +import { + AccessionRegisterDetail, + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollTable, + OjectUtils, + PageRequest, + OrderByButtonComponent, + TableFilterDirective, + TableFilterSearchComponent, + TooltipDirective, + PipesModule, + InfiniteScrollDirective, +} from 'vitamui-library'; import { AccessionRegisterSearchDto } from '../../models/accession-register-export-csv.interface'; import { AccessionRegistersService } from '../accession-register.service'; +import { NgClass, AsyncPipe, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-accession-register-list', templateUrl: './accession-register-list.component.html', styleUrls: ['./accession-register-list.component.scss'], - standalone: false, + imports: [ + NgClass, + OrderByButtonComponent, + TableFilterDirective, + TableFilterSearchComponent, + TooltipDirective, + MatProgressSpinner, + AsyncPipe, + PipesModule, + TranslatePipe, + CommonModule, + InfiniteScrollDirective, + ], }) export class AccessionRegisterListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { accessionRegistersService: AccessionRegistersService; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts index 23c6ed0b613..d4092f375af 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts @@ -36,12 +36,15 @@ */ import { Component, Input, OnInit } from '@angular/core'; import type { AccessionRegisterDetail } from 'vitamui-library'; +import { DataComponent, TooltipDirective } from 'vitamui-library'; +import { DatePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-accession-register-detail', templateUrl: './accession-register-detail.component.html', styleUrls: ['./accession-register-detail.component.scss'], - standalone: false, + imports: [DataComponent, DatePipe, TranslatePipe, TooltipDirective], }) export class AccessionRegisterDetailComponent implements OnInit { @Input() diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts index 433dad21100..85773e3150e 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts @@ -42,7 +42,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { InjectorModule, LoggerModule, RegisterValueEventModel, RegisterValueEventType } from 'vitamui-library'; +import { RegisterValueEventModel } from 'vitamui-library'; +import { InjectorModule, LoggerModule, RegisterValueEventType } from 'vitamui-library'; import { AccessionRegisterOperationsListComponent } from './accession-register-operations-list.component'; export class AccessionRegisterFixtures { @@ -76,8 +77,8 @@ describe('AccessionRegisterOperationsListComponent', () => { LoggerModule.forRoot(), MatIconModule, BrowserAnimationsModule, + AccessionRegisterOperationsListComponent, ], - declarations: [AccessionRegisterOperationsListComponent], providers: [], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts index 856ade47444..2164905b6fb 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts @@ -35,14 +35,23 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; -import { Direction, RegisterValueEventModel, RegisterValueEventType } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { + Direction, + RegisterValueEventModel, + RegisterValueEventType, + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + OrderByButtonComponent, +} from 'vitamui-library'; +import { DatePipe } from '@angular/common'; @Component({ selector: 'app-accession-register-operations-list', templateUrl: './accession-register-operations-list.component.html', styleUrls: ['./accession-register-operations-list.component.scss'], - standalone: false, + imports: [TableFilterDirective, TableFilterComponent, TableFilterOptionComponent, OrderByButtonComponent, DatePipe, TranslatePipe], }) export class AccessionRegisterOperationsListComponent implements OnChanges { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts index d1f6bda5a8d..f6776c5f8bb 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts @@ -62,10 +62,7 @@ describe('AccessionRegisterPreviewComponent', () => { let component: AccessionRegisterPreviewComponent; let fixture: ComponentFixture; - @Pipe({ - name: 'truncate', - standalone: false, - }) + @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -95,8 +92,9 @@ describe('AccessionRegisterPreviewComponent', () => { RouterTestingModule, MatIconModule, BrowserAnimationsModule, + AccessionRegisterPreviewComponent, + MockTruncatePipe, ], - declarations: [AccessionRegisterPreviewComponent, MockTruncatePipe], providers: [ { provide: AccessionRegistersService, useValue: AccessionRegistersServiceMock }, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts index 18d06dee65d..c6fd09ab1ac 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts @@ -35,13 +35,33 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import type { AccessionRegisterDetail } from 'vitamui-library'; +import { AccessionRegisterDetail } from 'vitamui-library'; +import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { AccessionRegisterDetailComponent } from './accession-register-detail/accession-register-detail.component'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { AccessionRegisterOperationsListComponent } from './accession-register-operations-list/accession-register-operations-list.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-accession-register-preview', templateUrl: './accession-register-preview.component.html', styleUrls: ['./accession-register-preview.component.scss'], - standalone: false, + imports: [ + AccessionRegisterDetailComponent, + MatTabGroup, + MatTab, + AccessionRegisterOperationsListComponent, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class AccessionRegisterPreviewComponent { @Input() diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts index 0a45ca9d346..1be77e736ba 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts @@ -38,14 +38,41 @@ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { AccessionRegisterDetail, ExternalParameters, ExternalParametersService, SidenavPage } from 'vitamui-library'; +import { + AccessionRegisterDetail, + ExternalParameters, + ExternalParametersService, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { AccessionRegistersService } from './accession-register.service'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { NgClass, AsyncPipe } from '@angular/common'; +import { AccessionRegisterPreviewComponent } from './accession-register-preview/accession-register-preview.component'; +import { AccessionRegisterAdvancedSearchComponent } from './accession-register-advanced-search/accession-register-advanced-search.component'; +import { AccessionRegisterFacetsComponent } from './accession-register-facets/accession-register-facets.component'; +import { AccessionRegisterListComponent } from './accession-register-list/accession-register-list.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-accession-register', templateUrl: './accession-register.component.html', styleUrls: ['./accession-register.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + NgClass, + AccessionRegisterPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + AccessionRegisterAdvancedSearchComponent, + AccessionRegisterFacetsComponent, + AccessionRegisterListComponent, + AsyncPipe, + TranslatePipe, + ], }) export class AccessionRegisterComponent extends SidenavPage implements OnInit, OnDestroy { private accessionRegistersService: AccessionRegistersService; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts index d98f33d953c..52b648881c6 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts @@ -36,7 +36,7 @@ */ import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; @@ -51,7 +51,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; -import { RoleToggleModule, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule, RoleComponent, RoleToggleComponent, SlideToggleComponent } from 'vitamui-library'; import { GroupAttributionModule } from '../../../../identity/src/app/user/group-attribution/group-attribution.module'; import { AccessionRegisterAdvancedSearchComponent } from './accession-register-advanced-search/accession-register-advanced-search.component'; @@ -81,7 +81,6 @@ import { TranslatePipe } from '@ngx-translate/core'; GroupAttributionModule, MatProgressBarModule, MatTabsModule, - RoleToggleModule, MatCheckboxModule, MatCardModule, MatPseudoCheckboxModule, @@ -89,8 +88,6 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, MatRadioModule, TranslatePipe, - ], - declarations: [ AccessionRegisterComponent, AccessionRegisterListComponent, AccessionRegisterFacetsComponent, @@ -98,6 +95,10 @@ import { TranslatePipe } from '@ngx-translate/core'; AccessionRegisterPreviewComponent, AccessionRegisterDetailComponent, AccessionRegisterOperationsListComponent, + FormsModule, + RoleComponent, + RoleToggleComponent, + SlideToggleComponent, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], }) diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts index e309dd59070..39ac123ba22 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts @@ -41,7 +41,8 @@ import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { AccessContractService, DslQueryType, InjectorModule, LoggerModule, SnackBarService, VitamUILibraryModule } from 'vitamui-library'; +import { AccessContractService } from 'vitamui-library'; +import { DslQueryType, InjectorModule, LoggerModule, SnackBarService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AdminDslComponent } from './admin-dsl.component'; import { AdminDslService } from './admin-dsl.service'; @@ -86,8 +87,8 @@ describe('AdminDslComponent', () => { ReactiveFormsModule, VitamUICommonTestModule, VitamUILibraryModule, + AdminDslComponent, ], - declarations: [AdminDslComponent], providers: [ FormBuilder, { provide: Router, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts index 184ee890994..a644abce94b 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts @@ -36,18 +36,37 @@ */ import { Clipboard } from '@angular/cdk/clipboard'; import { Component, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; -import { AppRootComponent, DslQueryType, Option, SnackBarService, AccessContractService } from 'vitamui-library'; +import { + AppRootComponent, + DslQueryType, + Option, + SnackBarService, + AccessContractService, + VitamuiTitleBreadcrumbComponent, + SelectComponent, + InputComponent, +} from 'vitamui-library'; import { AdminDslService } from './admin-dsl.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; @Component({ selector: 'app-admin-dsl', templateUrl: './admin-dsl.component.html', styleUrls: ['./admin-dsl.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + ReactiveFormsModule, + SelectComponent, + InputComponent, + TranslatePipe, + ], }) export class AdminDslComponent extends AppRootComponent { private route: ActivatedRoute; diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.module.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.module.ts index 9b5129dcfe3..7c5756da1e5 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.module.ts @@ -68,7 +68,7 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, VitamUILibraryModule, TranslatePipe, + AdminDslComponent, ], - declarations: [AdminDslComponent], }) export class AdminDslModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts index 8b48834a1e1..2dccbbaeef8 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts @@ -38,7 +38,8 @@ import { HttpErrorResponse, HttpHeaders } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { of } from 'rxjs'; import { catchError } from 'rxjs/operators'; -import { SearchUnitApiService, VitamuiHttpHeaders } from 'vitamui-library'; +import { SearchUnitApiService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; @Injectable({ providedIn: 'root', diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts index 169e07aa67e..45ce97ce421 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts @@ -46,7 +46,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService, AgencyService } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { AgencyService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AgencyCreateComponent } from './agency-create.component'; import { AgencyCreateValidators } from './agency-create.validators'; @@ -61,7 +62,16 @@ import { AgencyCreateValidators } from './agency-create.validators'; multi: true, }, ], - standalone: false, + imports: [ + ReactiveFormsModule, + MatFormFieldModule, + MatSelectModule, + MatButtonToggleModule, + MatProgressBarModule, + NoopAnimationsModule, + MatProgressSpinnerModule, + VitamUICommonTestModule, + ], }) class DomainInputStubComponent implements ControlValueAccessor { @Input() @@ -133,8 +143,9 @@ describe('AgencyCreateComponent', () => { NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, + AgencyCreateComponent, + DomainInputStubComponent, ], - declarations: [AgencyCreateComponent, DomainInputStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts index c607d02b33b..08acc139cf9 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts @@ -35,16 +35,29 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Agency, ConfirmDialogService, AgencyService } from 'vitamui-library'; +import { DialogHeaderComponent, InputComponent } from 'vitamui-library'; import { AgencyCreateValidators } from './agency-create.validators'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-agency-create', templateUrl: './agency-create.component.html', styleUrls: ['./agency-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + CdkScrollable, + MatDialogContent, + ReactiveFormsModule, + InputComponent, + MatProgressSpinner, + MatDialogActions, + TranslatePipe, + ], }) export class AgencyCreateComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.module.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.module.ts deleted file mode 100644 index 1851dc389a2..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.module.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../../../../identity/src/app/shared/shared.module'; -import { AgencyCreateComponent } from './agency-create.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - SharedModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - VitamUICommonModule, - MatProgressSpinnerModule, - MatDialogModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [AgencyCreateComponent], -}) -export class AgencyCreateModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index a72af86d863..04a38e7a4c9 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -42,7 +42,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute } from '@angular/router'; import { TranslateLoader } from '@ngx-translate/core'; import { EMPTY, of } from 'rxjs'; -import { AgencyService, AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AgencyService, AuthService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AgencyListComponent } from './agency-list.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts index 4eb398dbd6f..39971d79a01 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts @@ -39,7 +39,7 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { merge, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map, takeUntil, tap } from 'rxjs/operators'; -import type { AdminUserProfile, Agency } from 'vitamui-library'; +import { AdminUserProfile, Agency } from 'vitamui-library'; import { AgencyService, ApplicationId, @@ -51,9 +51,7 @@ import { SecurityService, VitamUICommonModule, } from 'vitamui-library'; -import { AgencyCreateModule } from '../agency-create/agency-create.module'; -import { ImportDialogModule } from '../../shared/import-dialog/import-dialog.module'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { TranslatePipe } from '@ngx-translate/core'; @@ -64,7 +62,7 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-agency-list', templateUrl: './agency-list.component.html', styleUrls: ['./agency-list.component.scss'], - imports: [AgencyCreateModule, ImportDialogModule, MatProgressSpinnerModule, MatSidenavModule, VitamUICommonModule, TranslatePipe], + imports: [MatProgressSpinnerModule, MatSidenavModule, VitamUICommonModule, TranslatePipe], }) export class AgencyListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { agencyService: AgencyService; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts index 10e6f734c67..d2dc9210bf5 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts @@ -40,10 +40,8 @@ import { ActivatedRoute } from '@angular/router'; import { finalize, Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { isEmpty } from 'underscore'; -import type { Agency } from 'vitamui-library'; -import { ApplicationId, Role } from 'vitamui-library'; -import { SecurityService } from 'vitamui-library'; -import { diff, VitamUICommonModule, AgencyService } from 'vitamui-library'; +import { Agency, SecurityService, AgencyService } from 'vitamui-library'; +import { ApplicationId, Role, diff, VitamUICommonModule } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; import { AsyncPipe } from '@angular/common'; import { AgencyCreateValidators } from '../../agency-create/agency-create.validators'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts index a5608a79e9c..7e8e7e3e4cb 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts @@ -38,8 +38,8 @@ import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, Vi import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader, MatTabsModule } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { AgencyService, ConfirmActionComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import type { Agency } from 'vitamui-library'; +import { AgencyService, ConfirmActionComponent, Agency } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { AgencyInformationTabComponent } from './agency-information-tab/agency-information-tab.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index 156230db653..39869571e63 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -40,7 +40,8 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { AgencyService, BASE_URL, InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; +import { AgencyService, BASE_URL, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts index 543ea43b948..d6d3c6c3bc5 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts @@ -55,10 +55,9 @@ import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/imp import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; import { AgencyCreateComponent } from './agency-create/agency-create.component'; import { AgencyListComponent } from './agency-list/agency-list.component'; -import { AgencyCreateModule } from './agency-create/agency-create.module'; + import { AgencyPreviewComponent } from './agency-preview/agency-preview.component'; -import { ImportDialogModule } from '../shared/import-dialog/import-dialog.module'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatMenuItem } from '@angular/material/menu'; @@ -69,10 +68,9 @@ import { map } from 'rxjs/operators'; templateUrl: './agency.component.html', styleUrls: ['./agency.component.scss'], imports: [ - AgencyCreateModule, + AgencyCreateComponent, AgencyListComponent, AgencyPreviewComponent, - ImportDialogModule, MatMenuItem, MatProgressSpinnerModule, MatSidenavModule, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts index 3fbb9d08b17..c23b4b826fb 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Collection, ProfiledSchemaElement } from 'vitamui-library'; +import { ProfiledSchemaElement } from 'vitamui-library'; +import { Collection } from 'vitamui-library'; export const schema: ProfiledSchemaElement[] = [ { diff --git a/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts b/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts index c531ef929d8..2585326ac58 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { ApplicationId, Role, SecurityService, TenantSelectionService } from 'vitamui-library'; +import { SecurityService, TenantSelectionService } from 'vitamui-library'; +import { ApplicationId, Role } from 'vitamui-library'; import { inject } from '@angular/core'; import { CanActivateFn, Router } from '@angular/router'; import { Observable, of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts index 94c78f0ae96..fef764e20e3 100644 --- a/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts @@ -43,15 +43,14 @@ import { AppComponent } from './app.component'; // eslint-disable-next-line @angular-eslint/component-selector selector: 'vitamui-common-subrogation-banner', template: '', - standalone: false, + imports: [RouterTestingModule], }) class SubrogationBannerStubComponent {} describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [RouterTestingModule], - declarations: [SubrogationBannerStubComponent, AppComponent], + imports: [RouterTestingModule, SubrogationBannerStubComponent, AppComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/app.component.ts b/ui/ui-frontend/projects/referential/src/app/app.component.ts index dbb21c617f1..eeebbe2a06f 100644 --- a/ui/ui-frontend/projects/referential/src/app/app.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/app.component.ts @@ -35,12 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; +import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { RouterOutlet } from '@angular/router'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], - standalone: false, + imports: [HeaderModule, VitamuiBodyComponent, RouterOutlet, FooterComponent, SubrogationModule], }) export class AppComponent { title = 'Referential App'; diff --git a/ui/ui-frontend/projects/referential/src/app/app.module.ts b/ui/ui-frontend/projects/referential/src/app/app.module.ts deleted file mode 100644 index 161fd4bbc66..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/app.module.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { DatePipe, registerLocaleData } from '@angular/common'; -import { default as localeFr } from '@angular/common/locales/fr'; -import { LOCALE_ID, NgModule } from '@angular/core'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ServiceWorkerModule } from '@angular/service-worker'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; -import { CoreModule } from './core/core.module'; -import { - AuthenticationModule, - BASE_URL, - BytesPipe, - ENVIRONMENT, - InjectorModule, - provideI18n, - VitamUICommonModule, - WINDOW_LOCATION, -} from 'vitamui-library'; -import { provideNativeDateAdapter } from '@angular/material/core'; - -registerLocaleData(localeFr, 'fr'); - -@NgModule({ - declarations: [AppComponent], - imports: [ - CoreModule, - AuthenticationModule.forRoot(), - InjectorModule, - BrowserAnimationsModule, - BrowserModule, - VitamUICommonModule.forRoot(), - AppRoutingModule, - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: environment.production, - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ], - providers: [ - provideI18n(), - provideNativeDateAdapter(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { provide: BASE_URL, useValue: './referential-api' }, - { provide: ENVIRONMENT, useValue: environment }, - { provide: WINDOW_LOCATION, useValue: window.location }, - BytesPipe, - DatePipe, - ], - bootstrap: [AppComponent], -}) -export class AppModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-create/audit-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-create/audit-create.component.spec.ts index 094f8a6d07c..f47efce8a70 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-create/audit-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-create/audit-create.component.spec.ts @@ -51,7 +51,7 @@ describe.skip('AuditCreateComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AuditCreateComponent], + imports: [AuditCreateComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts index 5041a7ebb04..7bfc1a58608 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts @@ -82,8 +82,7 @@ describe('AuditListComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [AuditListComponent], - imports: [VitamUICommonTestModule], + imports: [VitamUICommonTestModule, AuditListComponent], providers: [{ provide: AuditService, useValue: auditServiceMock }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts index 73e61f1902f..ef9edce9657 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts @@ -37,9 +37,29 @@ import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { merge, Subject, Subscription, timer } from 'rxjs'; import { debounceTime, switchMap } from 'rxjs/operators'; -import { DEFAULT_PAGE_SIZE, Direction, Event, InfiniteScrollTable, PageRequest } from 'vitamui-library'; +import { + DEFAULT_PAGE_SIZE, + Direction, + Event, + InfiniteScrollTable, + PageRequest, + TableFilterDirective, + OrderByButtonComponent, + EventTypeLabelComponent, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; import { AUDIT_CATEGORY_FILTER_EV_TYPE, AuditCategoryFilter, AuditChainType, AuditOperation } from '../../models/audit.interface'; import { AuditService } from '../audit.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; +import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; +import { EventTypeColorClassPipe } from '../../shared/pipes/event-type-color-class.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; const POLLING_INTERVAL_MS = 5000; @@ -71,7 +91,23 @@ export class AuditFilters { selector: 'app-audit-list', templateUrl: './audit-list.component.html', styleUrls: ['./audit-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + OrderByButtonComponent, + NgClass, + EventTypeLabelComponent, + MatProgressSpinner, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + LastEventPipe, + EventTypeBadgeClassPipe, + EventTypeColorClassPipe, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class AuditListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { auditService: AuditService; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts index 64e54f346cf..7c0fdeec90f 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; -import type { Event } from 'vitamui-library'; +import { Event } from 'vitamui-library'; import { VitamUICommonModule, VitamUILibraryModule, PipesModule } from 'vitamui-library'; import { CommonModule } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts index 5ca070b6774..7c57388772d 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts @@ -37,16 +37,13 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CUSTOM_ELEMENTS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ExternalParameters, ExternalParametersService, LoggerModule, SnackBarService } from 'vitamui-library'; +import { BASE_URL, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { ExternalParameters, LoggerModule } from 'vitamui-library'; import { AuditPreviewComponent } from './audit-preview.component'; import { AuditService } from '../audit.service'; -import { PipesModule } from '../../shared/pipes/pipes.module'; import { ActivatedRoute } from '@angular/router'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -68,7 +65,6 @@ describe('AuditPreviewComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [MockTruncatePipe], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, @@ -76,7 +72,7 @@ describe('AuditPreviewComponent', () => { { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: SnackBarService, useValue: snackBarSpy }, ], - imports: [AuditPreviewComponent, LoggerModule.forRoot(), PipesModule], + imports: [AuditPreviewComponent, LoggerModule.forRoot(), MockTruncatePipe], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts index f1873c90465..c9a1639dc06 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts @@ -47,10 +47,11 @@ import { AuditService } from '../audit.service'; import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import { MatTabsModule } from '@angular/material/tabs'; -import { PipesModule } from '../../shared/pipes/pipes.module'; + import { AuditInformationTabComponent } from './audit-information-tab/audit-information-tab.component'; import { AuditOperation } from '../../models/audit.interface'; import { TranslatePipe } from '@ngx-translate/core'; +import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; @Component({ selector: 'app-audit-preview', @@ -61,7 +62,7 @@ import { TranslatePipe } from '@ngx-translate/core'; CommonModule, FormsModule, MatTabsModule, - PipesModule, + EventTypeBadgeColorPipe, TranslatePipe, VitamUICommonModule, VitamUILibraryModule, diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts index c7f58d6f3ee..aff77318f4d 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts @@ -46,7 +46,8 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, GlobalEventService } from 'vitamui-library'; +import { DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AuditComponent } from './audit.component'; import { DatePipe } from '@angular/common'; @@ -81,8 +82,8 @@ describe('AuditComponent', () => { NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, + AuditComponent, ], - declarations: [AuditComponent], providers: [ provideNativeDateAdapter(), { provide: BASE_URL, useValue: '/pastis-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts index 37843f04149..d900e237330 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts @@ -35,20 +35,42 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { Event, GlobalEventService, SearchBarComponent, SidenavPage } from 'vitamui-library'; +import { + Event, + GlobalEventService, + SearchBarComponent, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + DatepickerComponent, +} from 'vitamui-library'; import { AuditChainCreateComponent } from './audit-chain-create/audit-chain-create.component'; import { AuditCreateComponent } from './audit-create/audit-create.component'; import { AuditListComponent } from './audit-list/audit-list.component'; import { DateTime } from 'luxon'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { AuditPreviewComponent } from './audit-preview/audit-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-audit', templateUrl: './audit.component.html', styleUrls: ['./audit.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + AuditPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ReactiveFormsModule, + DatepickerComponent, + AuditListComponent, + TranslatePipe, + ], }) export class AuditComponent extends SidenavPage { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.module.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.module.ts index 9b07a37ac49..83387e1d021 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.module.ts @@ -45,7 +45,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule } from 'vitamui-library'; -import { PipesModule } from '../shared/pipes/pipes.module'; + import { AuditRoutingModule } from './audit-routing.module'; import { AuditComponent } from './audit.component'; import { MatInputModule } from '@angular/material/input'; @@ -57,7 +57,6 @@ import { AuditPreviewComponent } from './audit-preview/audit-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [AuditComponent, AuditListComponent], imports: [ CommonModule, RouterModule, @@ -74,8 +73,9 @@ import { TranslatePipe } from '@ngx-translate/core'; MatSelectModule, MatFormFieldModule, MatInputModule, - PipesModule, TranslatePipe, + AuditComponent, + AuditListComponent, ], providers: [{ provide: MAT_DATE_FORMATS, useValue: FR_DATE_FORMAT }], }) diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts index 407887fcdd9..05a119b192f 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts @@ -46,7 +46,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService, OtpState } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { OtpState } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../context.service'; import { ContextCreateComponent } from './context-create.component'; @@ -62,7 +63,16 @@ import { ContextCreateValidators } from './context-create.validators'; multi: true, }, ], - standalone: false, + imports: [ + ReactiveFormsModule, + MatFormFieldModule, + MatSelectModule, + MatButtonToggleModule, + MatProgressBarModule, + NoopAnimationsModule, + MatProgressSpinnerModule, + VitamUICommonTestModule, + ], }) class OwnerFormStubComponent implements ControlValueAccessor { @Input() @@ -155,8 +165,9 @@ describe.skip('ContextCreateComponent', () => { NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, + ContextCreateComponent, + OwnerFormStubComponent, ], - declarations: [ContextCreateComponent, OwnerFormStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts index 7c593ec93f4..268253557d8 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts @@ -38,18 +38,19 @@ import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService, Context, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService, Context, Option } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { SecurityProfileService } from '../../security-profile/security-profile.service'; import { ContextService } from '../context.service'; import { ContextCreateValidators } from './context-create.validators'; -import { ContextEditPermissionModule } from './context-edit-permission/context-edit-permission.module'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; import { SharedModule } from '../../../../../identity/src/app/shared/shared.module'; +import { ContextEditPermissionComponent } from './context-edit-permission/context-edit-permission.component'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ @@ -57,7 +58,6 @@ import { TranslatePipe } from '@ngx-translate/core'; templateUrl: './context-create.component.html', styleUrls: ['./context-create.component.scss'], imports: [ - ContextEditPermissionModule, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -66,6 +66,7 @@ import { TranslatePipe } from '@ngx-translate/core'; MatSelectModule, ReactiveFormsModule, SharedModule, + ContextEditPermissionComponent, VitamUICommonModule, VitamUILibraryModule, TranslatePipe, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts index 89ea72b15c3..d28e9b8f0a2 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts @@ -35,13 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, forwardRef, Input, OnInit, Output, inject } from '@angular/core'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { AccessContractService, AuthService, ContextPermission, Option, Tenant } from 'vitamui-library'; +import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { AccessContractService, AuthService, ContextPermission, Option, Tenant, TooltipDirective, SelectComponent } from 'vitamui-library'; import { CustomerApiService } from '../../../core/api/customer-api.service'; import { TenantApiService } from '../../../core/api/tenant-api.service'; import { IngestContractService } from '../../../ingest-contract/ingest-contract.service'; import { combineLatest } from 'rxjs'; import { map } from 'rxjs/operators'; +import { TranslatePipe } from '@ngx-translate/core'; export const CONTEXT_PERMISSION_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -54,7 +55,7 @@ export const CONTEXT_PERMISSION_VALUE_ACCESSOR: any = { templateUrl: './context-edit-permission.component.html', styleUrls: ['./context-edit-permission.component.scss'], providers: [CONTEXT_PERMISSION_VALUE_ACCESSOR], - standalone: false, + imports: [TooltipDirective, SelectComponent, ReactiveFormsModule, FormsModule, TranslatePipe], }) export class ContextEditPermissionComponent implements ControlValueAccessor, OnInit { private customerApiService = inject(CustomerApiService); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.module.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.module.ts deleted file mode 100644 index 2cc2a07f101..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.module.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { ContextEditPermissionComponent } from './context-edit-permission.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - TranslatePipe, - ], - declarations: [ContextEditPermissionComponent], - exports: [ContextEditPermissionComponent], -}) -export class ContextEditPermissionModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts index a161264feeb..cfd234095d2 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts @@ -35,17 +35,29 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService, ContextPermission } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { ContextPermission, DialogHeaderComponent } from 'vitamui-library'; import { ContextCreateValidators } from '../context-create/context-create.validators'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { ContextEditPermissionComponent } from '../context-create/context-edit-permission/context-edit-permission.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-context-edit', templateUrl: './context-edit.component.html', styleUrls: ['./context-edit.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + ContextEditPermissionComponent, + MatDialogActions, + TranslatePipe, + ], }) export class ContextEditComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.module.ts b/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.module.ts deleted file mode 100644 index 0c5b96fce82..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.module.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../../../../identity/src/app/shared/shared.module'; -import { ContextEditPermissionModule } from '../context-create/context-edit-permission/context-edit-permission.module'; -import { ContextEditComponent } from './context-edit.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - ContextEditPermissionModule, - MatButtonToggleModule, - MatDialogModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - SharedModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [ContextEditComponent], -}) -export class ContextEditModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts index 11de17362b9..eddbf167a8a 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts @@ -42,7 +42,8 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; -import { AuthService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../context.service'; import { ContextListComponent } from './context-list.component'; @@ -72,7 +73,6 @@ describe('ContextListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ContextListComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ VitamUICommonTestModule, @@ -81,6 +81,7 @@ describe('ContextListComponent', () => { InjectorModule, LoggerModule.forRoot(), RouterTestingModule, + ContextListComponent, ], providers: [ { provide: BASE_URL, useValue: '' }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts index 5bdab15cc2d..716c0dfc71d 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts @@ -38,9 +38,24 @@ import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, import { ActivatedRoute } from '@angular/router'; import { merge, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map, takeUntil, tap } from 'rxjs/operators'; -import { Direction, InfiniteScrollTable, PageRequest, DEFAULT_PAGE_SIZE } from 'vitamui-library'; +import { + Direction, + InfiniteScrollTable, + PageRequest, + DEFAULT_PAGE_SIZE, + TableFilterDirective, + OrderByButtonComponent, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; import type { Context, User, AdminUserProfile } from 'vitamui-library'; import { ContextService } from '../context.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -48,7 +63,19 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-context-list', templateUrl: './context-list.component.html', styleUrls: ['./context-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + OrderByButtonComponent, + NgClass, + MatProgressSpinner, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class ContextListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { contextService: ContextService; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.spec.ts index 67456e0c3be..3da342b1eb0 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.spec.ts @@ -63,8 +63,7 @@ describe.skip('ContextInformationTabComponent', () => { }; await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule, MatSelectModule], - declarations: [ContextInformationTabComponent], + imports: [ReactiveFormsModule, VitamUICommonTestModule, MatSelectModule, ContextInformationTabComponent], providers: [ FormBuilder, { provide: SecurityProfileService, useValue: securityProfileServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts index 3ff2d7477f9..a534db3990f 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts @@ -35,22 +35,23 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap, tap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { Context, Option } from 'vitamui-library'; -import { diff } from 'vitamui-library'; +import { Context, Option } from 'vitamui-library'; +import { diff, SlideToggleComponent, InputComponent, SelectComponent, DatepickerComponent } from 'vitamui-library'; import { RULE_TYPES } from '../../../rule/rules.constants'; import { SecurityProfileService } from '../../../security-profile/security-profile.service'; import { ContextService } from '../../context.service'; import { ContextCreateValidators } from '../../context-create/context-create.validators'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-context-information-tab', templateUrl: './context-information-tab.component.html', styleUrls: ['./context-information-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, InputComponent, SelectComponent, DatepickerComponent, TranslatePipe], }) export class ContextInformationTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts index 4993db543b5..b15289f1821 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts @@ -41,7 +41,8 @@ import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY } from 'rxjs'; -import { BASE_URL, Context, ContextPermission, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, Context, ContextPermission, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../../context.service'; @@ -154,9 +155,15 @@ describe('ContextPermissionTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ContextPermissionTabComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [ReactiveFormsModule, VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule], + imports: [ + ReactiveFormsModule, + VitamUICommonTestModule, + InjectorModule, + LoggerModule.forRoot(), + RouterTestingModule, + ContextPermissionTabComponent, + ], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts index b6a8cab107f..5ed6bba7a74 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts @@ -38,21 +38,22 @@ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular import { MatDialog } from '@angular/material/dialog'; import { Observable, forkJoin, of } from 'rxjs'; import { catchError, filter, map, switchMap, tap } from 'rxjs/operators'; -import type { AccessContract, Context, Customer, IngestContract, Tenant } from 'vitamui-library'; -import { ContextPermission } from 'vitamui-library'; -import { diff, AccessContractService, AuthService } from 'vitamui-library'; +import { AccessContract, Context, Customer, IngestContract, Tenant, AccessContractService, AuthService } from 'vitamui-library'; +import { ContextPermission, diff } from 'vitamui-library'; import { extend, isEmpty } from 'underscore'; import { CustomerApiService } from '../../../core/api/customer-api.service'; import { TenantApiService } from '../../../core/api/tenant-api.service'; import { IngestContractService } from '../../../ingest-contract/ingest-contract.service'; import { ContextEditComponent } from '../../context-edit/context-edit.component'; import { ContextService } from '../../context.service'; +import { MatDivider } from '@angular/material/divider'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-context-permission-tab', templateUrl: './context-permission-tab.component.html', styleUrls: ['./context-permission-tab.component.scss'], - standalone: false, + imports: [MatDivider, TranslatePipe], }) export class ContextPermissionTabComponent implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts index 36c995c86bc..c87838ea9c9 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts @@ -47,8 +47,7 @@ describe('ContextPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [ContextPreviewComponent], + imports: [ContextPreviewComponent], providers: [ { provide: MatDialog, useValue: {} }, { provide: ContextService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts index 448d37346ca..b64c92a9642 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts @@ -34,21 +34,40 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import type { Context } from 'vitamui-library'; -import { ConfirmActionComponent } from 'vitamui-library'; +import { Context, ConfirmActionComponent } from 'vitamui-library'; +import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; import { ContextService } from '../context.service'; import { ContextInformationTabComponent } from './context-information-tab/context-information-tab.component'; import { ContextPermissionTabComponent } from './context-permission-tab/context-permission-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-context-preview', templateUrl: './context-preview.component.html', styleUrls: ['./context-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + ContextInformationTabComponent, + ContextPermissionTabComponent, + OperationHistoryTabComponent, + forwardRef(() => ContextPreviewComponent), + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class ContextPreviewComponent implements AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.module.ts deleted file mode 100644 index 02ed32e4425..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.module.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatDividerModule } from '@angular/material/divider'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { ContextEditPermissionModule } from '../context-create/context-edit-permission/context-edit-permission.module'; -import { ContextInformationTabComponent } from './context-information-tab/context-information-tab.component'; -import { ContextPermissionTabComponent } from './context-permission-tab/context-permission-tab.component'; -import { ContextPreviewComponent } from './context-preview.component'; -import { MatDatepickerModule } from '@angular/material/datepicker'; -import { MatInputModule } from '@angular/material/input'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - ContextEditPermissionModule, - RouterModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatSidenavModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - MatDividerModule, - MatDatepickerModule, - MatInputModule, - TranslatePipe, - ], - declarations: [ContextPreviewComponent, ContextInformationTabComponent, ContextPermissionTabComponent], - exports: [ContextPreviewComponent], -}) -export class ContextPreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts index f4b1a1cd5c2..75096d2d1ed 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts @@ -40,7 +40,8 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { ApplicationService, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ApplicationService, GlobalEventService } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; @@ -52,7 +53,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' @Component({ selector: 'app-agency-preview', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class ContextPreviewStub { @Input() @@ -62,7 +63,7 @@ class ContextPreviewStub { @Component({ selector: 'app-agency-list', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class ContextListStub {} @@ -77,7 +78,6 @@ describe('ContextComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ContextComponent, ContextListStub, ContextPreviewStub], schemas: [NO_ERRORS_SCHEMA], imports: [ VitamUICommonTestModule, @@ -87,6 +87,9 @@ describe('ContextComponent', () => { NoopAnimationsModule, MatSidenavModule, MatDialogModule, + ContextComponent, + ContextListStub, + ContextPreviewStub, ], providers: [ { provide: ApplicationService, useValue: applicationServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.ts index d77e396f5e9..4083dabb987 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.ts @@ -38,18 +38,37 @@ import { Component, OnInit, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { ApplicationService, Context, GlobalEventService, SidenavPage } from 'vitamui-library'; +import { + ApplicationService, + Context, + GlobalEventService, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { ContextCreateComponent } from './context-create/context-create.component'; import { ContextListComponent } from './context-list/context-list.component'; import { shareReplay } from 'rxjs/operators'; import { firstValueFrom } from 'rxjs'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { ContextPreviewComponent } from './context-preview/context-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-context', templateUrl: './context.component.html', styleUrls: ['./context.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + ContextPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ContextListComponent, + TranslatePipe, + ], }) export class ContextComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.module.ts b/ui/ui-frontend/projects/referential/src/app/context/context.module.ts index 8e147f3fd54..23374965eb1 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.module.ts @@ -43,9 +43,8 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule } from 'vitamui-library'; -import { ContextEditModule } from './context-edit/context-edit.module'; import { ContextListComponent } from './context-list/context-list.component'; -import { ContextPreviewModule } from './context-preview/context-preview.module'; + import { ContextRoutingModule } from './context-routing.module'; import { ContextComponent } from './context.component'; import { ContextCreateComponent } from './context-create/context-create.component'; @@ -58,14 +57,13 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, ContextRoutingModule, ContextCreateComponent, - ContextEditModule, - ContextPreviewModule, MatMenuModule, MatDialogModule, MatSidenavModule, MatProgressSpinnerModule, TranslatePipe, + ContextComponent, + ContextListComponent, ], - declarations: [ContextComponent, ContextListComponent], }) export class ContextModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.service.ts b/ui/ui-frontend/projects/referential/src/app/context/context.service.ts index 53e10610de9..25cc977cb7b 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.service.ts @@ -38,7 +38,8 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { Context, SearchService, VitamuiHttpHeaders, SnackBarService } from 'vitamui-library'; +import { Context, SearchService, SnackBarService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { ContextApiService } from '../core/api/context-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts index d7aedf608af..dd2b0be208b 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { AgencyApiService, BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts index d11ae75bd13..2017f7160df 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CustomerApiService } from './customer-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts index b2e9a38c26c..c639eadec21 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { IngestContractApiService } from './ingest-contract-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts index b4aebb8669c..1a428d93b48 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { LogbookManagementOperationApiService } from './logbook-management-operation-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts index af5a18e1f5b..d23184811fc 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts @@ -66,7 +66,8 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { ManagementContractsApiService } from './management-contracts-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts index 633afc24727..5ccf63657f9 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OntologyApiService } from './ontology-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts index 593dbe0014a..1583969ae44 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OperationApiService } from './operation-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts index 39539e6be11..01045b6cdcd 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts @@ -38,7 +38,8 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { BASE_URL, PaginatedHttpClient, Event, PageRequest, PaginatedResponse, VitamuiHttpHeaders } from 'vitamui-library'; +import { BASE_URL, PaginatedHttpClient, Event, PageRequest, PaginatedResponse } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { TraceabilityChainAuditRequest } from '../../models/audit.interface'; @Injectable({ diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts index d7aedf608af..dd2b0be208b 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { AgencyApiService, BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/core.module.ts b/ui/ui-frontend/projects/referential/src/app/core/core.module.ts index 46e7273ec82..0675f680c26 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/core.module.ts @@ -37,7 +37,8 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { InjectionToken, NgModule, inject } from '@angular/core'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; export declare const BASE_URL_IDENTITY: InjectionToken; diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts index d054142b3cc..08318b6b617 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts @@ -110,8 +110,8 @@ describe.skip(' FileFormatCreateComponent', () => { NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, + FileFormatCreateComponent, ], - declarations: [FileFormatCreateComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts index c93c7c4ffec..956c9353f77 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts @@ -35,8 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { map, tap } from 'rxjs/operators'; import { @@ -46,15 +46,29 @@ import { Option, StartupService, VitamuiSelectOptions, + DialogHeaderComponent, + InputComponent, + SelectComponent, } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { FileFormatCreateValidators } from './file-format-create.validators'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-file-format-create', templateUrl: './file-format-create.component.html', styleUrls: ['./file-format-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + InputComponent, + SelectComponent, + MatDialogActions, + TranslatePipe, + ], }) export class FileFormatCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.module.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.module.ts deleted file mode 100644 index 520e4528fa2..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.module.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { SelectComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../../../../identity/src/app/shared/shared.module'; -import { FileFormatCreateComponent } from './file-format-create.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatDialogModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - SelectComponent, - SharedModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [FileFormatCreateComponent], -}) -export class FileFormatCreateModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts index 9d9b721cb7b..bff138bf7e8 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts @@ -49,9 +49,8 @@ describe('FileFormatListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [FileFormatListComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [], + imports: [FileFormatListComponent], providers: [ { provide: BASE_URL, useValue: '' }, FileFormatService, diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts index 366ad58e46b..79014628dea 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts @@ -36,21 +36,33 @@ */ import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subject, merge } from 'rxjs'; import { debounceTime, filter, takeUntil } from 'rxjs/operators'; -import type { AdminUserProfile, FileFormat, User } from 'vitamui-library'; import { + AdminUserProfile, + FileFormat, + User, ConfirmActionComponent, DEFAULT_PAGE_SIZE, - Direction, FILE_FORMAT_EXTERNAL_PREFIX, InfiniteScrollTable, - PageRequest, StartupService, SnackBarService, } from 'vitamui-library'; +import { + EllipsisDirective, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, + Direction, + PageRequest, + OrderByButtonComponent, + PipesModule, +} from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -58,7 +70,17 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-file-format-list', templateUrl: './file-format-list.component.html', styleUrls: ['./file-format-list.component.scss'], - standalone: false, + imports: [ + OrderByButtonComponent, + MatProgressSpinner, + PipesModule, + TranslatePipe, + CommonModule, + EllipsisDirective, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, + ], }) export class FileFormatListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { fileFormatService: FileFormatService; diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts index 027b6120011..8b9d00e61a9 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts @@ -93,8 +93,7 @@ describe('FileFormatInformationTabComponent', () => { getTenantIdentifier: () => '', }; await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule], - declarations: [FileFormatInformationTabComponent], + imports: [ReactiveFormsModule, VitamUICommonTestModule, FileFormatInformationTabComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts index 8214b6156af..0fbd837c449 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts @@ -34,24 +34,23 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { formatDate } from '@angular/common'; +import { formatDate, AsyncPipe } from '@angular/common'; import { Component, EventEmitter, Input, LOCALE_ID, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { BehaviorSubject, combineLatest, Observable, of, Subscription } from 'rxjs'; import { catchError, filter, map, switchMap, tap } from 'rxjs/operators'; import { extend, isEmpty, omit } from 'underscore'; -import type { FileFormat, VitamuiSelectOptions } from 'vitamui-library'; -import { ApplicationId, Role } from 'vitamui-library'; -import { SecurityService } from 'vitamui-library'; -import { diff, FILE_FORMAT_EXTERNAL_PREFIX } from 'vitamui-library'; +import { FileFormat, VitamuiSelectOptions, SecurityService, FILE_FORMAT_EXTERNAL_PREFIX } from 'vitamui-library'; +import { ApplicationId, Role, InputComponent, SelectComponent, diff } from 'vitamui-library'; import { FileFormatService } from '../../file-format.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-file-format-information-tab', templateUrl: './file-format-information-tab.component.html', styleUrls: ['./file-format-information-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, InputComponent, SelectComponent, AsyncPipe, TranslatePipe], }) export class FileFormatInformationTabComponent { private locale = inject(LOCALE_ID); diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts index a63e42cbcb4..8f1687d211b 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts @@ -47,8 +47,7 @@ describe('FileFormatPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [FileFormatPreviewComponent], + imports: [FileFormatPreviewComponent], providers: [ { provide: MatDialog, useValue: {} }, { provide: FileFormatService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts index 617a1aa104a..cd6b5458a0b 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts @@ -34,20 +34,38 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { ConfirmActionComponent } from 'vitamui-library'; -import type { FileFormat } from 'vitamui-library'; +import { ConfirmActionComponent, FileFormat } from 'vitamui-library'; +import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { FileFormatInformationTabComponent } from './file-format-information-tab/file-format-information-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-file-format-preview', templateUrl: './file-format-preview.component.html', styleUrls: ['./file-format-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + FileFormatInformationTabComponent, + OperationHistoryTabComponent, + forwardRef(() => FileFormatPreviewComponent), + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class FileFormatPreviewComponent implements AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.module.ts deleted file mode 100644 index c5bc5088889..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.module.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { SelectComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { FileFormatInformationTabComponent } from './file-format-information-tab/file-format-information-tab.component'; -import { FileFormatPreviewComponent } from './file-format-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - MatDialogModule, - MatMenuModule, - MatOptionModule, - MatProgressSpinnerModule, - MatSelectModule, - MatSidenavModule, - MatTabsModule, - ReactiveFormsModule, - RouterModule, - SelectComponent, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [FileFormatPreviewComponent, FileFormatInformationTabComponent], - exports: [FileFormatPreviewComponent], -}) -export class FileFormatPreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts index 96cdf8a16f9..b8b1f3f99ce 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts @@ -39,7 +39,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; +import { SecurityService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; @@ -49,7 +50,7 @@ import { of } from 'rxjs'; @Component({ selector: 'app-file-format-preview', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class AgencyPreviewStub { @Input() @@ -59,7 +60,7 @@ class AgencyPreviewStub { @Component({ selector: 'app-file-format-list', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class AgencyListStub {} @@ -69,7 +70,6 @@ describe('FileFormatComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [FileFormatComponent, AgencyListStub, AgencyPreviewStub], imports: [ VitamUICommonTestModule, RouterTestingModule, @@ -78,6 +78,9 @@ describe('FileFormatComponent', () => { NoopAnimationsModule, MatSidenavModule, MatDialogModule, + FileFormatComponent, + AgencyListStub, + AgencyPreviewStub, ], providers: [ { diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts index fb70fa86461..31f6da7dc42 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts @@ -38,19 +38,42 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Observable, Subscription } from 'rxjs'; -import { ApplicationId, FileFormat, FileTypes, GlobalEventService, Role, SecurityService, SidenavPage } from 'vitamui-library'; +import { + ApplicationId, + FileFormat, + FileTypes, + GlobalEventService, + Role, + SecurityService, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; import { FileFormatCreateComponent } from './file-format-create/file-format-create.component'; import { FileFormatListComponent } from './file-format-list/file-format-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { FileFormatPreviewComponent } from './file-format-preview/file-format-preview.component'; +import { AsyncPipe } from '@angular/common'; @Component({ selector: 'app-file-format', templateUrl: './file-format.component.html', styleUrls: ['./file-format.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + FileFormatPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + FileFormatListComponent, + AsyncPipe, + TranslatePipe, + ], }) export class FileFormatComponent extends SidenavPage implements OnInit, OnDestroy { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.module.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.module.ts index 3db23cb1bb6..68a17330a85 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.module.ts @@ -42,12 +42,12 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { FileFormatCreateModule } from './file-format-create/file-format-create.module'; + import { FileFormatListComponent } from './file-format-list/file-format-list.component'; -import { FileFormatPreviewModule } from './file-format-preview/file-format-preview.module'; + import { FileFormatRoutingModule } from './file-format-routing.module'; import { FileFormatComponent } from './file-format.component'; -import { ImportDialogModule } from '../shared/import-dialog/import-dialog.module'; + import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ @@ -57,15 +57,13 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, VitamUILibraryModule, FileFormatRoutingModule, - FileFormatCreateModule, - FileFormatPreviewModule, - ImportDialogModule, MatMenuModule, MatDialogModule, MatSidenavModule, MatProgressSpinnerModule, TranslatePipe, + FileFormatComponent, + FileFormatListComponent, ], - declarations: [FileFormatComponent, FileFormatListComponent], }) export class FileFormatModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts index dc21207e24f..78128fb3240 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts @@ -38,7 +38,8 @@ import { HttpHeaders, HttpParams } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { FILE_FORMAT_EXTERNAL_PREFIX, FileFormat, SearchService, VitamuiHttpHeaders, SnackBarService } from 'vitamui-library'; +import { FILE_FORMAT_EXTERNAL_PREFIX, FileFormat, SearchService, SnackBarService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { FileFormatApiService } from '../core/api/file-format-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.spec.ts index bb2d1df3bfe..fb476088c27 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.spec.ts @@ -57,8 +57,7 @@ describe('IngestContractListComponent', () => { }; await TestBed.configureTestingModule({ - imports: [], - declarations: [IngestContractListComponent], + imports: [IngestContractListComponent], providers: [ { provide: IngestContractService, useValue: ingestContractServiceMock }, { provide: IngestContractService, useValue: ingestContractServiceSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts index 00e49ce1782..b20a0cb6140 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts @@ -37,9 +37,25 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { Subject, Subscription, merge } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, IngestContract, PageRequest } from 'vitamui-library'; +import { + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollTable, + IngestContract, + PageRequest, + TableFilterDirective, + OrderByButtonComponent, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; import { IngestContractService } from '../ingest-contract.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -47,7 +63,19 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-ingest-contract-list', templateUrl: './ingest-contract-list.component.html', styleUrls: ['./ingest-contract-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + OrderByButtonComponent, + NgClass, + MatProgressSpinner, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class IngestContractListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { ingestContractService: IngestContractService; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts index 70ea50301ae..ed87e6a6259 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts @@ -93,9 +93,8 @@ describe('IngestContractAttachmentTabComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [IngestContractAttachmentTabComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [LoggerModule.forRoot()], + imports: [LoggerModule.forRoot(), IngestContractAttachmentTabComponent], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts index af138bc7fae..05db70bd240 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts @@ -37,16 +37,16 @@ import { HttpHeaders } from '@angular/common/http'; import { Component, Input, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import type { IngestContract } from 'vitamui-library'; +import { IngestContract, ExternalParametersService, SearchUnitApiService, SnackBarService } from 'vitamui-library'; import { ExternalParameters, VitamuiHttpHeaders } from 'vitamui-library'; -import { ExternalParametersService, SearchUnitApiService, SnackBarService } from 'vitamui-library'; import { IngestContractNodeUpdateComponent } from './ingest-contract-nodes-update/ingest-contract-node-update.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-contract-attachment-tab', templateUrl: './ingest-contract-attachment-tab.component.html', styleUrls: ['./ingest-contract-attachment-tab.component.scss'], - standalone: false, + imports: [TranslatePipe], }) export class IngestContractAttachmentTabComponent { private unitService = inject(SearchUnitApiService); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts index 8fe6e17b6b7..67db5fe99f3 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts @@ -37,14 +37,20 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; +import { ReactiveFormsModule, FormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { BASE_URL, ENVIRONMENT, FilingPlanModule, InjectorModule, LoggerModule, SnackBarService } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule, SnackBarService, FilingPlanComponent } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../../../environments/environment'; import { IngestContractNodeUpdateComponent } from './ingest-contract-node-update.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatButtonModule } from '@angular/material/button'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; +import { MatTreeModule } from '@angular/material/tree'; // TODO fix tests @@ -66,9 +72,21 @@ describe.skip('IngestContractNodeUpdateComponent', () => { open: vi.fn().mockName('SnackBarService.open'), }; await TestBed.configureTestingModule({ - declarations: [IngestContractNodeUpdateComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [ReactiveFormsModule, VitamUICommonTestModule, FilingPlanModule, InjectorModule, LoggerModule.forRoot()], + imports: [ + ReactiveFormsModule, + VitamUICommonTestModule, + InjectorModule, + LoggerModule.forRoot(), + IngestContractNodeUpdateComponent, + CommonModule, + FilingPlanComponent, + FormsModule, + MatButtonModule, + MatCheckboxModule, + MatProgressSpinnerModule, + MatTreeModule, + ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts index 8f9cd2ad2f5..cbb070e81bd 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts @@ -35,16 +35,55 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { FilingPlanMode, IngestContract } from 'vitamui-library'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { + FilingPlanMode, + IngestContract, + DialogHeaderComponent, + StepperComponent, + NextStepComponent, + TooltipDirective, + PreviousStepComponent, + FilingPlanComponent, +} from 'vitamui-library'; import { IngestContractService } from '../../../ingest-contract.service'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { MatButtonModule } from '@angular/material/button'; +import { MatTreeModule } from '@angular/material/tree'; +import { CommonModule } from '@angular/common'; +import { MatCheckboxModule } from '@angular/material/checkbox'; @Component({ selector: 'app-ingest-contract-node-update', templateUrl: './ingest-contract-node-update.component.html', styleUrls: ['./ingest-contract-node-update.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + MatDialogActions, + NextStepComponent, + MatButtonToggleGroup, + MatButtonToggle, + TooltipDirective, + PreviousStepComponent, + TranslatePipe, + CommonModule, + FilingPlanComponent, + FormsModule, + MatButtonModule, + MatCheckboxModule, + MatProgressSpinnerModule, + MatTreeModule, + ], }) export class IngestContractNodeUpdateComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.spec.ts index ced872c816c..af83e605c04 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.spec.ts @@ -84,8 +84,7 @@ describe('IngestContractFormatTabComponent', () => { getAllForTenant: () => of([]), }; await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule], - declarations: [IngestContractFormatTabComponent], + imports: [ReactiveFormsModule, VitamUICommonTestModule, IngestContractFormatTabComponent], providers: [ { provide: IngestContractService, useValue: {} }, { provide: FileFormatService, useValue: fileFormatServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts index f7e56e8257e..4aa4c0e0730 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts @@ -35,20 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { diff, VitamuiSelectOptions } from 'vitamui-library'; -import type { FileFormat, IngestContract } from 'vitamui-library'; +import { VitamuiSelectOptions, FileFormat, IngestContract } from 'vitamui-library'; +import { diff, SlideToggleComponent, SelectComponent } from 'vitamui-library'; import { FileFormatService } from '../../../file-format/file-format.service'; import { IngestContractService } from '../../ingest-contract.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-contract-format-tab', templateUrl: './ingest-contract-format-tab.component.html', styleUrls: ['./ingest-contract-format-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, SelectComponent, TranslatePipe], }) export class IngestContractFormatTabComponent implements OnInit { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.spec.ts index 631d02f58e1..5b44cf9d36a 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.spec.ts @@ -77,8 +77,7 @@ describe('IngestContractHeritageTabComponent', () => { TestBed.overrideComponent(IngestContractHeritageTabComponent, { set: { template: '' } }); await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule], - declarations: [IngestContractHeritageTabComponent], + imports: [ReactiveFormsModule, VitamUICommonTestModule, IngestContractHeritageTabComponent], providers: [FormBuilder, { provide: IngestContractService, useValue: {} }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts index 12706b6dabc..13b9c8e686f 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts @@ -35,20 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { diff } from 'vitamui-library'; -import type { IngestContract } from 'vitamui-library'; +import { IngestContract } from 'vitamui-library'; +import { diff, SlideToggleComponent } from 'vitamui-library'; import { IngestContractService } from '../../ingest-contract.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-contract-heritage-tab', templateUrl: './ingest-contract-heritage-tab.component.html', styleUrls: ['./ingest-contract-heritage-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, TranslatePipe], }) export class IngestContractHeritageTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts index ac2674c93e1..62b87d42c2e 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts @@ -36,23 +36,24 @@ */ import { HttpHeaders, HttpParams } from '@angular/common/http'; import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { diff, Option, VitamuiHttpHeaders } from 'vitamui-library'; -import type { IngestContract } from 'vitamui-library'; +import { Option, IngestContract } from 'vitamui-library'; +import { diff, VitamuiHttpHeaders, SlideToggleComponent, InputComponent, SelectComponent, PipesModule } from 'vitamui-library'; import { ArchiveProfileApiService } from '../../../core/api/archive-profile-api.service'; import { ManagementContractApiService } from '../../../core/api/management-contract-api.service'; import { IngestContractCreateValidators } from '../../ingest-contract-create/ingest-contract-create.validators'; import { IngestContractService } from '../../ingest-contract.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-contract-information-tab', templateUrl: './ingest-contract-information-tab.component.html', styleUrls: ['./ingest-contract-information-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, InputComponent, SelectComponent, FormsModule, PipesModule, TranslatePipe], }) export class IngestContractInformationTabComponent implements OnInit { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts index 769e3cdfc47..22ee5f057c5 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts @@ -80,8 +80,14 @@ describe('IngestContractObjectTabComponent', () => { TestBed.overrideComponent(IngestContractObjectTabComponent, { set: { template: '' } }); await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, FormsModule, VitamUICommonTestModule, MatSelectModule, NoopAnimationsModule], - declarations: [IngestContractObjectTabComponent], + imports: [ + ReactiveFormsModule, + FormsModule, + VitamUICommonTestModule, + MatSelectModule, + NoopAnimationsModule, + IngestContractObjectTabComponent, + ], providers: [FormBuilder, { provide: IngestContractService, useValue: {} }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts index 24f9032806e..34a1f6d0e96 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts @@ -35,20 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { diff, Option } from 'vitamui-library'; -import type { IngestContract } from 'vitamui-library'; +import { Option, IngestContract } from 'vitamui-library'; +import { diff, SlideToggleComponent, SelectComponent } from 'vitamui-library'; import { IngestContractService } from '../../ingest-contract.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-contract-object-tab', templateUrl: './ingest-contract-object-tab.component.html', styleUrls: ['./ingest-contract-object-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, SelectComponent, TranslatePipe], }) export class IngestContractObjectTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.spec.ts index e2de57e82d4..7d2a2fc89a2 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.spec.ts @@ -74,8 +74,7 @@ describe('IngestContractPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [IngestContractPreviewComponent], + imports: [IngestContractPreviewComponent], providers: [ { provide: MatDialog, useValue: {} }, { provide: IngestContractService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts index 319ce40416d..80a6836c838 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts @@ -45,24 +45,49 @@ import { SimpleChanges, ViewChild, inject, + forwardRef, } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { ConfirmActionComponent } from 'vitamui-library'; -import type { IngestContract } from 'vitamui-library'; +import { ConfirmActionComponent, IngestContract } from 'vitamui-library'; +import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { IngestContractService } from '../ingest-contract.service'; import { IngestContractFormatTabComponent } from './ingest-contract-format-tab/ingest-contract-format-tab.component'; import { IngestContractHeritageTabComponent } from './ingest-contract-heritage-tab/ingest-contract-heritage-tab.component'; import { IngestContractInformationTabComponent } from './ingest-contract-information-tab/ingest-contract-information-tab.component'; import { IngestContractObjectTabComponent } from './ingest-contract-object-tab/ingest-contract-object-tab.component'; import { IngestContractSignatureTabComponent } from './ingest-contract-signature-tab/ingest-contract-signature-tab.component'; +import { IngestContractAttachmentTabComponent } from './ingest-contract-attachment-tab/ingest-contract-attachment-tab.component'; + +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-ingest-contract-preview', templateUrl: './ingest-contract-preview.component.html', styleUrls: ['./ingest-contract-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + IngestContractInformationTabComponent, + IngestContractFormatTabComponent, + IngestContractObjectTabComponent, + IngestContractHeritageTabComponent, + IngestContractAttachmentTabComponent, + IngestContractSignatureTabComponent, + OperationHistoryTabComponent, + forwardRef(() => IngestContractPreviewComponent), + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class IngestContractPreviewComponent implements OnChanges, AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.module.ts deleted file mode 100644 index e0ea34b2c65..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.module.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { SelectComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { IngestContractAttachmentTabComponent } from './ingest-contract-attachment-tab/ingest-contract-attachment-tab.component'; -import { IngestContractNodeUpdateComponent } from './ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component'; -import { IngestContractFormatTabComponent } from './ingest-contract-format-tab/ingest-contract-format-tab.component'; -import { IngestContractHeritageTabComponent } from './ingest-contract-heritage-tab/ingest-contract-heritage-tab.component'; -import { IngestContractInformationTabComponent } from './ingest-contract-information-tab/ingest-contract-information-tab.component'; -import { IngestContractObjectTabComponent } from './ingest-contract-object-tab/ingest-contract-object-tab.component'; -import { IngestContractPreviewComponent } from './ingest-contract-preview.component'; -import { IngestContractSignatureTabComponent } from './ingest-contract-signature-tab/ingest-contract-signature-tab.component'; -import { MatCheckbox } from '@angular/material/checkbox'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ - IngestContractPreviewComponent, - IngestContractInformationTabComponent, - IngestContractFormatTabComponent, - IngestContractObjectTabComponent, - IngestContractSignatureTabComponent, - IngestContractAttachmentTabComponent, - IngestContractNodeUpdateComponent, - IngestContractHeritageTabComponent, - ], - imports: [ - CommonModule, - FormsModule, - MatButtonToggleModule, - MatDialogModule, - MatFormFieldModule, - MatInputModule, - MatMenuModule, - MatOptionModule, - MatProgressSpinnerModule, - MatSelectModule, - MatSidenavModule, - MatTabsModule, - ReactiveFormsModule, - RouterModule, - SelectComponent, - VitamUICommonModule, - VitamUILibraryModule, - MatCheckbox, - TranslatePipe, - ], - exports: [IngestContractPreviewComponent], -}) -export class IngestContractPreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.spec.ts index c45ddc0c2ea..c629b338f13 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.spec.ts @@ -54,8 +54,13 @@ describe('IngestContractSignatureTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, VitamUICommonTestModule, MatButtonToggleModule, MatCheckboxModule], - declarations: [IngestContractSignatureTabComponent], + imports: [ + ReactiveFormsModule, + VitamUICommonTestModule, + MatButtonToggleModule, + MatCheckboxModule, + IngestContractSignatureTabComponent, + ], providers: [FormBuilder, { provide: IngestContractService, useValue: ingestContractServiceSpy }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts index 1801f053f29..2176a94481c 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts @@ -35,17 +35,20 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnChanges, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { EMPTY, Observable } from 'rxjs'; +import { IngestContract, SignaturePolicy } from 'vitamui-library'; import { SignedDocumentPolicyEnum } from 'vitamui-library'; -import type { IngestContract, SignaturePolicy } from 'vitamui-library'; import { IngestContractService } from '../../ingest-contract.service'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatCheckbox } from '@angular/material/checkbox'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-ingest-contract-signature-tab', templateUrl: './ingest-contract-signature-tab.component.html', styleUrls: ['./ingest-contract-signature-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, MatButtonToggleGroup, MatButtonToggle, MatCheckbox, TranslatePipe], }) export class IngestContractSignatureTabComponent implements OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts index c42920d7ea1..00f1caf36e2 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts @@ -40,7 +40,8 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { ApplicationService, BASE_URL, GlobalEventService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { ApplicationService, BASE_URL, GlobalEventService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; @@ -65,9 +66,8 @@ describe('IngestContractComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [IngestContractComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, LoggerModule.forRoot()], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, LoggerModule.forRoot(), IngestContractComponent], providers: [ GlobalEventService, { provide: ApplicationService, useValue: applicationServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts index 3b53346286f..1815ae129fd 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts @@ -47,6 +47,9 @@ import { SecurityService, SidenavPage, SnackBarService, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, } from 'vitamui-library'; import { DownloadSnackBarService } from './../core/service/download-snack-bar.service'; import { firstValueFrom, Observable, Subscription } from 'rxjs'; @@ -54,10 +57,14 @@ import { mergeMap, shareReplay } from 'rxjs/operators'; import { IngestContractCreateComponent } from './ingest-contract-create/ingest-contract-create.component'; import { IngestContractListComponent } from './ingest-contract-list/ingest-contract-list.component'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; import { IngestContractService } from './ingest-contract.service'; import { HttpResponse } from '@angular/common/http'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { IngestContractPreviewComponent } from './ingest-contract-preview/ingest-contract-preview.component'; +import { MatMenuItem } from '@angular/material/menu'; +import { AsyncPipe } from '@angular/common'; const IMPORT_FILE_MODEL_NAME = 'Import_ingest_contract_template.csv'; @@ -65,7 +72,19 @@ const IMPORT_FILE_MODEL_NAME = 'Import_ingest_contract_template.csv'; selector: 'app-ingest-contract', templateUrl: './ingest-contract.component.html', styleUrls: ['./ingest-contract.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + IngestContractPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + IngestContractListComponent, + AsyncPipe, + TranslatePipe, + ], }) export class IngestContractComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.module.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.module.ts index c7ce36de2a0..225b9769cad 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.module.ts @@ -45,16 +45,14 @@ import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule } from 'vitamui-library'; -import { ImportDialogModule } from '../shared/import-dialog/import-dialog.module'; import { IngestContractListComponent } from './ingest-contract-list/ingest-contract-list.component'; -import { IngestContractPreviewModule } from './ingest-contract-preview/ingest-contract-preview.module'; + import { IngestContractRoutingModule } from './ingest-contract-routing.module'; import { IngestContractComponent } from './ingest-contract.component'; import { IngestContractCreateComponent } from './ingest-contract-create/ingest-contract-create.component'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [IngestContractComponent, IngestContractListComponent], imports: [ CommonModule, RouterModule, @@ -67,10 +65,10 @@ import { TranslatePipe } from '@ngx-translate/core'; MatProgressSpinnerModule, MatTabsModule, IngestContractRoutingModule, - IngestContractPreviewModule, IngestContractCreateComponent, - ImportDialogModule, TranslatePipe, + IngestContractComponent, + IngestContractListComponent, ], }) export class IngestContractModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts index 8ddc30192d0..384d933ebde 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts @@ -38,7 +38,8 @@ import { HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { IngestContract, SearchService, VitamuiHttpHeaders, SnackBarService } from 'vitamui-library'; +import { IngestContract, SearchService, SnackBarService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { IngestContractApiService } from '../core/api/ingest-contract-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts index 1b192fc5235..464e5f45203 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts @@ -44,10 +44,7 @@ import { LogbookManagementOperationService } from '../logbook-management-operati import { LogbookManagementOperationListComponent } from './logbook-management-operation-list.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -113,9 +110,8 @@ describe('LogbookManagementOperationListComponent', () => { context: [], }; await TestBed.configureTestingModule({ - declarations: [LogbookManagementOperationListComponent, MockTruncatePipe], schemas: [NO_ERRORS_SCHEMA], - imports: [VitamUICommonTestModule], + imports: [VitamUICommonTestModule, LogbookManagementOperationListComponent, MockTruncatePipe], providers: [ { provide: LogbookManagementOperationService, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts index 908af3a7733..1af2b54963e 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts @@ -35,17 +35,43 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { Colors, FacetDetails } from 'vitamui-library'; +import { + Colors, + FacetDetails, + LogbookOperationFacetComponent, + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + TooltipDirective, + EventTypeLabelComponent, + PipesModule, + InfiniteScrollDirective, +} from 'vitamui-library'; import { OperationCategory, OperationDetails, OperationsResults } from '../../models/operation-response.interface'; import { LogbookManagementOperationService } from '../logbook-management-operation.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ selector: 'app-logbook-management-operation-list', templateUrl: './logbook-management-operation-list.component.html', styleUrls: ['./logbook-management-operation-list.component.scss'], - standalone: false, + imports: [ + LogbookOperationFacetComponent, + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + TooltipDirective, + EventTypeLabelComponent, + NgClass, + MatProgressSpinner, + PipesModule, + TranslatePipe, + CommonModule, + InfiniteScrollDirective, + ], }) export class LogbookManagementOperationListComponent implements OnInit { logbookManagementOperationService = inject(LogbookManagementOperationService); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.spec.ts index 4559cd684ae..ff5df9a3ff4 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.spec.ts @@ -42,10 +42,7 @@ import { LogbookManagementOperationInformationTabComponent } from './logbook-man let expectedOperation: OperationDetails; -@Component({ - template: ``, - standalone: false, -}) +@Component({ template: `` }) class TestLogbookInformationComponent { operation = expectedOperation; tenantIdentifier = 1; @@ -70,8 +67,7 @@ describe('LogbookManagementOperationInformationTabComponent', () => { forcedCancellation: false, }; await TestBed.configureTestingModule({ - declarations: [LogbookManagementOperationInformationTabComponent, TestLogbookInformationComponent], - imports: [], + imports: [LogbookManagementOperationInformationTabComponent, TestLogbookInformationComponent], providers: [{ provide: LogbookService, useValue: {} }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts index 5a227d597cd..e40812bc792 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts @@ -35,15 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; -import { LogbookService } from 'vitamui-library'; -import type { IEvent } from 'vitamui-library'; +import { LogbookService, IEvent } from 'vitamui-library'; +import { EventTypeLabelComponent, PipesModule } from 'vitamui-library'; import type { OperationDetails } from '../../../models/operation-response.interface'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-logbook-management-operation-information-tab', templateUrl: './logbook-management-operation-information-tab.component.html', styleUrls: ['./logbook-management-operation-information-tab.component.scss'], - standalone: false, + imports: [EventTypeLabelComponent, PipesModule, TranslatePipe], }) export class LogbookManagementOperationInformationTabComponent implements OnInit, OnChanges { private logbookService = inject(LogbookService); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts index f827d47040f..8bd911420bc 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts @@ -55,10 +55,7 @@ describe('LogbookManagementOperationPreviewComponent', () => { context: [], }; - @Pipe({ - name: 'truncate', - standalone: false, - }) + @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -76,8 +73,7 @@ describe('LogbookManagementOperationPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [LogbookManagementOperationPreviewComponent, MockTruncatePipe], - imports: [], + imports: [LogbookManagementOperationPreviewComponent, MockTruncatePipe], providers: [ { provide: LogbookManagementOperationService, useValue: logbookManagementOperationServiceMock }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts index 696f49a4335..1fab59a18f5 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts @@ -35,18 +35,57 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { LogbookManagementOperationService } from '../logbook-management-operation.service'; -import { FormControl, Validators } from '@angular/forms'; +import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms'; import type { OperationDetails } from '../../models/operation-response.interface'; +import { + VitamuiMenuButtonComponent, + DialogHeaderComponent, + EventTypeLabelComponent, + InputComponent, + PipesModule, + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, +} from 'vitamui-library'; +import { MatMenuItem } from '@angular/material/menu'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { LogbookManagementOperationInformationTabComponent } from './logbook-management-operation-information-tab/logbook-management-operation-information-tab.component'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { NgClass, CommonModule } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @Component({ selector: 'app-logbook-management-operation-preview', templateUrl: './logbook-management-operation-preview.component.html', styleUrls: ['./logbook-management-operation-preview.component.scss'], - standalone: false, + imports: [ + VitamuiMenuButtonComponent, + MatMenuItem, + MatTabGroup, + MatTab, + LogbookManagementOperationInformationTabComponent, + DialogHeaderComponent, + CdkScrollable, + MatDialogContent, + EventTypeLabelComponent, + NgClass, + MatDialogActions, + MatDialogClose, + InputComponent, + ReactiveFormsModule, + PipesModule, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class LogbookManagementOperationPreviewComponent implements OnInit, OnDestroy { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts index a04b06a3fda..01af9511e5e 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts @@ -39,7 +39,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, VitamUICommonModule } from 'vitamui-library'; import { LogbookManagementOperationComponent } from './logbook-management-operation.component'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { provideNativeDateAdapter } from '@angular/material/core'; @@ -54,8 +55,14 @@ describe('LogbookManagementOperationComponent', () => { }); await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, InjectorModule, VitamUICommonModule, LoggerModule.forRoot(), MatDatepickerModule], - declarations: [LogbookManagementOperationComponent], + imports: [ + ReactiveFormsModule, + InjectorModule, + VitamUICommonModule, + LoggerModule.forRoot(), + MatDatepickerModule, + LogbookManagementOperationComponent, + ], providers: [ provideNativeDateAdapter(), { diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts index ad6b8ecb3ec..7c52b43ceec 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts @@ -35,14 +35,27 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder } from '@angular/forms'; -import { MatSidenav } from '@angular/material/sidenav'; +import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ActivatedRoute } from '@angular/router'; -import { AuthService, DateService, FrenchDate, QueryParamsService, Tenant } from 'vitamui-library'; +import { + AuthService, + DateService, + FrenchDate, + QueryParamsService, + Tenant, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + TooltipDirective, + DatepickerComponent, +} from 'vitamui-library'; import { OperationDetails } from '../models/operation-response.interface'; import { LogbookManagementOperationListComponent } from './logbook-management-operation-list/logbook-management-operation-list.component'; import { tap } from 'rxjs/operators'; import { BehaviorSubject, Subscription } from 'rxjs'; +import { LogbookManagementOperationPreviewComponent } from './logbook-management-operation-preview/logbook-management-operation-preview.component'; +import { NgStyle } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; interface FormData { startDateMin?: Date; @@ -60,7 +73,20 @@ interface OperationSearch { selector: 'app-logbook-management-operation', templateUrl: './logbook-management-operation.component.html', styleUrls: ['./logbook-management-operation.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + LogbookManagementOperationPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + TooltipDirective, + ReactiveFormsModule, + NgStyle, + DatepickerComponent, + LogbookManagementOperationListComponent, + TranslatePipe, + ], }) export class LogbookManagementOperationComponent implements OnInit, OnDestroy { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.module.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.module.ts index 1f89dcd2089..b78d35409bb 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.module.ts @@ -55,12 +55,6 @@ import { MatMenuItem } from '@angular/material/menu'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [ - LogbookManagementOperationComponent, - LogbookManagementOperationListComponent, - LogbookManagementOperationPreviewComponent, - LogbookManagementOperationInformationTabComponent, - ], imports: [ CommonModule, FormsModule, @@ -76,6 +70,10 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUILibraryModule, MatMenuItem, TranslatePipe, + LogbookManagementOperationComponent, + LogbookManagementOperationListComponent, + LogbookManagementOperationPreviewComponent, + LogbookManagementOperationInformationTabComponent, ], exports: [ LogbookManagementOperationListComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index 3b0e32a6ea7..c68594aac89 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -41,17 +41,15 @@ import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { AuthService, BASE_URL, ExternalParametersService, InjectorModule, LogbookService, LoggerModule } from 'vitamui-library'; +import { AuthService, BASE_URL, ExternalParametersService, LogbookService } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperationDetailComponent } from './logbook-operation-detail.component'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -69,7 +67,6 @@ describe('LogbookOperationDetailComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [LogbookOperationDetailComponent, LastEventPipe, MockTruncatePipe], schemas: [NO_ERRORS_SCHEMA], imports: [ BrowserAnimationsModule, @@ -79,6 +76,9 @@ describe('LogbookOperationDetailComponent', () => { NoopAnimationsModule, RouterTestingModule, VitamUICommonTestModule, + LogbookOperationDetailComponent, + LastEventPipe, + MockTruncatePipe, ], providers: [ { provide: LogbookService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts index 1720d360101..87bbb483c4c 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts @@ -46,10 +46,23 @@ import { LogbookOperationTypeProc, LogbookService, SnackBarService, + EventTypeLabelComponent, + HistoryEventsComponent, + PipesModule, + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { IngestStatus } from '../../../../../ingest/src/app/models/logbook-event.interface'; import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperation } from '../logbook-operation.enum'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; +import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; const msgForDownload: { [key: string]: string } = { EXPORT_DIP: 'LOGBOOK_OPERATION_DETAIL.DOWNLOAD_DIP', @@ -62,7 +75,22 @@ const defaultDownloadButtonLabel = 'LOGBOOK_OPERATION_DETAIL.DOWNLOAD_REPORT'; selector: 'app-logbook-operation-detail', templateUrl: './logbook-operation-detail.component.html', styleUrls: ['./logbook-operation-detail.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + EventTypeLabelComponent, + HistoryEventsComponent, + PipesModule, + LastEventPipe, + EventTypeBadgeColorPipe, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class LogbookOperationDetailComponent implements OnInit, OnChanges, OnDestroy { private logbookService = inject(LogbookService); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts index 04f31a93b89..dfdd4f87980 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts @@ -36,6 +36,7 @@ */ import { Component, OnInit, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { LogbookOperationDetailComponent } from './logbook-operation-detail.component'; @Component({ selector: 'app-logbook-operation-popup', @@ -47,7 +48,7 @@ import { ActivatedRoute } from '@angular/router'; [isPopup]="true" > `, - standalone: false, + imports: [LogbookOperationDetailComponent], }) export class LogbookOperationPopupComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts index 684f3b15bbd..d4ea643d17d 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts @@ -54,8 +54,14 @@ describe('LogbookOperationListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [OverlayModule, TableFilterDirective, EventTypeBadgeClassPipe], - declarations: [LogbookOperationListComponent, LastEventPipe, EventTypeColorClassPipe], + imports: [ + OverlayModule, + TableFilterDirective, + EventTypeBadgeClassPipe, + LogbookOperationListComponent, + LastEventPipe, + EventTypeColorClassPipe, + ], providers: [ { provide: LogbookSearchService, useValue: { search: () => EMPTY } }, { provide: LogbookDownloadService, useValue: { logbookOperationsReloaded: of([{ id: 'event-01' }]) } }, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts index b3f8a7dbb7d..7c1272afcd9 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts @@ -34,7 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { DEFAULT_PAGE_SIZE, Direction, IEvent, InfiniteScrollTable, PageRequest } from 'vitamui-library'; +import { DEFAULT_PAGE_SIZE, IEvent, InfiniteScrollTable } from 'vitamui-library'; +import { + Direction, + PageRequest, + TableFilterDirective, + OrderByButtonComponent, + EventTypeLabelComponent, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; import { Component, @@ -57,6 +69,12 @@ import { EventFilter } from '../event-filter.interface'; import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperation } from '../logbook-operation.enum'; import { LogbookSearchService } from '../logbook-search.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; +import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; +import { EventTypeColorClassPipe } from '../../shared/pipes/event-type-color-class.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; const ARCHIVE_TRANSFER = 'ARCHIVE_TRANSFER'; @@ -66,7 +84,23 @@ const ARCHIVE_TRANSFER_LABEL = 'ARCHIVE_TRANSFER_LABEL'; selector: 'app-logbook-operation-list', templateUrl: './logbook-operation-list.component.html', styleUrls: ['./logbook-operation-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + OrderByButtonComponent, + NgClass, + EventTypeLabelComponent, + MatProgressSpinner, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + LastEventPipe, + EventTypeBadgeClassPipe, + EventTypeColorClassPipe, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class LogbookOperationListComponent extends InfiniteScrollTable implements OnInit, OnChanges, OnDestroy { logbookSearchService: LogbookSearchService; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts index 723abe243bf..672aa808262 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts @@ -41,7 +41,8 @@ import { MatDialog } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { ActivatedRoute, Router } from '@angular/router'; import { EMPTY, of } from 'rxjs'; -import { DatepickerComponent, ENVIRONMENT, GlobalEventService, InjectorModule, LoggerModule, SearchBarComponent } from 'vitamui-library'; +import { ENVIRONMENT, GlobalEventService } from 'vitamui-library'; +import { DatepickerComponent, InjectorModule, LoggerModule, SearchBarComponent } from 'vitamui-library'; import { environment } from '../../environments/environment'; import { LogbookOperationComponent } from './logbook-operation.component'; import { LogbookSearchService } from './logbook-search.service'; @@ -58,8 +59,15 @@ describe('LogbookOperationComponent', () => { }; matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), MatMenuModule, DatepickerComponent, ReactiveFormsModule, SearchBarComponent], - declarations: [LogbookOperationComponent], + imports: [ + InjectorModule, + LoggerModule.forRoot(), + MatMenuModule, + DatepickerComponent, + ReactiveFormsModule, + SearchBarComponent, + LogbookOperationComponent, + ], providers: [ provideNativeDateAdapter(), DatePipe, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts index 70dbf740d02..fec294c59e9 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts @@ -35,18 +35,38 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { AfterViewInit, Component, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { GlobalEventService, SidenavPage, VitamuiBannerComponent } from 'vitamui-library'; +import { + GlobalEventService, + SidenavPage, + VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, + DatepickerComponent, +} from 'vitamui-library'; import { EventFilter } from './event-filter.interface'; import { LogbookOperationListComponent } from './logbook-operation-list/logbook-operation-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { LogbookOperationDetailComponent } from './logbook-operation-detail/logbook-operation-detail.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-logbook-operation', templateUrl: './logbook-operation.component.html', styleUrls: ['./logbook-operation.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + LogbookOperationDetailComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ReactiveFormsModule, + DatepickerComponent, + LogbookOperationListComponent, + TranslatePipe, + ], }) export class LogbookOperationComponent extends SidenavPage implements OnInit, AfterViewInit { route: ActivatedRoute; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.module.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.module.ts index 76fcf6c31b0..15cc7793d66 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.module.ts @@ -46,7 +46,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; import { VitamUICommonModule } from 'vitamui-library'; -import { PipesModule } from '../shared/pipes/pipes.module'; + import { LogbookOperationDetailComponent } from './logbook-operation-detail/logbook-operation-detail.component'; import { LogbookOperationPopupComponent } from './logbook-operation-detail/logbook-operation-popup.component'; import { LogbookOperationListComponent } from './logbook-operation-list/logbook-operation-list.component'; @@ -57,7 +57,6 @@ import { FR_DATE_FORMAT } from '../helpers/dates.constants'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [LogbookOperationComponent, LogbookOperationListComponent, LogbookOperationDetailComponent, LogbookOperationPopupComponent], imports: [ CommonModule, MatSidenavModule, @@ -71,8 +70,11 @@ import { TranslatePipe } from '@ngx-translate/core'; MatSelectModule, MatFormFieldModule, MatInputModule, - PipesModule, TranslatePipe, + LogbookOperationComponent, + LogbookOperationListComponent, + LogbookOperationDetailComponent, + LogbookOperationPopupComponent, ], providers: [{ provide: MAT_DATE_FORMATS, useValue: FR_DATE_FORMAT }], }) diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts index 99860b46b30..133e3288aaa 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts @@ -35,16 +35,31 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core'; -import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Option, PersistentIdentifierPolicyTypeEnum } from 'vitamui-library'; +import { SelectComponent, InputComponent, TooltipDirective } from 'vitamui-library'; import { ManagementContractValidationErrors, ManagementContractValidators } from '../../validators/management-contract-validators'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { MatCheckbox } from '@angular/material/checkbox'; +import { NgClass, NgStyle } from '@angular/common'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; @Component({ selector: 'app-create-persistent-identifier-policy-form', templateUrl: './create-persistent-identifier-policy-form.component.html', styleUrls: ['./create-persistent-identifier-policy-form.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + SelectComponent, + InputComponent, + MatCheckbox, + NgClass, + NgStyle, + MatRadioGroup, + MatRadioButton, + TooltipDirective, + TranslatePipe, + ], }) export class CreatePersistentIdentifierPolicyFormComponent implements OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.module.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.module.ts deleted file mode 100644 index b8adab099a1..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.module.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { SharedModule } from 'projects/identity/src/app/shared/shared.module'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { CreatePersistentIdentifierPolicyFormComponent } from './create-persistent-identifier-policy-form.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [CreatePersistentIdentifierPolicyFormComponent], - imports: [ - CommonModule, - SharedModule, - FormsModule, - ReactiveFormsModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - MatCheckboxModule, - MatRadioModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - exports: [CreatePersistentIdentifierPolicyFormComponent], -}) -export class PersistentIdentifierPoliciesFormModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts index 8a3c74e95c4..12004a4d735 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts @@ -35,19 +35,34 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core'; -import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { ManagementContractValidationErrors, ManagementContractValidators, } from 'projects/referential/src/app/management-contract/validators/management-contract-validators'; import { Option } from 'vitamui-library'; -import { TranslateService } from '@ngx-translate/core'; +import { InputComponent, SelectComponent, TooltipDirective } from 'vitamui-library'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { MatCheckbox } from '@angular/material/checkbox'; +import { NgClass, NgStyle } from '@angular/common'; +import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; @Component({ selector: 'app-update-persistent-identifier-policy-form', templateUrl: './update-persistent-identifier-policy-form.component.html', styleUrls: ['./update-persistent-identifier-policy-form.component.scss'], - standalone: false, + imports: [ + ReactiveFormsModule, + InputComponent, + MatCheckbox, + NgClass, + NgStyle, + SelectComponent, + TooltipDirective, + MatRadioGroup, + MatRadioButton, + TranslatePipe, + ], }) export class UpdatePersistentIdentifierPolicyFormComponent implements OnChanges { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.module.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.module.ts deleted file mode 100644 index 3120b0e1910..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.module.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatRadioModule } from '@angular/material/radio'; -import { MatSelectModule } from '@angular/material/select'; -import { SharedModule } from 'projects/identity/src/app/shared/shared.module'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { UpdatePersistentIdentifierPolicyFormComponent } from './update-persistent-identifier-policy-form.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [UpdatePersistentIdentifierPolicyFormComponent], - imports: [ - CommonModule, - SharedModule, - FormsModule, - ReactiveFormsModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - MatCheckboxModule, - MatRadioModule, - VitamUICommonModule, - VitamUILibraryModule, - TranslatePipe, - ], - exports: [UpdatePersistentIdentifierPolicyFormComponent], -}) -export class PersistentIdentifierFormModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.ts index 441b97cbec3..58fee2a6183 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.ts @@ -56,6 +56,7 @@ import { ManagementContractCreateValidators } from '../validators/management-con import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { SharedModule } from '../../../../../identity/src/app/shared/shared.module'; +import { CreatePersistentIdentifierPolicyFormComponent } from '../components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -63,7 +64,6 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatRadioModule } from '@angular/material/radio'; -import { PersistentIdentifierPoliciesFormModule } from '../components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.module'; @Component({ selector: 'app-management-contract-create', @@ -79,8 +79,8 @@ import { PersistentIdentifierPoliciesFormModule } from '../components/create-per MatProgressBarModule, MatRadioModule, MatSelectModule, - PersistentIdentifierPoliciesFormModule, ReactiveFormsModule, + CreatePersistentIdentifierPolicyFormComponent, SharedModule, VitamUICommonModule, VitamUILibraryModule, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index 9baf3c74ba9..77f74023f65 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -43,7 +43,8 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { of, Subject } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, ManagementContract, SearchService, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ManagementContract, SearchService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../management-contract.service'; import { ManagementContractListComponent } from './management-contract-list.component'; @@ -77,7 +78,6 @@ describe('ManagementContractListComponent', () => { matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - declarations: [ManagementContractListComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ ReactiveFormsModule, @@ -88,6 +88,7 @@ describe('ManagementContractListComponent', () => { LoggerModule.forRoot(), BrowserAnimationsModule, NoopAnimationsModule, + ManagementContractListComponent, ], providers: [ { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts index ed65ac43904..68f7ed1a6a7 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts @@ -37,8 +37,23 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { Subject, Subscription, merge } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, ManagementContract, PageRequest } from 'vitamui-library'; +import { + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollTable, + ManagementContract, + PageRequest, + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + OrderByButtonComponent, + PipesModule, + InfiniteScrollDirective, +} from 'vitamui-library'; import { ManagementContractService } from '../management-contract.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -46,7 +61,18 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-management-contract-list', templateUrl: './management-contract-list.component.html', styleUrls: ['./management-contract-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, + OrderByButtonComponent, + NgClass, + MatProgressSpinner, + PipesModule, + TranslatePipe, + CommonModule, + InfiniteScrollDirective, + ], }) export class ManagementContractListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { managementContractService: ManagementContractService; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts index d556ab11f0f..9cd2ca831db 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts @@ -35,22 +35,31 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnChanges, OnDestroy, Output, SimpleChanges, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormArray, FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of, Subscription } from 'rxjs'; import { mergeMap, tap } from 'rxjs/operators'; -import { PersistentIdentifierPolicyTypeEnum } from 'vitamui-library'; -import type { ManagementContract, Option } from 'vitamui-library'; +import { ManagementContract, Option } from 'vitamui-library'; +import { PersistentIdentifierPolicyTypeEnum, SelectComponent, TooltipDirective } from 'vitamui-library'; import { FormGroupToManagementContractConverterService } from '../../components/form-group-to-management-contract-converter.service'; import { ManagementContractToFormGroupConverterService } from '../../components/management-contract-to-form-group-converter.service'; import { ManagementContractService } from '../../management-contract.service'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { UpdatePersistentIdentifierPolicyFormComponent } from '../../components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ selector: 'app-management-contract-identification-tab', templateUrl: './management-contract-identification-tab.component.html', styleUrls: ['./management-contract-identification-tab.component.scss'], providers: [ManagementContractToFormGroupConverterService], - standalone: false, + imports: [ + ReactiveFormsModule, + SelectComponent, + UpdatePersistentIdentifierPolicyFormComponent, + TooltipDirective, + MatProgressSpinner, + TranslatePipe, + ], }) export class ManagementContractIdentificationTabComponent implements OnChanges, OnDestroy { private managementContractToFormGroupConverterService = inject(ManagementContractToFormGroupConverterService); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts index acffde38a43..a3f49cd5c97 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts @@ -42,7 +42,8 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, IntermediaryVersionEnum, LoggerModule } from 'vitamui-library'; import { InputStubComponent, VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractInformationTabComponent } from './management-contract-information-tab.component'; @@ -53,10 +54,7 @@ describe('ManagementContractInformationTabComponent', () => { let component: ManagementContractInformationTabComponent; let fixture: ComponentFixture; - @Pipe({ - name: 'dateTime', - standalone: false, - }) + @Pipe({ name: 'dateTime' }) class DateTimeStubPipe implements PipeTransform { transform(value: string = ''): string { return value; @@ -108,9 +106,16 @@ describe('ManagementContractInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ManagementContractInformationTabComponent, DateTimeStubPipe], schemas: [NO_ERRORS_SCHEMA], - imports: [MatSidenavModule, InjectorModule, VitamUICommonTestModule, RouterTestingModule, LoggerModule.forRoot()], + imports: [ + MatSidenavModule, + InjectorModule, + VitamUICommonTestModule, + RouterTestingModule, + LoggerModule.forRoot(), + ManagementContractInformationTabComponent, + DateTimeStubPipe, + ], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts index 4145d9d39a5..14808d6cdbd 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts @@ -35,19 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { diff } from 'vitamui-library'; -import type { ManagementContract } from 'vitamui-library'; +import { ManagementContract } from 'vitamui-library'; +import { diff, SlideToggleComponent, InputComponent, PipesModule } from 'vitamui-library'; import { ManagementContractService } from '../../management-contract.service'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-management-contract-information-tab', templateUrl: './management-contract-information-tab.component.html', styleUrls: ['./management-contract-information-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SlideToggleComponent, InputComponent, MatProgressSpinner, PipesModule, TranslatePipe], }) export class ManagementContractInformationTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts index 0ccdd8bce99..a77e96bce95 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts @@ -40,7 +40,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractPreviewComponent } from './management-contract-preview.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -49,10 +50,7 @@ describe('ManagementContractPreviewComponent', () => { let component: ManagementContractPreviewComponent; let fixture: ComponentFixture; - @Pipe({ - name: 'truncate', - standalone: false, - }) + @Pipe({ name: 'truncate' }) class TruncateStubPipe implements PipeTransform { transform(value: string = ''): string { return value; @@ -61,9 +59,17 @@ describe('ManagementContractPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ManagementContractPreviewComponent, TruncateStubPipe], schemas: [NO_ERRORS_SCHEMA], - imports: [MatSidenavModule, InjectorModule, VitamUICommonTestModule, RouterTestingModule, LoggerModule.forRoot(), MatDialogModule], + imports: [ + MatSidenavModule, + InjectorModule, + VitamUICommonTestModule, + RouterTestingModule, + LoggerModule.forRoot(), + MatDialogModule, + ManagementContractPreviewComponent, + TruncateStubPipe, + ], providers: [ { provide: WINDOW_LOCATION, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts index b5386634dc6..a2155c945bb 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts @@ -50,17 +50,46 @@ import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Subscription } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { ConfirmActionComponent } from 'vitamui-library'; -import type { ManagementContract } from 'vitamui-library'; +import { + ConfirmActionComponent, + VitamuiMenuButtonComponent, + OperationHistoryTabComponent, + PipesModule, + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, +} from 'vitamui-library'; +import { ManagementContract } from 'vitamui-library'; import { ManagementContractIdentificationTabComponent } from './management-contract-identification-tab/management-contract-identification-tab.component'; import { ManagementContractInformationTabComponent } from './management-contract-information-tab/management-contract-information-tab.component'; import { ManagementContractStorageTabComponent } from './management-contract-storage-tab/management-contract-storage-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-management-contract-preview', templateUrl: './management-contract-preview.component.html', styleUrls: ['./management-contract-preview.component.scss'], - standalone: false, + imports: [ + VitamuiMenuButtonComponent, + MatTabGroup, + MatTab, + ManagementContractInformationTabComponent, + ManagementContractStorageTabComponent, + ManagementContractIdentificationTabComponent, + OperationHistoryTabComponent, + PipesModule, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class ManagementContractPreviewComponent implements OnChanges, AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.module.ts deleted file mode 100644 index a1c8b2a1c4e..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.module.ts +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { PersistentIdentifierFormModule } from '../components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.module'; -import { ManagementContractIdentificationTabComponent } from './management-contract-identification-tab/management-contract-identification-tab.component'; -import { ManagementContractInformationTabComponent } from './management-contract-information-tab/management-contract-information-tab.component'; -import { ManagementContractPreviewComponent } from './management-contract-preview.component'; -import { ManagementContractStorageTabComponent } from './management-contract-storage-tab/management-contract-storage-tab.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatSidenavModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - PersistentIdentifierFormModule, - TranslatePipe, - ], - declarations: [ - ManagementContractPreviewComponent, - ManagementContractInformationTabComponent, - ManagementContractStorageTabComponent, - ManagementContractIdentificationTabComponent, - ], - exports: [ManagementContractPreviewComponent], -}) -export class ManagementContractPreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts index b8ec3385452..5872cc8aa8d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts @@ -42,7 +42,8 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, IntermediaryVersionEnum, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractStorageTabComponent } from './management-contract-storage-tab.component'; @@ -97,9 +98,15 @@ describe('ManagementContractStorageTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ManagementContractStorageTabComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [MatSidenavModule, InjectorModule, VitamUICommonTestModule, RouterTestingModule, LoggerModule.forRoot()], + imports: [ + MatSidenavModule, + InjectorModule, + VitamUICommonTestModule, + RouterTestingModule, + LoggerModule.forRoot(), + ManagementContractStorageTabComponent, + ], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts index 89a5ca7fb65..1002e214f9c 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts @@ -35,19 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnDestroy, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, Subscription, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { ManagementContract, StorageStrategy } from 'vitamui-library'; -import { diff } from 'vitamui-library'; +import { ManagementContract, StorageStrategy } from 'vitamui-library'; +import { diff, InputComponent } from 'vitamui-library'; import { ManagementContractService } from '../../management-contract.service'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-management-contract-storage-tab', templateUrl: './management-contract-storage-tab.component.html', styleUrls: ['./management-contract-storage-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, InputComponent, MatProgressSpinner, TranslatePipe], }) export class ManagementContractStorageTabComponent implements OnDestroy { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts index 118beddc53c..2bbc449a390 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts @@ -44,7 +44,8 @@ import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { ApplicationService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { WINDOW_LOCATION } from 'vitamui-library'; +import { ApplicationService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractComponent } from './management-contract.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -66,7 +67,6 @@ describe('ManagementContractComponent', () => { matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - declarations: [ManagementContractComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ ReactiveFormsModule, @@ -77,6 +77,7 @@ describe('ManagementContractComponent', () => { LoggerModule.forRoot(), BrowserAnimationsModule, NoopAnimationsModule, + ManagementContractComponent, ], providers: [ { diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts index 689d2a9f778..b6b3f2ac361 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts @@ -38,16 +38,37 @@ import { Component, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { firstValueFrom } from 'rxjs'; -import { ApplicationService, GlobalEventService, ManagementContract, SidenavPage } from 'vitamui-library'; +import { + ApplicationService, + GlobalEventService, + ManagementContract, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + TooltipDirective, +} from 'vitamui-library'; import { ManagementContractCreateComponent } from './management-contract-create/management-contract-create.component'; import { ManagementContractListComponent } from './management-contract-list/management-contract-list.component'; import { shareReplay } from 'rxjs/operators'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { ManagementContractPreviewComponent } from './management-contract-preview/management-contract-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-management-contract', templateUrl: './management-contract.component.html', styleUrls: ['./management-contract.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + ManagementContractPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + TooltipDirective, + ManagementContractListComponent, + TranslatePipe, + ], }) export class ManagementContractComponent extends SidenavPage { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.module.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.module.ts index 6c12b2fff20..3a33ad14e8d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.module.ts @@ -45,14 +45,13 @@ import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule } from 'vitamui-library'; import { ManagementContractListComponent } from './management-contract-list/management-contract-list.component'; -import { ManagementContractPreviewModule } from './management-contract-preview/management-contract-preview.module'; + import { ManagementContractRoutingModule } from './management-contract-routing.module'; import { ManagementContractComponent } from './management-contract.component'; import { ManagementContractCreateComponent } from './management-contract-create/management-contract-create.component'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [ManagementContractComponent, ManagementContractListComponent], imports: [ CommonModule, RouterModule, @@ -65,9 +64,10 @@ import { TranslatePipe } from '@ngx-translate/core'; MatProgressSpinnerModule, MatTabsModule, ManagementContractRoutingModule, - ManagementContractPreviewModule, ManagementContractCreateComponent, TranslatePipe, + ManagementContractComponent, + ManagementContractListComponent, ], }) export class ManagementContractModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts index 79ca68f358b..6906a1615e6 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts @@ -39,7 +39,8 @@ import { Injectable, inject } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { ManagementContract, SearchService, VitamuiHttpHeaders, SnackBarService } from 'vitamui-library'; +import { ManagementContract, SearchService, SnackBarService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { ManagementContractsApiService } from '../core/api/management-contracts-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts index 6a3105025cd..3a297f2a2c3 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts @@ -45,7 +45,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyService } from '../ontology.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts index 35dc5abce78..b3f4cb08b75 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts @@ -38,7 +38,8 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService, setTypeDetailAndStringSize, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { setTypeDetailAndStringSize, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { OntologyService } from '../ontology.service'; import { OntologyCreateValidators } from './ontology-create.validators'; import { collections, sizes, types } from '../ontology-form-options'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts index b1a2139ecf8..fcdb9411554 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts @@ -38,7 +38,8 @@ import { Component, inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { I18nPluralPipe } from '@angular/common'; -import { SchemaService, StartupService, SnackBarService, VitamUILibraryModule } from 'vitamui-library'; +import { SchemaService, StartupService, SnackBarService } from 'vitamui-library'; +import { VitamUILibraryModule } from 'vitamui-library'; import { finalize } from 'rxjs'; export type SchemaDeleteDialogComponentData = string[]; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts index 147969df8ce..e1f4d176384 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts @@ -38,7 +38,7 @@ import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, import { finalize, Subscription } from 'rxjs'; import { ClickOutsideDirective, - CommonTooltipModule, + TooltipDirective, ItemFlatNode, ItemNode, ItemNodeUtils, @@ -68,7 +68,7 @@ import { SchemaDeleteDialogComponent, SchemaDeleteDialogComponentData } from './ MatButtonToggleModule, MatButtonModule, MatProgressSpinnerModule, - CommonTooltipModule, + TooltipDirective, ClickOutsideDirective, ], selector: 'app-schema-list', diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts index cd14856b323..9f43eff1b36 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts @@ -42,7 +42,8 @@ import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; -import { Ontology, SecurityService, VitamUILibraryModule } from 'vitamui-library'; +import { Ontology, SecurityService } from 'vitamui-library'; +import { VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyService } from '../../ontology.service'; import { OntologyInformationTabComponent } from './ontology-information-tab.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts index 04bde3cad06..d01c7b7c524 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts @@ -38,7 +38,7 @@ import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, switchMap } from 'rxjs/operators'; -import type { Ontology, Option } from 'vitamui-library'; +import { Ontology, Option } from 'vitamui-library'; import { ApplicationId, diff, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts index d0a12f80122..41f6491aafb 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts @@ -49,7 +49,8 @@ import { import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader, MatTabsModule } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { ConfirmActionComponent, Ontology, SchemaElement, SchemaService, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmActionComponent, Ontology, SchemaElement, SchemaService } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { OntologyService } from '../ontology.service'; import { OntologyInformationTabComponent } from './ontology-information-tab/ontology-information-tab.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts index 5a2736abc49..ca4213d0cd1 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts @@ -37,7 +37,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { Collection, SchemaElement, SchemaService, VitamUILibraryModule } from 'vitamui-library'; +import { SchemaElement, SchemaService } from 'vitamui-library'; +import { Collection, VitamUILibraryModule } from 'vitamui-library'; import { SchemaInformationTabComponent } from './schema-information-tab.component'; import { of } from 'rxjs'; import { MatFormFieldModule } from '@angular/material/form-field'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts index 05c44e94735..bc66d5d8fd8 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts @@ -36,8 +36,8 @@ */ import { Component, inject, Input } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import type { Option, SchemaElement } from 'vitamui-library'; -import { SchemaService, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { Option, SchemaElement, SchemaService } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { sizes, types } from '../../ontology-form-options'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts index 3d6bcb3ad30..2ac517c5a1a 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts @@ -40,7 +40,8 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { InjectorModule, LoggerModule, SchemaService, SecurityService, StartupService } from 'vitamui-library'; +import { SchemaService, SecurityService, StartupService } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyComponent } from './ontology.component'; @@ -49,7 +50,7 @@ import { OntologyService } from './ontology.service'; @Component({ selector: 'app-ontology-preview', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class OntologyPreviewStub { @Input() @@ -59,7 +60,7 @@ class OntologyPreviewStub { @Component({ selector: 'app-ontology-list', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class OntologyListStub {} @@ -69,7 +70,6 @@ describe('OntologyComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [OntologyComponent, OntologyListStub, OntologyPreviewStub], imports: [ VitamUICommonTestModule, RouterTestingModule, @@ -78,6 +78,9 @@ describe('OntologyComponent', () => { NoopAnimationsModule, MatSidenavModule, MatDialogModule, + OntologyComponent, + OntologyListStub, + OntologyPreviewStub, ], schemas: [NO_ERRORS_SCHEMA], providers: [ diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts index cdb8adae6ed..6cca40bafe0 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts @@ -38,7 +38,7 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { ApplicationId, FileTypes, @@ -50,6 +50,10 @@ import { SecurityService, SidenavPage, StartupService, + ClickOutsideDirective, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, } from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; @@ -57,12 +61,28 @@ import { OntologyCreateComponent } from './ontology-create/ontology-create.compo import { OntologyListComponent } from './ontology-group/ontology-list/ontology-list.component'; import { Subscription } from 'rxjs'; import { OntologyService } from './ontology.service'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { OntologyPreviewComponent } from './ontology-preview/ontology-preview.component'; +import { MatMenuItem } from '@angular/material/menu'; +import { OntologyGroupComponent } from './ontology-group/ontology-group.component'; @Component({ selector: 'app-ontology', templateUrl: './ontology.component.html', styleUrls: ['./ontology.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + ClickOutsideDirective, + OntologyPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + OntologyGroupComponent, + TranslatePipe, + ], }) export class OntologyComponent extends SidenavPage implements OnInit, OnDestroy { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.module.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.module.ts index 531d5e7eac2..9b6c5017e54 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.module.ts @@ -44,7 +44,7 @@ import { RouterModule } from '@angular/router'; import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { OntologyRoutingModule } from './ontology-routing.module'; import { OntologyComponent } from './ontology.component'; -import { ImportDialogModule } from '../shared/import-dialog/import-dialog.module'; + import { OntologyGroupComponent } from './ontology-group/ontology-group.component'; import { OntologyPreviewComponent } from './ontology-preview/ontology-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -52,7 +52,6 @@ import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ imports: [ CommonModule, - ImportDialogModule, MatDialogModule, MatMenuModule, MatProgressSpinnerModule, @@ -64,7 +63,7 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, VitamUILibraryModule, TranslatePipe, + OntologyComponent, ], - declarations: [OntologyComponent], }) export class OntologyModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts index 058b4f42a53..27071ad5fd3 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts @@ -42,7 +42,8 @@ import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; import { EMPTY, of, throwError } from 'rxjs'; import type { Mock, MockInstance } from 'vitest'; -import { BASE_URL, Griffin, GriffinsService, LoggerModule, SnackBarService, StartupService, TenantSelectionService } from 'vitamui-library'; +import { BASE_URL, Griffin, GriffinsService, SnackBarService, StartupService, TenantSelectionService } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { GriffinListComponent } from './griffin-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts index baa91827816..fb101eebe22 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts @@ -42,7 +42,8 @@ import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; import { EMPTY, of, throwError } from 'rxjs'; import type { Mock, MockInstance } from 'vitest'; -import { BASE_URL, LoggerModule, PreservationScenario, PreservationScenariosService, SnackBarService } from 'vitamui-library'; +import { BASE_URL, PreservationScenario, PreservationScenariosService, SnackBarService } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { PreservationScenarioListComponent } from './preservation-scenario-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts index 61c15f31537..5e04ca3d328 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts @@ -37,7 +37,8 @@ import { Component, effect, inject, input } from '@angular/core'; import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { ActionType, Option, PreservationScenario, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ActionType, Option, PreservationScenario } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts index 7596d7d919c..5bc3b8ae336 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts @@ -40,7 +40,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { PreservationComponent } from './preservation.component'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { BASE_URL, InjectorModule, LoggerModule, SecurityService, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, SecurityService } from 'vitamui-library'; +import { InjectorModule, LoggerModule, VitamUICommonModule } from 'vitamui-library'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts index fa13f0b2a72..26f4fa5d5f1 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts @@ -78,8 +78,8 @@ describe('ProbativeValueCreateComponent', () => { MatProgressBarModule, VitamUICommonTestModule, VitamUILibraryModule, + ProbativeValueCreateComponent, ], - declarations: [ProbativeValueCreateComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts index 48cb174b3dc..7aed3f8531c 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts @@ -36,8 +36,8 @@ */ import { HttpHeaders } from '@angular/common/http'; import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { @@ -50,15 +50,32 @@ import { SigningRoleType, SnackBarService, VitamuiHttpHeaders, + DialogHeaderComponent, + InputComponent, + SelectComponent, } from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; import { sizes } from '../../ontology/ontology-form-options'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-probative-value-create', templateUrl: './probative-value-create.component.html', styleUrls: ['./probative-value-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + InputComponent, + SelectComponent, + MatButtonToggleGroup, + MatButtonToggle, + MatDialogActions, + TranslatePipe, + ], }) export class ProbativeValueCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.module.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.module.ts deleted file mode 100644 index 6a6c353a152..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.module.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { ProbativeValueCreateComponent } from './probative-value-create.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ProbativeValueCreateComponent], - imports: [ - CommonModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - VitamUICommonModule, - VitamUILibraryModule, - MatDialogModule, - TranslatePipe, - ], -}) -export class ProbativeValueCreateModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.spec.ts index 1a7f1962e00..789f5441ae4 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.spec.ts @@ -49,8 +49,7 @@ describe('ProbativeValueListComponent', () => { search: () => of(null), }; await TestBed.configureTestingModule({ - imports: [], - declarations: [ProbativeValueListComponent], + imports: [ProbativeValueListComponent], providers: [{ provide: ProbativeValueService, useValue: probativeValueServiceMock }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts index 3dd14c0ed86..5d343a6db58 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts @@ -37,9 +37,24 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { merge, Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, PageRequest } from 'vitamui-library'; +import { + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollTable, + PageRequest, + OrderByButtonComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; +import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; +import { EventTypeColorClassPipe } from '../../shared/pipes/event-type-color-class.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -52,7 +67,19 @@ export class ProbativeValueFilters { selector: 'app-probative-value-list', templateUrl: './probative-value-list.component.html', styleUrls: ['./probative-value-list.component.scss'], - standalone: false, + imports: [ + OrderByButtonComponent, + NgClass, + MatProgressSpinner, + PipesModule, + LastEventPipe, + EventTypeBadgeClassPipe, + EventTypeColorClassPipe, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class ProbativeValueListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { probativeValueService: ProbativeValueService; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts index e0570962d97..c24f5506e20 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts @@ -38,15 +38,13 @@ import { CUSTOM_ELEMENTS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; -import { ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { ExternalParameters } from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; import { ProbativeValuePreviewComponent } from './probative-value-preview.component'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -68,8 +66,7 @@ describe('ProbativeValuePreviewComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [ProbativeValuePreviewComponent, MockTruncatePipe], - imports: [EventTypeBadgeColorPipe], + imports: [EventTypeBadgeColorPipe, ProbativeValuePreviewComponent, MockTruncatePipe], providers: [ { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: ProbativeValueService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts index 77f2238697e..3c15acda9fd 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts @@ -38,14 +38,30 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } fro import { ActivatedRoute } from '@angular/router'; import { finalize, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { ExternalParameters, PipesModule, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; +import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-probative-value-preview', templateUrl: './probative-value-preview.component.html', styleUrls: ['./probative-value-preview.component.scss'], - standalone: false, + imports: [ + PipesModule, + EventTypeBadgeColorPipe, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class ProbativeValuePreviewComponent implements OnInit, OnDestroy { private probativeValueService = inject(ProbativeValueService); diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.module.ts deleted file mode 100644 index e931d409885..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.module.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { PipesModule } from '../../shared/pipes/pipes.module'; -import { ProbativeValuePreviewComponent } from './probative-value-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [ProbativeValuePreviewComponent], - imports: [ - CommonModule, - RouterModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatSidenavModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - PipesModule, - TranslatePipe, - ], - exports: [ProbativeValuePreviewComponent], -}) -export class ProbativeValuePreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts index 72a0428617c..cd3a27627e9 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts @@ -44,11 +44,11 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProbativeValueComponent } from './probative-value.component'; -import { PipesModule } from '../shared/pipes/pipes.module'; import { DatePipe } from '@angular/common'; import { provideNativeDateAdapter } from '@angular/material/core'; @@ -70,11 +70,10 @@ describe('ProbativeValueComponent', () => { MatSidenavModule, DatepickerComponent, NoopAnimationsModule, - PipesModule, ReactiveFormsModule, VitamUICommonTestModule, + ProbativeValueComponent, ], - declarations: [ProbativeValueComponent], providers: [ provideNativeDateAdapter(), { provide: BASE_URL, useValue: '/pastis-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts index 3ee6a2e960f..c59f8e9ccae 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts @@ -35,19 +35,41 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { Event, GlobalEventService, SearchBarComponent, SidenavPage } from 'vitamui-library'; +import { + Event, + GlobalEventService, + SearchBarComponent, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + DatepickerComponent, +} from 'vitamui-library'; import { ProbativeValueCreateComponent } from './probative-value-create/probative-value-create.component'; import { ProbativeValueListComponent } from './probative-value-list/probative-value-list.component'; import { DateTime } from 'luxon'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { ProbativeValuePreviewComponent } from './probative-value-preview/probative-value-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-probative-value', templateUrl: './probative-value.component.html', styleUrls: ['./probative-value.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + ProbativeValuePreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ReactiveFormsModule, + DatepickerComponent, + ProbativeValueListComponent, + TranslatePipe, + ], }) export class ProbativeValueComponent extends SidenavPage implements OnDestroy { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.module.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.module.ts index 235117dda2f..6aad485e398 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.module.ts @@ -46,20 +46,17 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule } from 'vitamui-library'; -import { ProbativeValueCreateModule } from './probative-value-create/probative-value-create.module'; -import { ProbativeValuePreviewModule } from './probative-value-preview/probative-value-preview.module'; import { ProbativeValueRoutingModule } from './probative-value-routing.module'; import { ProbativeValueComponent } from './probative-value.component'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; -import { PipesModule } from '../shared/pipes/pipes.module'; + import { ProbativeValueListComponent } from './probative-value-list/probative-value-list.component'; import { MAT_DATE_FORMATS } from '@angular/material/core'; import { FR_DATE_FORMAT } from '../helpers/dates.constants'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [ProbativeValueComponent, ProbativeValueListComponent], imports: [ CommonModule, RouterModule, @@ -67,8 +64,6 @@ import { TranslatePipe } from '@ngx-translate/core'; ReactiveFormsModule, VitamUICommonModule, ProbativeValueRoutingModule, - ProbativeValueCreateModule, - ProbativeValuePreviewModule, MatMenuModule, MatDialogModule, MatSidenavModule, @@ -77,8 +72,9 @@ import { TranslatePipe } from '@ngx-translate/core'; MatSelectModule, MatFormFieldModule, MatInputModule, - PipesModule, TranslatePipe, + ProbativeValueComponent, + ProbativeValueListComponent, ], providers: [{ provide: MAT_DATE_FORMATS, useValue: FR_DATE_FORMAT }], }) diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts index ca2502b4767..378437f6365 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts @@ -37,7 +37,8 @@ import { HttpHeaders } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; import { tap } from 'rxjs/operators'; -import { Event, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; +import { Event, SearchService, SnackBarService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { OperationApiService } from '../core/api/operation-api.service'; import { Observable } from 'rxjs'; diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts index ec370bba828..e5d60fd6eb9 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts @@ -46,7 +46,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService, ManagementRuleValidators, RuleService, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { ManagementRuleValidators, RuleService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../rules.constants'; import { RuleCreateComponent } from './rule-create.component'; @@ -103,7 +104,6 @@ describe('RuleCreateComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [RuleCreateComponent], imports: [ MatButtonToggleModule, MatDialogModule, @@ -115,6 +115,7 @@ describe('RuleCreateComponent', () => { ReactiveFormsModule, VitamUICommonTestModule, VitamUILibraryModule, + RuleCreateComponent, ], providers: [ { provide: RuleService, useValue: ruleServiceSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts index f31d9fe6e23..526f3d0a61e 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts @@ -35,19 +35,40 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService, ManagementRuleValidators, Rule, RuleService } from 'vitamui-library'; +import { + ConfirmDialogService, + ManagementRuleValidators, + Rule, + RuleService, + DialogHeaderComponent, + InputComponent, + TooltipDirective, + SelectComponent, +} from 'vitamui-library'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../rules.constants'; import { RuleCreateValidators } from './rule-create.validators'; import { sizes } from '../../ontology/ontology-form-options'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-rule-create', templateUrl: './rule-create.component.html', styleUrls: ['./rule-create.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + ReactiveFormsModule, + CdkScrollable, + MatDialogContent, + InputComponent, + TooltipDirective, + SelectComponent, + MatDialogActions, + TranslatePipe, + ], }) export class RuleCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.module.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.module.ts deleted file mode 100644 index 93533388c7a..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.module.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SharedModule } from '../../../../../identity/src/app/shared/shared.module'; -import { RuleCreateComponent } from './rule-create.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - SharedModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - VitamUICommonModule, - MatDialogModule, - VitamUILibraryModule, - TranslatePipe, - ], - declarations: [RuleCreateComponent], -}) -export class RuleCreateModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts index da495313dcc..134a9e82b09 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts @@ -52,8 +52,7 @@ describe('RuleListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [RuleListComponent], + imports: [RuleListComponent], providers: [ { provide: BASE_URL, useValue: '' }, { provide: RuleService, useValue: ruleServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts index e7a715ef558..a1847685a5e 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts @@ -36,23 +36,36 @@ */ import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subject, merge } from 'rxjs'; import { debounceTime, filter } from 'rxjs/operators'; -import type { AdminUserProfile, Rule } from 'vitamui-library'; import { - ApplicationId, + AdminUserProfile, + Rule, AuthService, ConfirmActionComponent, DEFAULT_PAGE_SIZE, - Direction, InfiniteScrollTable, - PageRequest, - Role, RuleService, SnackBarService, } from 'vitamui-library'; +import { + EllipsisDirective, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, + ApplicationId, + Direction, + PageRequest, + Role, + OrderByButtonComponent, + TableFilterDirective, + TableFilterComponent, + TableFilterOptionComponent, +} from 'vitamui-library'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../rules.constants'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -60,7 +73,19 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-rule-list', templateUrl: './rule-list.component.html', styleUrls: ['./rule-list.component.scss'], - standalone: false, + imports: [ + OrderByButtonComponent, + TableFilterDirective, + MatProgressSpinner, + TableFilterComponent, + TableFilterOptionComponent, + TranslatePipe, + CommonModule, + EllipsisDirective, + HasAnyRoleDirective, + HasRoleDirective, + InfiniteScrollDirective, + ], }) export class RuleListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { ruleService: RuleService; diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts index 916e4f78d54..07fbeb8c0ef 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts @@ -85,8 +85,7 @@ describe('RuleInformationTabComponent', () => { data: of({ appId: 'RULES_APP' }), }; await TestBed.configureTestingModule({ - imports: [], - declarations: [RuleInformationTabComponent], + imports: [RuleInformationTabComponent], providers: [ FormBuilder, { provide: ActivatedRoute, useValue: activatedRouteMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts index 92c40b5cb42..d62e24e88a7 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts @@ -35,14 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, mergeMap, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { Rule } from 'vitamui-library'; -import { RuleService, SecurityService, VitamuiRoles, diff } from 'vitamui-library'; +import { Rule, RuleService, SecurityService } from 'vitamui-library'; +import { VitamuiRoles, diff, SelectComponent, InputComponent } from 'vitamui-library'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../../rules.constants'; +import { AsyncPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; const RULES_APP = 'RULES_APP'; @@ -50,7 +52,7 @@ const RULES_APP = 'RULES_APP'; selector: 'app-rule-information-tab', templateUrl: './rule-information-tab.component.html', styleUrls: ['./rule-information-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SelectComponent, InputComponent, AsyncPipe, TranslatePipe], }) export class RuleInformationTabComponent implements OnInit { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.spec.ts index effdc0dbce4..6307b62f643 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.spec.ts @@ -46,8 +46,7 @@ describe('RulePreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [RulePreviewComponent], + imports: [RulePreviewComponent], providers: [ { provide: MatDialog, useValue: {} }, { provide: RuleService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts index 05faa72dd49..6a58cf4483b 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts @@ -34,19 +34,37 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; -import type { Rule } from 'vitamui-library'; -import { ConfirmActionComponent, RuleService } from 'vitamui-library'; +import { Rule, ConfirmActionComponent, RuleService } from 'vitamui-library'; +import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; import { RuleInformationTabComponent } from './rule-information-tab/rule-information-tab.component'; import { switchMap } from 'rxjs/operators'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-rule-preview', templateUrl: './rule-preview.component.html', styleUrls: ['./rule-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + RuleInformationTabComponent, + OperationHistoryTabComponent, + forwardRef(() => RulePreviewComponent), + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class RulePreviewComponent implements AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.module.ts deleted file mode 100644 index 8c3a27568e0..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.module.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { RuleInformationTabComponent } from './rule-information-tab/rule-information-tab.component'; -import { RulePreviewComponent } from './rule-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatSidenavModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - TranslatePipe, - ], - declarations: [RulePreviewComponent, RuleInformationTabComponent], - exports: [RulePreviewComponent], -}) -export class RulePreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index 20f387eac8f..7ee40e364fc 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -49,7 +49,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; -import type { Rule } from 'vitamui-library'; +import { Rule } from 'vitamui-library'; import { AuthService, BASE_URL, @@ -68,7 +68,19 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' @Component({ selector: 'app-rule-preview', template: '', - standalone: false, + imports: [ + NoopAnimationsModule, + RouterTestingModule, + VitamUICommonTestModule, + ReactiveFormsModule, + MatMenuModule, + MatTabsModule, + MatOptionModule, + MatSelectModule, + MatSidenavModule, + MatDialogModule, + InjectorModule, + ], }) class RulePreviewStubComponent { @Input() @@ -78,7 +90,19 @@ class RulePreviewStubComponent { @Component({ selector: 'app-rule-list', template: '', - standalone: false, + imports: [ + NoopAnimationsModule, + RouterTestingModule, + VitamUICommonTestModule, + ReactiveFormsModule, + MatMenuModule, + MatTabsModule, + MatOptionModule, + MatSelectModule, + MatSidenavModule, + MatDialogModule, + InjectorModule, + ], }) class RuleListStubComponent { @Input() @@ -120,7 +144,6 @@ describe('RuleComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [RuleComponent, RuleListStubComponent, RulePreviewStubComponent], imports: [ NoopAnimationsModule, RouterTestingModule, @@ -134,6 +157,9 @@ describe('RuleComponent', () => { MatDialogModule, InjectorModule, LoggerModule.forRoot(), + RuleComponent, + RuleListStubComponent, + RulePreviewStubComponent, ], providers: [ GlobalEventService, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts index 72b7eb2360d..5c671e0c5de 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts @@ -37,19 +37,47 @@ import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Observable } from 'rxjs'; -import { ApplicationId, FileTypes, GlobalEventService, Role, Rule, RuleService, SecurityService, SidenavPage } from 'vitamui-library'; +import { + ApplicationId, + FileTypes, + GlobalEventService, + Role, + Rule, + RuleService, + SecurityService, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, +} from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; import { RuleCreateComponent } from './rule-create/rule-create.component'; import { RuleListComponent } from './rule-list/rule-list.component'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { RulePreviewComponent } from './rule-preview/rule-preview.component'; +import { MatMenuItem } from '@angular/material/menu'; +import { AsyncPipe } from '@angular/common'; @Component({ selector: 'app-rules', templateUrl: './rule.component.html', styleUrls: ['./rule.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + RulePreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + VitamuiMenuButtonComponent, + MatMenuItem, + RuleListComponent, + AsyncPipe, + TranslatePipe, + ], }) export class RuleComponent extends SidenavPage implements OnInit { ruleService = inject(RuleService); diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.module.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.module.ts index 876aa0f38fd..89d54766fc8 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.module.ts @@ -45,12 +45,12 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RuleCreateModule } from './rule-create/rule-create.module'; + import { RuleListComponent } from './rule-list/rule-list.component'; -import { RulePreviewModule } from './rule-preview/rule-preview.module'; + import { RuleRoutingModule } from './rule-routing.module'; import { RuleComponent } from './rule.component'; -import { ImportDialogModule } from '../shared/import-dialog/import-dialog.module'; + import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ @@ -62,16 +62,14 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, VitamUILibraryModule, RuleRoutingModule, - RuleCreateModule, - RulePreviewModule, - ImportDialogModule, MatMenuModule, MatDialogModule, MatSidenavModule, MatProgressSpinnerModule, MatSelectModule, TranslatePipe, + RuleComponent, + RuleListComponent, ], - declarations: [RuleComponent, RuleListComponent], }) export class RuleModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.spec.ts index 62fefb2ce65..8f994a87cb6 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.spec.ts @@ -58,8 +58,7 @@ describe('SecurisationListComponent', () => { }); await TestBed.configureTestingModule({ - imports: [VitamUICommonTestModule, ReactiveFormsModule], - declarations: [SecurisationListComponent], + imports: [VitamUICommonTestModule, ReactiveFormsModule, SecurisationListComponent], providers: [ { provide: MatDialog, useValue: {} }, { provide: SecurisationService, useValue: securisationServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts index 2b7a21aa0ce..05dbb7f89ca 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts @@ -37,8 +37,26 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; import { Subject, merge } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, PageRequest } from 'vitamui-library'; +import { + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollTable, + PageRequest, + TableFilterDirective, + OrderByButtonComponent, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + EllipsisDirective, + InfiniteScrollDirective, +} from 'vitamui-library'; import { SecurisationService } from '../securisation.service'; +import { NgClass, CommonModule } from '@angular/common'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; +import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; +import { EventTypeColorClassPipe } from '../../shared/pipes/event-type-color-class.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -52,7 +70,22 @@ export class TraceabilityFilter { selector: 'app-securisation-list', templateUrl: './securisation-list.component.html', styleUrls: ['./securisation-list.component.scss'], - standalone: false, + imports: [ + TableFilterDirective, + OrderByButtonComponent, + NgClass, + MatProgressSpinner, + TableFilterComponent, + TableFilterOptionComponent, + PipesModule, + LastEventPipe, + EventTypeBadgeClassPipe, + EventTypeColorClassPipe, + TranslatePipe, + CommonModule, + EllipsisDirective, + InfiniteScrollDirective, + ], }) export class SecurisationListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { securisationService: SecurisationService; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.module.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.module.ts deleted file mode 100644 index 8632d6b291c..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { VitamUICommonModule } from 'vitamui-library'; -import { PipesModule } from '../../shared/pipes/pipes.module'; -import { SecurisationListComponent } from './securisation-list.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [SecurisationListComponent], - imports: [CommonModule, MatProgressSpinnerModule, VitamUICommonModule, PipesModule, TranslatePipe], - exports: [SecurisationListComponent], -}) -export class SecurisationListModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index 9239f3c18f4..5fd1592f40e 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -37,7 +37,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; -import { AccessContractService, BASE_URL, ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { AccessContractService, BASE_URL, ExternalParametersService } from 'vitamui-library'; +import { ExternalParameters, SnackBarService } from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; import { SecurisationCheckTabComponent } from './securisation-check-tab.component'; import { provideHttpClientTesting } from '@angular/common/http/testing'; @@ -106,9 +107,8 @@ describe('SecurisationCheckTabComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [SecurisationCheckTabComponent], schemas: [NO_ERRORS_SCHEMA], - imports: [], + imports: [SecurisationCheckTabComponent], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: AccessContractService, useValue: accessContractServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts index d5e00cb44d6..bd1ea9eecaf 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts @@ -35,15 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; -import type { ApiEvent, Event, IEvent } from 'vitamui-library'; -import { ApplicationId, ExternalParameters, ExternalParametersService, LogbookApiService, SnackBarService } from 'vitamui-library'; +import { ApiEvent, Event, IEvent, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { CollapseComponent, ApplicationId, ExternalParameters, LogbookApiService, HistoryEventsComponent } from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-securisation-check-tab', templateUrl: './securisation-check-tab.component.html', styleUrls: ['./securisation-check-tab.component.scss'], - standalone: false, + imports: [HistoryEventsComponent, TranslatePipe, CollapseComponent, CommonModule], }) export class SecurisationCheckTabComponent implements OnChanges, OnInit { private readonly securingService = inject(SecurisationService); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.spec.ts index 1c906f8fb70..bcf934996f4 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.spec.ts @@ -108,8 +108,7 @@ describe.skip('SecurisationInformationTabComponent', () => { }; await TestBed.configureTestingModule({ - imports: [NgxFilesizeModule], - declarations: [SecurisationInformationTabComponent], + imports: [NgxFilesizeModule, SecurisationInformationTabComponent], providers: [{ provide: SecurisationService, useValue: securisationServiceMock }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts index 392b9bac68e..7c5ed171fb4 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts @@ -35,14 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnInit, inject } from '@angular/core'; -import type { Event } from 'vitamui-library'; +import { Event } from 'vitamui-library'; +import { PipesModule } from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-securisation-information-tab', templateUrl: './securisation-information-tab.component.html', styleUrls: ['./securisation-information-tab.component.scss'], - standalone: false, + imports: [PipesModule, TranslatePipe], }) export class SecurisationInformationTabComponent implements OnInit { private securisationService = inject(SecurisationService); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts index b5f563226c0..dc510314177 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts @@ -38,15 +38,13 @@ import { CUSTOM_ELEMENTS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { ExternalParametersService } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; import { SecurisationService } from '../securisation.service'; import { SecurisationPreviewComponent } from './securisation-preview.component'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { transform(value: number): number { return value; @@ -116,8 +114,7 @@ describe('SecurisationPreviewComponent', () => { }; await TestBed.configureTestingModule({ - imports: [BrowserAnimationsModule, EventTypeBadgeColorPipe], - declarations: [SecurisationPreviewComponent, MockTruncatePipe], + imports: [BrowserAnimationsModule, EventTypeBadgeColorPipe, SecurisationPreviewComponent, MockTruncatePipe], providers: [ { provide: SecurisationService, useValue: {} }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts index 89a1dbb27f2..4668474ec43 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts @@ -35,15 +35,45 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import type { Event } from 'vitamui-library'; -import { ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { Event, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { + CommonTooltipComponent, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ExternalParameters, + OperationHistoryTabComponent, + PipesModule, +} from 'vitamui-library'; import { SecurisationService } from '../securisation.service'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { SecurisationInformationTabComponent } from './securisation-information-tab/securisation-information-tab.component'; +import { SecurisationCheckTabComponent } from './securisation-check-tab/securisation-check-tab.component'; +import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; @Component({ selector: 'app-securisation-preview', templateUrl: './securisation-preview.component.html', styleUrls: ['./securisation-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + SecurisationInformationTabComponent, + SecurisationCheckTabComponent, + OperationHistoryTabComponent, + PipesModule, + EventTypeBadgeColorPipe, + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class SecurisationPreviewComponent implements OnInit { private securisationService = inject(SecurisationService); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.module.ts deleted file mode 100644 index d9b8e932230..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.module.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { SecurisationCheckTabComponent } from './securisation-check-tab/securisation-check-tab.component'; -import { SecurisationInformationTabComponent } from './securisation-information-tab/securisation-information-tab.component'; -import { SecurisationPreviewComponent } from './securisation-preview.component'; -import { PipesModule } from '../../shared/pipes/pipes.module'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [SecurisationPreviewComponent, SecurisationInformationTabComponent, SecurisationCheckTabComponent], - imports: [ - CommonModule, - RouterModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatSidenavModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - PipesModule, - TranslatePipe, - ], - exports: [SecurisationPreviewComponent], -}) -export class SecurisationPreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts index 19e2715d2d3..6c5ff662c64 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts @@ -44,7 +44,8 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { GlobalEventService } from 'vitamui-library'; +import { DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { SecurisationComponent } from './securisation.component'; @@ -63,7 +64,6 @@ describe('SecurisationComponent', () => { }; await TestBed.configureTestingModule({ - declarations: [SecurisationComponent], schemas: [NO_ERRORS_SCHEMA], imports: [ InjectorModule, @@ -73,6 +73,7 @@ describe('SecurisationComponent', () => { DatepickerComponent, NoopAnimationsModule, VitamUICommonTestModule, + SecurisationComponent, ], providers: [ provideNativeDateAdapter(), diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts index 6a0265fe8f4..1e9ed4aafd2 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts @@ -35,18 +35,40 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { Event, GlobalEventService, SearchBarComponent, SidenavPage } from 'vitamui-library'; +import { + Event, + GlobalEventService, + SearchBarComponent, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + DatepickerComponent, +} from 'vitamui-library'; import { SecurisationListComponent } from './securisation-list/securisation-list.component'; import { DateTime } from 'luxon'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { SecurisationPreviewComponent } from './securisation-preview/securisation-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-securisation', templateUrl: './securisation.component.html', styleUrls: ['./securisation.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + SecurisationPreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + ReactiveFormsModule, + DatepickerComponent, + SecurisationListComponent, + TranslatePipe, + ], }) export class SecurisationComponent extends SidenavPage { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.module.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.module.ts index 5b52c444b96..66804e5c66c 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.module.ts @@ -50,8 +50,7 @@ import { VitamUICommonModule } from 'vitamui-library'; import { MAT_DATE_FORMATS } from '@angular/material/core'; import { FR_DATE_FORMAT } from '../helpers/dates.constants'; -import { SecurisationListModule } from './securisation-list/securisation-list.module'; -import { SecurisationPreviewModule } from './securisation-preview/securisation-preview.module'; + import { SecurisationRoutingModule } from './securisation-routing.module'; import { SecurisationComponent } from './securisation.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -64,8 +63,6 @@ import { TranslatePipe } from '@ngx-translate/core'; ReactiveFormsModule, VitamUICommonModule, SecurisationRoutingModule, - SecurisationPreviewModule, - SecurisationListModule, MatMenuModule, MatDialogModule, MatSidenavModule, @@ -75,8 +72,8 @@ import { TranslatePipe } from '@ngx-translate/core'; MatFormFieldModule, MatInputModule, TranslatePipe, + SecurisationComponent, ], - declarations: [SecurisationComponent], providers: [{ provide: MAT_DATE_FORMATS, useValue: FR_DATE_FORMAT }], }) export class SecurisationModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts index 8556245ec61..cf362793577 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts @@ -36,7 +36,8 @@ */ import { HttpHeaders } from '@angular/common/http'; import { Injectable, inject } from '@angular/core'; -import { Event, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; +import { Event, SearchService, SnackBarService } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { OperationApiService } from '../core/api/operation-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts index 3f759a6572f..eaf8feaf1a0 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts @@ -61,7 +61,17 @@ import { SecurityProfileCreateValidators } from './security-profile-create.valid multi: true, }, ], - standalone: false, + imports: [ + SecurityProfileCreateComponent, + ReactiveFormsModule, + MatFormFieldModule, + MatSelectModule, + MatButtonToggleModule, + MatProgressBarModule, + NoopAnimationsModule, + MatProgressSpinnerModule, + VitamUICommonTestModule, + ], }) class DomainInputStubComponent implements ControlValueAccessor { @Input() @@ -89,7 +99,17 @@ class DomainInputStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, + imports: [ + SecurityProfileCreateComponent, + ReactiveFormsModule, + MatFormFieldModule, + MatSelectModule, + MatButtonToggleModule, + MatProgressBarModule, + NoopAnimationsModule, + MatProgressSpinnerModule, + VitamUICommonTestModule, + ], }) class SecurityProfileEditPermissionStubComponent implements ControlValueAccessor { writeValue() {} @@ -151,8 +171,9 @@ describe('SecurityProfileCreateComponent', () => { NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, + SecurityProfileEditPermissionStubComponent, + DomainInputStubComponent, ], - declarations: [SecurityProfileEditPermissionStubComponent, DomainInputStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts index 328bafede98..6285be93d69 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts @@ -38,7 +38,8 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; +import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { SecurityProfileCreateValidators } from './security-profile-create.validators'; @@ -48,7 +49,7 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; -import { SecurityProfileEditPermissionModule } from './security-profile-edit-permission/security-profile-edit-permission.module'; + import { TranslatePipe } from '@ngx-translate/core'; @Component({ @@ -63,7 +64,6 @@ import { TranslatePipe } from '@ngx-translate/core'; MatProgressBarModule, MatSelectModule, ReactiveFormsModule, - SecurityProfileEditPermissionModule, SharedModule, VitamUICommonModule, VitamUILibraryModule, diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts index 4b20a00343e..d9dcdada7f6 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts @@ -35,8 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, forwardRef, Input, inject } from '@angular/core'; -import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { PermissionStructure, PermissionUtils } from '../permission.utils'; +import { TooltipDirective, SlideToggleComponent } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; export const PERMISSION_SELECT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -49,7 +51,7 @@ export const PERMISSION_SELECT_VALUE_ACCESSOR: any = { templateUrl: './security-profile-edit-permission.component.html', styleUrls: ['./security-profile-edit-permission.component.scss'], providers: [PERMISSION_SELECT_VALUE_ACCESSOR], - standalone: false, + imports: [ReactiveFormsModule, TooltipDirective, SlideToggleComponent, TranslatePipe], }) export class SecurityProfileEditPermissionComponent implements ControlValueAccessor { private permissionUtils = inject(PermissionUtils); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.module.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.module.ts deleted file mode 100644 index 1c665899f6e..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.module.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { MatSelectModule } from '@angular/material/select'; - -import { VitamUICommonModule } from 'vitamui-library'; -import { SecurityProfileEditPermissionComponent } from './security-profile-edit-permission.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - MatButtonToggleModule, - MatFormFieldModule, - MatInputModule, - MatProgressBarModule, - MatSelectModule, - ReactiveFormsModule, - VitamUICommonModule, - TranslatePipe, - ], - declarations: [SecurityProfileEditPermissionComponent], - exports: [SecurityProfileEditPermissionComponent], -}) -export class SecurityProfileEditPermissionModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts index 3f4d6aedde7..538d628db9c 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts @@ -52,8 +52,7 @@ describe('SecurityProfileListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [SecurityProfileListComponent], - imports: [], + imports: [SecurityProfileListComponent], providers: [ { provide: BASE_URL, useValue: '' }, { provide: SecurityProfileService, useValue: securityProfileServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts index 49a6d6f5a7d..bc713c1644e 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts @@ -37,9 +37,12 @@ import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; import { merge, Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import type { AdminUserProfile, SecurityProfile } from 'vitamui-library'; -import { DEFAULT_PAGE_SIZE, Direction, InfiniteScrollTable, PageRequest } from 'vitamui-library'; +import { AdminUserProfile, SecurityProfile, DEFAULT_PAGE_SIZE, InfiniteScrollTable } from 'vitamui-library'; +import { InfiniteScrollDirective, Direction, PageRequest, OrderByButtonComponent } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; +import { CommonModule } from '@angular/common'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -47,7 +50,7 @@ const FILTER_DEBOUNCE_TIME_MS = 400; selector: 'app-security-profile-list', templateUrl: './security-profile-list.component.html', styleUrls: ['./security-profile-list.component.scss'], - standalone: false, + imports: [OrderByButtonComponent, MatProgressSpinner, TranslatePipe, CommonModule, InfiniteScrollDirective], }) export class SecurityProfileListComponent extends InfiniteScrollTable implements OnDestroy, OnInit { securityProfileService: SecurityProfileService; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.spec.ts index 6bf19ea92e2..1e5572184ea 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.spec.ts @@ -66,8 +66,7 @@ describe('SecurityProfileInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [SecurityProfileInformationTabComponent], + imports: [SecurityProfileInformationTabComponent], providers: [FormBuilder, { provide: SecurityProfileService, useValue: securityProfileServiceMock }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts index ad64f1536e4..c01d2f7ebe1 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts @@ -35,19 +35,20 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { Option, SecurityProfile } from 'vitamui-library'; -import { diff } from 'vitamui-library'; +import { Option, SecurityProfile } from 'vitamui-library'; +import { diff, InputComponent, SlideToggleComponent } from 'vitamui-library'; import { SecurityProfileService } from '../../security-profile.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-security-profile-information-tab', templateUrl: './security-profile-information-tab.component.html', styleUrls: ['./security-profile-information-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, InputComponent, SlideToggleComponent, TranslatePipe], }) export class SecurityProfileInformationTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.spec.ts index 7fdac976a29..a45982f8999 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.spec.ts @@ -65,8 +65,7 @@ describe('SecurityProfilePermissionsTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [SecurityProfilePermissionsTabComponent], + imports: [SecurityProfilePermissionsTabComponent], providers: [FormBuilder, { provide: SecurityProfileService, useValue: securityProfileServiceMock }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts index cbd66e86a6e..c3c86cef42f 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts @@ -35,19 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import type { Option, SecurityProfile } from 'vitamui-library'; -import { diff } from 'vitamui-library'; +import { Option } from 'vitamui-library'; +import { SecurityProfile, diff } from 'vitamui-library'; import { SecurityProfileService } from '../../security-profile.service'; +import { SecurityProfileEditPermissionComponent } from '../../security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-security-profile-permissions-tab', templateUrl: './security-profile-permissions-tab.component.html', styleUrls: ['./security-profile-permissions-tab.component.scss'], - standalone: false, + imports: [ReactiveFormsModule, SecurityProfileEditPermissionComponent, TranslatePipe], }) export class SecurityProfilePermissionsTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts index 27fdb51e3fa..3384e462247 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts @@ -47,8 +47,7 @@ describe('SecurityProfilePreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [], - declarations: [SecurityProfilePreviewComponent], + imports: [SecurityProfilePreviewComponent], providers: [ { provide: MatDialog, useValue: {} }, { provide: SecurityProfileService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts index 6ddbed4017b..8855089f85d 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts @@ -34,21 +34,40 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import type { SecurityProfile } from 'vitamui-library'; -import { ConfirmActionComponent } from 'vitamui-library'; +import { SecurityProfile, ConfirmActionComponent } from 'vitamui-library'; +import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { SecurityProfileInformationTabComponent } from './security-profile-information-tab/security-profile-information-tab.component'; import { SecurityProfilePermissionsTabComponent } from './security-profile-permissions-tab/security-profile-permissions-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { ReactiveFormsModule } from '@angular/forms'; +import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-security-profile-preview', templateUrl: './security-profile-preview.component.html', styleUrls: ['./security-profile-preview.component.scss'], - standalone: false, + imports: [ + MatTabGroup, + MatTab, + SecurityProfileInformationTabComponent, + SecurityProfilePermissionsTabComponent, + OperationHistoryTabComponent, + forwardRef(() => SecurityProfilePreviewComponent), + TranslatePipe, + CommonModule, + CommonTooltipComponent, + MatProgressSpinnerModule, + ReactiveFormsModule, + TooltipDirective, + VitamuiSidenavHeaderComponent, + ], }) export class SecurityProfilePreviewComponent implements AfterViewInit { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.module.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.module.ts deleted file mode 100644 index c510bdbd16f..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.module.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatOptionModule } from '@angular/material/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { MatTabsModule } from '@angular/material/tabs'; -import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; - -import { SecurityProfileEditPermissionModule } from '../security-profile-create/security-profile-edit-permission/security-profile-edit-permission.module'; -import { SecurityProfileInformationTabComponent } from './security-profile-information-tab/security-profile-information-tab.component'; -import { SecurityProfilePermissionsTabComponent } from './security-profile-permissions-tab/security-profile-permissions-tab.component'; -import { SecurityProfilePreviewComponent } from './security-profile-preview.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - RouterModule, - VitamUICommonModule, - VitamUILibraryModule, - FormsModule, - ReactiveFormsModule, - MatMenuModule, - MatDialogModule, - MatSidenavModule, - MatProgressSpinnerModule, - MatSelectModule, - MatOptionModule, - MatTabsModule, - SecurityProfileEditPermissionModule, - TranslatePipe, - ], - declarations: [SecurityProfilePreviewComponent, SecurityProfileInformationTabComponent, SecurityProfilePermissionsTabComponent], - exports: [SecurityProfilePreviewComponent], -}) -export class SecurityProfilePreviewModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts index 79c21f5dc79..4c508bb31de 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts @@ -41,7 +41,8 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { ApplicationService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ApplicationService } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { of } from 'rxjs'; @@ -50,7 +51,7 @@ import { SecurityProfileComponent } from './security-profile.component'; @Component({ selector: 'app-SecurityProfile-preview', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class SecurityProfilePreviewStub { @Input() @@ -60,7 +61,7 @@ class SecurityProfilePreviewStub { @Component({ selector: 'app-SecurityProfile-list', template: '', - standalone: false, + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], }) class SecurityProfileListStub {} @@ -75,7 +76,6 @@ describe('SecurityProfileComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [SecurityProfileComponent, SecurityProfileListStub, SecurityProfilePreviewStub], imports: [ VitamUICommonTestModule, RouterTestingModule, @@ -84,6 +84,9 @@ describe('SecurityProfileComponent', () => { NoopAnimationsModule, MatSidenavModule, MatDialogModule, + SecurityProfileComponent, + SecurityProfileListStub, + SecurityProfilePreviewStub, ], providers: [{ provide: ApplicationService, useValue: applicationServiceMock }], schemas: [NO_ERRORS_SCHEMA], diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts index 67dd04177cf..a5f0f3118b3 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts @@ -37,17 +37,36 @@ import { Component, ViewChild, inject } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { ApplicationService, GlobalEventService, SecurityProfile, SidenavPage } from 'vitamui-library'; +import { + ApplicationService, + GlobalEventService, + SecurityProfile, + SidenavPage, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, +} from 'vitamui-library'; import { SecurityProfileCreateComponent } from './security-profile-create/security-profile-create.component'; import { SecurityProfileListComponent } from './security-profile-list/security-profile-list.component'; import { shareReplay } from 'rxjs/operators'; import { firstValueFrom } from 'rxjs'; +import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { SecurityProfilePreviewComponent } from './security-profile-preview/security-profile-preview.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-security-profile', templateUrl: './security-profile.component.html', styleUrls: ['./security-profile.component.scss'], - standalone: false, + imports: [ + MatSidenavContainer, + MatSidenav, + SecurityProfilePreviewComponent, + MatSidenavContent, + VitamuiTitleBreadcrumbComponent, + VitamuiBannerComponent, + SecurityProfileListComponent, + TranslatePipe, + ], }) export class SecurityProfileComponent extends SidenavPage { dialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.module.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.module.ts index 088ca1de0f6..8badbef3ff5 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.module.ts @@ -43,7 +43,7 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterModule } from '@angular/router'; import { VitamUICommonModule } from 'vitamui-library'; import { SecurityProfileListComponent } from './security-profile-list/security-profile-list.component'; -import { SecurityProfilePreviewModule } from './security-profile-preview/security-profile-preview.module'; + import { SecurityProfileRoutingModule } from './security-profile-routing.module'; import { SecurityProfileComponent } from './security-profile.component'; import { SecurityProfileCreateComponent } from './security-profile-create/security-profile-create.component'; @@ -56,13 +56,13 @@ import { TranslatePipe } from '@ngx-translate/core'; VitamUICommonModule, SecurityProfileRoutingModule, SecurityProfileCreateComponent, - SecurityProfilePreviewModule, MatMenuModule, MatDialogModule, MatSidenavModule, MatProgressSpinnerModule, TranslatePipe, + SecurityProfileComponent, + SecurityProfileListComponent, ], - declarations: [SecurityProfileComponent, SecurityProfileListComponent], }) export class SecurityProfileModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts index cb89d069c6c..443775b2c33 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts @@ -35,20 +35,39 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnDestroy } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { ApplicationId, FileTypes, FileValidationErrors, FileValidatorFunction, SnackBarService } from 'vitamui-library'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { + ApplicationId, + FileTypes, + FileValidationErrors, + FileValidatorFunction, + SnackBarService, + DialogHeaderComponent, + FileSelectorComponent, +} from 'vitamui-library'; import { firstValueFrom, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ImportDialogParam, ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; -import { FormControl, Validators } from '@angular/forms'; -import { TranslateService } from '@ngx-translate/core'; +import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { ReferentialImportService } from './referential-import.service'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ selector: 'app-import-dialog', templateUrl: './import-dialog.component.html', styleUrls: ['./import-dialog.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + CdkScrollable, + MatDialogContent, + FileSelectorComponent, + ReactiveFormsModule, + MatDialogActions, + MatProgressSpinner, + TranslatePipe, + ], }) export class ImportDialogComponent implements OnDestroy { dialogParams = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.module.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.module.ts deleted file mode 100644 index d1ec940ad8a..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.module.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; -import { ImportDialogComponent } from './import-dialog.component'; -import { MatDialogModule } from '@angular/material/dialog'; -import { TranslatePipe } from '@ngx-translate/core'; -import { ReactiveFormsModule } from '@angular/forms'; - -@NgModule({ - imports: [ - CommonModule, - VitamUICommonModule, - MatProgressSpinnerModule, - MatDialogModule, - VitamUILibraryModule, - TranslatePipe, - ReactiveFormsModule, - ], - declarations: [ImportDialogComponent], -}) -export class ImportDialogModule {} diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts index 7632cc9fa01..7a3be7c3b3e 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts @@ -36,7 +36,8 @@ */ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { ReferentialImportService } from './referential-import.service'; import { ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts index c6939fb7cc6..6ade65e08a7 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts @@ -36,7 +36,8 @@ */ import { HttpClient, HttpErrorResponse, HttpHeaders, HttpStatusCode } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; -import { BASE_URL, VitamuiHttpHeaders } from 'vitamui-library'; +import { BASE_URL } from 'vitamui-library'; +import { VitamuiHttpHeaders } from 'vitamui-library'; import { ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; import { Observable, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; diff --git a/ui/ui-frontend/projects/referential/src/app/shared/pipes/event-type-color-class.pipe.ts b/ui/ui-frontend/projects/referential/src/app/shared/pipes/event-type-color-class.pipe.ts index a0a4fece543..bf65a365488 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/pipes/event-type-color-class.pipe.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/pipes/event-type-color-class.pipe.ts @@ -44,10 +44,7 @@ const colorClassMap: { [key: string]: string } = { FATAL: 'text danger', }; -@Pipe({ - name: 'eventTypeColorClass', - standalone: false, -}) +@Pipe({ name: 'eventTypeColorClass' }) export class EventTypeColorClassPipe implements PipeTransform { transform(event: IEvent): string { if (!event.events || event.events.length <= 0) { diff --git a/ui/ui-frontend/projects/referential/src/app/shared/pipes/last-event.pipe.ts b/ui/ui-frontend/projects/referential/src/app/shared/pipes/last-event.pipe.ts index c94ddb95545..ab5aae020cb 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/pipes/last-event.pipe.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/pipes/last-event.pipe.ts @@ -38,10 +38,7 @@ import { IEvent } from 'vitamui-library'; import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ - name: 'lastEvent', - standalone: false, -}) +@Pipe({ name: 'lastEvent' }) export class LastEventPipe implements PipeTransform { transform(event: IEvent): IEvent { return event?.events?.length > 0 ? event.events[event.events.length - 1] : null; diff --git a/ui/ui-frontend/projects/referential/src/app/shared/pipes/pipes.module.ts b/ui/ui-frontend/projects/referential/src/app/shared/pipes/pipes.module.ts deleted file mode 100644 index 6a4b99c9882..00000000000 --- a/ui/ui-frontend/projects/referential/src/app/shared/pipes/pipes.module.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { NgModule } from '@angular/core'; -import { EventTypeBadgeClassPipe } from './event-type-badge-class.pipe'; -import { EventTypeColorClassPipe } from './event-type-color-class.pipe'; -import { LastEventPipe } from './last-event.pipe'; -import { EventTypeBadgeColorPipe } from './event-type-badge-color.pipe'; - -@NgModule({ - declarations: [LastEventPipe, EventTypeColorClassPipe], - imports: [EventTypeBadgeClassPipe, EventTypeBadgeColorPipe], - exports: [LastEventPipe, EventTypeBadgeClassPipe, EventTypeBadgeColorPipe, EventTypeColorClassPipe], -}) -export class PipesModule {} diff --git a/ui/ui-frontend/projects/referential/src/main.ts b/ui/ui-frontend/projects/referential/src/main.ts index c0ee6e23c2c..8a691a29452 100644 --- a/ui/ui-frontend/projects/referential/src/main.ts +++ b/ui/ui-frontend/projects/referential/src/main.ts @@ -34,16 +34,57 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, provideZoneChangeDetection } from '@angular/core'; -import { platformBrowser } from '@angular/platform-browser'; +import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; +import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; -import { AppModule } from './app/app.module'; import { environment } from './environments/environment'; +import { + provideI18n, + BASE_URL, + ENVIRONMENT, + WINDOW_LOCATION, + BytesPipe, + AuthenticationModule, + InjectorModule, + VitamUICommonModule, +} from 'vitamui-library'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { DatePipe } from '@angular/common'; +import { CoreModule } from './app/core/core.module'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { AppRoutingModule } from './app/app-routing.module'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { AppComponent } from './app/app.component'; if (environment.production) { enableProdMode(); } -platformBrowser() - .bootstrapModule(AppModule, { applicationProviders: [provideZoneChangeDetection()] }) - .catch((err) => console.error(err)); +bootstrapApplication(AppComponent, { + providers: [ + importProvidersFrom( + CoreModule, + AuthenticationModule.forRoot(), + InjectorModule, + BrowserAnimationsModule, + BrowserModule, + VitamUICommonModule.forRoot(), + AppRoutingModule, + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), + provideI18n(), + provideNativeDateAdapter(), + Title, + { provide: LOCALE_ID, useValue: 'fr' }, + { provide: BASE_URL, useValue: './referential-api' }, + { provide: ENVIRONMENT, useValue: environment }, + { provide: WINDOW_LOCATION, useValue: window.location }, + BytesPipe, + DatePipe, + ], +}).catch((err) => console.error(err)); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.spec.ts index 3a82185c0a6..537d61f61a2 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.spec.ts @@ -44,7 +44,7 @@ describe('AccountApplicationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [AccountApplicationTabComponent], + imports: [AccountApplicationTabComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.ts index 195f54d8588..9b59021495a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-application-tab/account-application-tab.component.ts @@ -40,6 +40,5 @@ import { Component } from '@angular/core'; selector: 'vitamui-common-account-application-tab', templateUrl: './account-application-tab.component.html', styleUrls: ['./account-application-tab.component.scss'], - standalone: false, }) export class AccountApplicationTabComponent {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts index eab80c5e964..49c5298f502 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts @@ -40,7 +40,6 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; import { VitamUIFieldErrorStubComponent } from '../../../../../testing/src/public_api'; -import { EditableFieldModule } from '../../components/editable-field/editable-field.module'; import { WINDOW_LOCATION } from '../../injection-tokens'; import { AccountService } from '../account.service'; import { AccountInformationTabComponent } from './account-information-tab.component'; @@ -56,8 +55,8 @@ describe('AccountInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, EditableFieldModule, SlideToggleComponent, NoopAnimationsModule], - declarations: [AccountInformationTabComponent, VitamUIFieldErrorStubComponent], + imports: [ReactiveFormsModule, SlideToggleComponent, NoopAnimationsModule, AccountInformationTabComponent], + declarations: [VitamUIFieldErrorStubComponent], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, { provide: AccountService, useValue: accountServiceSpy }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts index ab058e93858..373e33d559b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts @@ -35,15 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; import type { Account } from '../../models/account/account.interface'; +import { SlideToggleComponent } from '../../../../lib/components/slide-toggle/slide-toggle.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-account-information-tab', templateUrl: './account-information-tab.component.html', styleUrls: ['./account-information-tab.component.scss'], - standalone: false, + imports: [FormsModule, ReactiveFormsModule, SlideToggleComponent, TranslatePipe], }) export class AccountInformationTabComponent { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts index 68b7178d8b1..9f77727c5f3 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts @@ -46,15 +46,15 @@ import { environment } from '../../../environments/environment'; import { BaseUserInfoApiService } from '../api/base-user-info-api.service'; import { InjectorModule } from '../helper/injector.module'; import { LoggerModule } from '../logger/logger.module'; +import { BASE_URL, ENVIRONMENT, WINDOW_LOCATION } from '../injection-tokens'; import type { Account } from '../models/account/account.interface'; -import { ENVIRONMENT } from './../injection-tokens'; import { AccountComponent } from './account.component'; import { AccountService } from './account.service'; @Component({ selector: 'vitamui-common-account-information-tab', template: '', - standalone: false, + imports: [InjectorModule, MatTabsModule, NoopAnimationsModule, VitamUICommonTestModule], }) class InformationTabStubComponent { @Input() account: Account; @@ -74,13 +74,22 @@ describe('AccountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, MatTabsModule, NoopAnimationsModule, LoggerModule.forRoot(), VitamUICommonTestModule], - declarations: [AccountComponent, InformationTabStubComponent], + imports: [ + InjectorModule, + MatTabsModule, + NoopAnimationsModule, + LoggerModule.forRoot(), + VitamUICommonTestModule, + AccountComponent, + InformationTabStubComponent, + ], providers: [ { provide: AccountService, useValue: accountServiceSpy }, { provide: BaseUserInfoApiService, useValue: userInfoApiServiceSpy }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, { provide: ENVIRONMENT, useValue: environment }, + { provide: BASE_URL, useValue: '/fake-api' }, + { provide: WINDOW_LOCATION, useValue: location }, ], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts index 18f11010439..dda25b12e6d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts @@ -43,12 +43,17 @@ import { ApplicationId } from '../application-id.enum'; import { Account } from '../models/account/account.interface'; import { BreadCrumbData } from '../models/breadcrumb/breadcrumb.interface'; import { AccountService } from './account.service'; +import { VitamuiTitleBreadcrumbComponent } from '../components/vitamui-title-breadcrumb/vitamui-title-breadcrumb.component'; +import { UserPhotoComponent } from '../components/header/user-photo/user-photo.component'; +import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { AccountInformationTabComponent } from './account-information-tab/account-information-tab.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-account', templateUrl: './account.component.html', styleUrls: ['./account.component.scss'], - standalone: false, + imports: [VitamuiTitleBreadcrumbComponent, UserPhotoComponent, MatTabGroup, MatTab, AccountInformationTabComponent, TranslatePipe], }) export class AccountComponent extends AppRootComponent implements OnInit, OnDestroy { private accountService = inject(AccountService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.spec.ts deleted file mode 100644 index d8a2144cb02..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { AccountModule } from './account.module'; - -describe('AccountModule', () => { - let accountModule: AccountModule; - - beforeEach(() => { - accountModule = new AccountModule(); - }); - - it('should create an instance', () => { - expect(accountModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.ts deleted file mode 100644 index eb02f9a71b0..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.module.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatSlideToggleModule } from '@angular/material/slide-toggle'; -import { MatTabsModule } from '@angular/material/tabs'; - -import { EditableFieldModule } from '../components/editable-field/editable-field.module'; -import { UserPhotoModule } from '../components/header/user-photo/user-photo.module'; -import { AccountApplicationTabComponent } from './account-application-tab/account-application-tab.component'; -import { AccountInformationTabComponent } from './account-information-tab/account-information-tab.component'; -import { AccountComponent } from './account.component'; -import { SlideToggleComponent } from '../../../lib/components/slide-toggle/slide-toggle.component'; -import { VitamuiTitleBreadcrumbComponent } from '../components/vitamui-title-breadcrumb/vitamui-title-breadcrumb.component'; -import { VitamUIFieldErrorComponent } from '../components/vitamui-field-error/vitamui-field-error.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - ReactiveFormsModule, - EditableFieldModule, - MatSlideToggleModule, - SlideToggleComponent, - MatTabsModule, - VitamUIFieldErrorComponent, - VitamuiTitleBreadcrumbComponent, - UserPhotoModule, - TranslatePipe, - ], - declarations: [AccountComponent, AccountInformationTabComponent, AccountApplicationTabComponent], -}) -export class AccountModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/archive-unit.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/archive-unit.module.ts index 5395be92caf..fc708bac34d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/archive-unit.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/archive-unit.module.ts @@ -48,7 +48,7 @@ import { ArchiveUnitEditorService } from './components/archive-unit-editor/archi import { EditorBannerComponent } from './components/archive-unit-editor/components/editor-banner/editor-banner.component'; import { ArchiveUnitViewerComponent } from './components/archive-unit-viewer/archive-unit-viewer.component'; import { PhysicalArchiveViewerComponent } from './components/physical-archive-viewer/physical-archive-viewer.component'; -import { CommonTooltipModule } from '../components/common-tooltip/common-tooltip.module'; + import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ @@ -60,17 +60,14 @@ import { TranslatePipe } from '@ngx-translate/core'; MatProgressSpinnerModule, ObjectViewerModule, ObjectEditorModule, - CommonTooltipModule, TranslatePipe, - ], - providers: [ArchiveUnitEditorService], - declarations: [ PhysicalArchiveViewerComponent, ArchiveUnitCountComponent, ArchiveUnitViewerComponent, ArchiveUnitEditorComponent, EditorBannerComponent, ], + providers: [ArchiveUnitEditorService], exports: [ PhysicalArchiveViewerComponent, ArchiveUnitCountComponent, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.spec.ts index 99375195845..42e0467dbf8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.spec.ts @@ -74,9 +74,8 @@ describe('ArchiveUnitCountComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ArchiveUnitCountComponent, PluralPipe], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], - imports: [LoggerModule.forRoot(), MatProgressSpinnerModule, LoggerModule.forRoot()], + imports: [LoggerModule.forRoot(), MatProgressSpinnerModule, LoggerModule.forRoot(), ArchiveUnitCountComponent, PluralPipe], providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts index 2fe22c7d476..122fcdbc202 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts @@ -39,12 +39,16 @@ import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, injec import { Observable, Subscription } from 'rxjs'; import { tap } from 'rxjs/operators'; import { Logger } from '../../../logger/logger'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TooltipDirective } from '../../../components/common-tooltip/tooltip.directive'; +import { PluralPipe } from '../../../pipes/plural.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-archive-unit-count', templateUrl: './archive-unit-count.component.html', styleUrls: ['./archive-unit-count.component.scss'], - standalone: false, + imports: [MatProgressSpinner, TooltipDirective, PluralPipe, TranslatePipe], }) export class ArchiveUnitCountComponent implements OnChanges { private logger = inject(Logger); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/archive-unit-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/archive-unit-editor.component.ts index 06d63011d7d..ee087c3a4fd 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/archive-unit-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/archive-unit-editor.component.ts @@ -43,13 +43,15 @@ import { customTemplate } from '../../archive-unit-template'; import type { ArchiveUnit } from '../../models/archive-unit'; import { JsonPatchDto } from '../../models/json-patch'; import { ArchiveUnitEditorService } from './archive-unit-editor.service'; +import { ObjectEditorComponent } from '../../../object-editor/object-editor.component'; +import { AsyncPipe } from '@angular/common'; @Component({ selector: 'vitamui-common-archive-unit-editor', templateUrl: './archive-unit-editor.component.html', styleUrls: ['./archive-unit-editor.component.scss'], providers: [ArchiveUnitEditorService], - standalone: false, + imports: [ObjectEditorComponent, AsyncPipe], }) export class ArchiveUnitEditorComponent implements OnInit, OnChanges, OnDestroy { private archiveUnitEditorService = inject(ArchiveUnitEditorService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/components/editor-banner/editor-banner.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/components/editor-banner/editor-banner.component.ts index 9a59c30f87f..6443d7aca94 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/components/editor-banner/editor-banner.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-editor/components/editor-banner/editor-banner.component.ts @@ -35,12 +35,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-editor-banner', templateUrl: './editor-banner.component.html', styleUrls: ['./editor-banner.component.scss'], - standalone: false, + imports: [TranslatePipe], }) export class EditorBannerComponent { @Input() title: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts index 9ce5b06f311..02ba5a53989 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts @@ -97,9 +97,8 @@ describe('ArchiveUnitViewerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ArchiveUnitViewerComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [ObjectViewerModule, ObjectEditorModule, ReactiveFormsModule, LoggerModule.forRoot()], + imports: [ObjectViewerModule, ObjectEditorModule, ReactiveFormsModule, LoggerModule.forRoot(), ArchiveUnitViewerComponent], providers: [ { provide: BASE_URL, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.ts index ddeb87f7a1d..bfd4ce62c22 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.ts @@ -39,13 +39,14 @@ import { DisplayObjectService } from '../../../object-viewer/models/display-obje import { DisplayRule } from '../../../object-viewer/models/display-rule.model'; import { customTemplate } from '../../archive-unit-template'; import { ArchiveUnitViewerService, AUMode } from './archive-unit-viewer.service'; +import { ObjectViewerComponent } from '../../../object-viewer/object-viewer.component'; @Component({ selector: 'vitamui-common-archive-unit-viewer', templateUrl: './archive-unit-viewer.component.html', styleUrls: ['./archive-unit-viewer.component.scss'], providers: [{ provide: DisplayObjectService, useClass: ArchiveUnitViewerService }], - standalone: false, + imports: [ObjectViewerComponent], }) export class ArchiveUnitViewerComponent implements OnInit, OnChanges { private displayObjectService = inject(DisplayObjectService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts index 055da0b9c3d..92916839574 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts @@ -35,10 +35,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, Input, OnInit } from '@angular/core'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { ObjectQualifierType } from '../../../models/units/object-qualifier.enums'; import { ValidationError } from '../../../models/units/unit.interface'; import type { VersionWithQualifierDto } from '../../../models/units/object-group.interface'; +import { NgClass, UpperCasePipe } from '@angular/common'; +import { BytesPipe } from '../../../pipes/bytes.pipe'; interface Measurement { name: string; @@ -66,7 +68,7 @@ type MeasurementDisplayMode = 'SYMBOL' | 'NAME'; selector: 'vitamui-common-physical-archive-viewer', templateUrl: './physical-archive-viewer.component.html', styleUrls: ['./physical-archive-viewer.component.scss'], - standalone: false, + imports: [NgClass, UpperCasePipe, BytesPipe, TranslatePipe], }) export class PhysicalArchiveViewerComponent implements OnInit { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.spec.ts deleted file mode 100644 index f25cc69e53d..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.spec.ts +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { Component, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - -import { CollapseComponent } from './collapse.component'; - -@Component({ - template: ` Test Collapse Content `, - standalone: false, -}) -class TesthostComponent { - @ViewChild(CollapseComponent) component: CollapseComponent; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('CollapseComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], - declarations: [CollapseComponent, TesthostComponent], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should have a title', () => { - const elTitle = fixture.nativeElement.querySelector('.collapse-title'); - expect(elTitle).toBeTruthy(); - expect(elTitle.textContent).toContain('Test Collapse Title'); - }); - - it('should display the content', () => { - const elContent = fixture.nativeElement.querySelector('.collapse-content'); - expect(elContent).toBeTruthy(); - expect(elContent.textContent).toContain('Test Collapse Content'); - }); - - it('should toggle the content on click on the title', () => { - expect(testhost.component.collapseState).toBe('expanded'); - const elTitle = fixture.nativeElement.querySelector('.collapse-title'); - - elTitle.click(); - fixture.detectChanges(); - expect(testhost.component.collapseState).toBe('collapsed'); - - elTitle.click(); - fixture.detectChanges(); - expect(testhost.component.collapseState).toBe('expanded'); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts index ef480e14aa4..9ef82cb4032 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts @@ -34,14 +34,14 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, HostBinding, Input } from '@angular/core'; +import { Component, HostBinding, Input, forwardRef } from '@angular/core'; @Component({ selector: 'vitamui-common-collapse', templateUrl: './collapse.component.html', styleUrls: ['./collapse.component.scss'], exportAs: 'vitamuiCommonCollapse', - standalone: false, + imports: [forwardRef(() => CollapseComponent)], }) export class CollapseComponent { @HostBinding('class.collapse-container') classCollapseContainer = true; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.spec.ts deleted file mode 100644 index 689182f9162..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CollapseModule } from './collapse.module'; - -describe('CollapseModule', () => { - let collapseModule: CollapseModule; - - beforeEach(() => { - collapseModule = new CollapseModule(); - }); - - it('should create an instance', () => { - expect(collapseModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.ts deleted file mode 100644 index 65808229189..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -import { CollapseComponent } from './collapse.component'; - -@NgModule({ - imports: [CommonModule], - declarations: [CollapseComponent], - exports: [CollapseComponent], -}) -export class CollapseModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.spec.ts index fbcebc3eb4f..a0e97bde54f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.spec.ts @@ -46,8 +46,7 @@ describe('ClosePopupDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [VitamUICommonTestModule], - declarations: [ClosePopupDialogComponent], + imports: [VitamUICommonTestModule, ClosePopupDialogComponent], schemas: [NO_ERRORS_SCHEMA], providers: [{ provide: MAT_DIALOG_DATA, useValue: {} }], }).compileComponents(); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.ts index 21721002392..d60cec0420b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/close-popup-dialog.component.ts @@ -37,12 +37,14 @@ import { Component, inject } from '@angular/core'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; import { DialogInputData } from './dialog-input-data.interface'; +import { CommonConfirmDialogComponent } from './common-confirm-dialog.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-close-popup-dialog', templateUrl: './close-popup-dialog.component.html', styleUrls: ['./close-popup-dialog.component.scss'], - standalone: false, + imports: [CommonConfirmDialogComponent, TranslatePipe], }) export class ClosePopupDialogComponent { data? = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.spec.ts index afedeaeaebf..f3a138fcba5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.spec.ts @@ -47,8 +47,7 @@ describe('CommonConfirmDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatDialogModule, VitamUICommonTestModule], - declarations: [CommonConfirmDialogComponent], + imports: [MatDialogModule, VitamUICommonTestModule, CommonConfirmDialogComponent], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts index 394d480d04a..85abc966eba 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts @@ -35,12 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; +import { DialogHeaderComponent } from '../../../../lib/components/dialog/dialog-header/dialog-header.component'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-confirm-dialog', templateUrl: './common-confirm-dialog.component.html', styleUrls: ['./common-confirm-dialog.component.scss'], - standalone: false, + imports: [DialogHeaderComponent, CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class CommonConfirmDialogComponent { @Input() dialogTitle: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/confirm-dialog.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/confirm-dialog.module.ts deleted file mode 100644 index f2a55ff3441..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/confirm-dialog.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatDialogModule } from '@angular/material/dialog'; - -import { ClosePopupDialogComponent } from './close-popup-dialog.component'; -import { CommonConfirmDialogComponent } from './common-confirm-dialog.component'; -import { DialogHeaderComponent } from '../../../../lib/components/dialog/dialog-header/dialog-header.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - declarations: [CommonConfirmDialogComponent, ClosePopupDialogComponent], - imports: [CommonModule, MatDialogModule, DialogHeaderComponent, TranslatePipe], - exports: [CommonConfirmDialogComponent, ClosePopupDialogComponent], -}) -export class ConfirmDialogModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.component.ts index ca14bb719dc..4fb4e22e3be 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.component.ts @@ -35,12 +35,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; +import { NgClass } from '@angular/common'; @Component({ selector: 'vitamui-common-tooltip', templateUrl: './common-tooltip.component.html', styleUrls: ['./common-tooltip.component.scss'], - standalone: false, + imports: [NgClass], }) export class CommonTooltipComponent { public text = ''; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.module.ts deleted file mode 100644 index 9c834a6b14c..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/common-tooltip.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { CommonTooltipComponent } from './common-tooltip.component'; -import { TooltipDirective } from './tooltip.directive'; - -@NgModule({ - imports: [CommonModule], - declarations: [CommonTooltipComponent, TooltipDirective], - exports: [CommonTooltipComponent, TooltipDirective], -}) -export class CommonTooltipModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts index 4780d1ed480..9837861c9fe 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts @@ -81,10 +81,7 @@ const VITAMUI_TOOL_TIP_POSITIONS: { [key: string]: ConnectedPosition } = { const TOOLTIP_TRIGGER_CLASS = 'tooltip-trigger'; -@Directive({ - selector: '[vitamuiTooltip]', - standalone: false, -}) +@Directive({ selector: '[vitamuiTooltip]', standalone: true }) export class TooltipDirective implements OnInit, OnDestroy, OnChanges { private overlay = inject(Overlay); private overlayPositionBuilder = inject(OverlayPositionBuilder); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts index cc46828396b..8ca540b51ec 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts @@ -37,15 +37,17 @@ import { Component, ContentChild, Input, TemplateRef, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { PipesModule } from '../../pipes/pipes.module'; -import { CommonTooltipModule } from '../common-tooltip/common-tooltip.module'; + import { Clipboard } from '@angular/cdk/clipboard'; import { TranslatePipe } from '@ngx-translate/core'; +import { TooltipDirective } from '../common-tooltip/tooltip.directive'; @Component({ selector: 'vitamui-common-data', templateUrl: './data.component.html', styleUrls: ['./data.component.scss'], - imports: [CommonModule, PipesModule, CommonTooltipModule, TranslatePipe], + imports: [CommonModule, PipesModule, TooltipDirective, TranslatePipe], + hostDirectives: [{ directive: TooltipDirective, inputs: ['vitamuiTooltipShowDelay'] }], }) export class DataComponent { private clipboard = inject(Clipboard); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts index 184b7078800..243a3594999 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts @@ -47,8 +47,7 @@ describe('DownloadSnackBarComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [DownloadSnackBarComponent], - imports: [MatDialogModule, MatProgressBarModule], + imports: [MatDialogModule, MatProgressBarModule, DownloadSnackBarComponent], providers: [ { provide: MatDialog, @@ -71,13 +70,13 @@ describe('DownloadSnackBarComponent', () => { }); }); -// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; -// import { MatDialog } from '@angular/material/dialog'; -// import { MatProgressBarModule } from '@angular/material/progress-bar'; -// import { empty } from 'rxjs'; +// import {async, ComponentFixture, TestBed} from '@angular/core/testing'; +// import {MatDialog} from '@angular/material/dialog'; +// import {MatProgressBarModule} from '@angular/material/progress-bar'; +// import {empty} from 'rxjs'; -// import { DownloadService } from '../download.service'; -// import { DownloadSnackBarComponent } from './download-snack-bar.component'; +// import {DownloadService} from '../download.service'; +// import {DownloadSnackBarComponent} from './download-snack-bar.component'; // describe('DownloadSnackBarComponent', () => { // let component: DownloadSnackBarComponent; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts index 18e47104d5d..0dcfa996abf 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts @@ -35,15 +35,19 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog } from '@angular/material/dialog'; +import { MatDialog, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { Observable, Subject } from 'rxjs'; import { filter } from 'rxjs/operators'; +import { MatProgressBar } from '@angular/material/progress-bar'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { PercentPipe, I18nPluralPipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-download-snack-bar', templateUrl: './download-snack-bar.component.html', styleUrls: ['./download-snack-bar.component.scss'], - standalone: false, + imports: [MatProgressBar, CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, PercentPipe, I18nPluralPipe, TranslatePipe], }) export class DownloadSnackBarComponent { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.module.ts deleted file mode 100644 index d502dc9ccaa..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { DownloadSnackBarComponent } from '../download-snack-bar/download-snack-bar.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, MatDialogModule, MatProgressBarModule, TranslatePipe], - declarations: [DownloadSnackBarComponent], - exports: [DownloadSnackBarComponent], -}) -export class DownloadSnackBarModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts index e02c732969a..54c6929865b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -// import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +// import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -// import { EditableEmailInputComponent } from './editable-email-input.component'; +// import {EditableEmailInputComponent} from './editable-email-input.component'; // describe('EditableEmailInputComponent', () => { // let component: EditableEmailInputComponent; @@ -75,8 +75,7 @@ describe('EditableEmailInputComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [EditableEmailInputComponent], - imports: [OverlayModule, ReactiveFormsModule, MatSelectModule, NoopAnimationsModule], + imports: [OverlayModule, ReactiveFormsModule, MatSelectModule, NoopAnimationsModule, EditableEmailInputComponent], providers: [{ provide: DOCUMENT, useValue: document }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts index 415722e6875..c6bbd225978 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts @@ -36,10 +36,13 @@ */ import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -import { FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms'; -import { MatSelect } from '@angular/material/select'; +import { FormBuilder, FormGroup, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatSelect, MatOption } from '@angular/material/select'; import { EditableFieldComponent } from '../editable-field.component'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { MatFormField } from '@angular/material/form-field'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; export const EDITABLE_EMAIL_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -52,7 +55,16 @@ export const EDITABLE_EMAIL_INPUT_VALUE_ACCESSOR: any = { templateUrl: './editable-email-input.component.html', styleUrls: ['./editable-email-input.component.scss'], providers: [EDITABLE_EMAIL_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [ + CdkOverlayOrigin, + FormsModule, + ReactiveFormsModule, + MatFormField, + MatSelect, + MatOption, + MatProgressSpinner, + CdkConnectedOverlay, + ], }) export class EditableEmailInputComponent extends EditableFieldComponent { private document = inject(DOCUMENT); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts index 8dd261a58a3..74110c56a0f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts @@ -58,7 +58,6 @@ import { coerceBooleanProperty } from '@angular/cdk/coercion'; @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: 'editable-field-component', - standalone: false, }) export class EditableFieldComponent implements AfterContentInit, ControlValueAccessor { protected elementRef: ElementRef; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.module.ts deleted file mode 100644 index 042a8f77b38..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.module.ts +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { OverlayModule } from '@angular/cdk/overlay'; -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogModule } from '@angular/material/dialog'; -import { MatFormFieldModule } from '@angular/material/form-field'; -import { MatInputModule } from '@angular/material/input'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatSelectModule } from '@angular/material/select'; -import { EllipsisDirectiveModule } from '../../directives/ellipsis/ellipsis.directive.module'; -import { ConfirmDialogModule } from '../common-confirm-dialog/confirm-dialog.module'; -import { EditableEmailInputComponent } from './editable-email-input/editable-email-input.component'; -import { EditableFieldComponent } from './editable-field.component'; -import { EditableFileComponent } from './editable-file/editable-file.component'; -import { EditableInputComponent } from './editable-input/editable-input.component'; -import { EditableLevelInputComponent } from './editable-level-input/editable-level-input.component'; -import { SubLevelPipe } from './editable-level-input/sub-level.pipe'; -import { EditableTextareaComponent } from './editable-textarea/editable-textarea.component'; -import { EditableButtonToggleComponent } from './editable-toggle-group/editable-button-toggle.component'; -import { EditableToggleGroupComponent } from './editable-toggle-group/editable-toggle-group.component'; -import { LevelInputModule } from './level-input/level-input.module'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - OverlayModule, - MatSelectModule, - MatProgressSpinnerModule, - MatButtonToggleModule, - MatDialogModule, - ConfirmDialogModule, - LevelInputModule, - MatInputModule, - MatFormFieldModule, - EllipsisDirectiveModule, - TranslatePipe, - ], - declarations: [ - EditableFieldComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - SubLevelPipe, - ], - exports: [ - EditableFieldComponent, - EditableInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EditableButtonToggleComponent, - EditableFileComponent, - EditableEmailInputComponent, - EditableLevelInputComponent, - SubLevelPipe, - LevelInputModule, - ], -}) -export class EditableFieldModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.spec.ts deleted file mode 100644 index 9b2dcf5f1cb..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.spec.ts +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { AbstractControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of } from 'rxjs'; - -import { WINDOW_LOCATION } from '../../../injection-tokens'; -import { newFile } from '../../../models/customer/identity-provider.interface'; -import { VitamUIFieldErrorComponent } from '../../vitamui-field-error/vitamui-field-error.component'; -import { EditableFileComponent } from './editable-file.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -@Component({ - template: ` - - Expected required error message - Expected async error message - - `, - standalone: false, -}) -class TesthostComponent { - value: File; - label = 'Test label'; - accept = '.txt'; - @ViewChild(EditableFileComponent) - component: EditableFileComponent; - - validator = Validators.required; - asyncValidator = (control: AbstractControl) => { - return of(control.value !== 'invalid value' ? null : { async: true }); - }; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EditableFileComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - let overlayContainerElement: HTMLElement; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [TesthostComponent, EditableFileComponent], - imports: [ - FormsModule, - MatProgressSpinnerModule, - NoopAnimationsModule, - OverlayModule, - ReactiveFormsModule, - VitamUIFieldErrorComponent, - ], - providers: [ - { - provide: WINDOW_LOCATION, - useValue: {}, - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }).compileComponents(); - - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should call enterEditMode() on click', () => { - vi.spyOn(testhost.component, 'enterEditMode'); - const element = fixture.nativeElement.querySelector('.editable-field'); - element.click(); - expect(testhost.component.enterEditMode).toHaveBeenCalled(); - }); - - it('should display the label', () => { - const elLabel = fixture.nativeElement.querySelector('label'); - expect(elLabel.textContent).toContain('Test label'); - }); - - it('should display the value', waitForAsync(() => { - testhost.value = newFile([''], 'test-file.txt'); - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - const elValue = fixture.nativeElement.querySelector('.editable-field .editable-field-content .editable-field-text-content'); - expect(elValue.textContent).toContain('test-file.txt'); - }); - })); - - it('should have an input', () => { - const elInput = fixture.nativeElement.querySelector('input[type=file]'); - expect(elInput).toBeTruthy(); - fixture.detectChanges(); - expect(elInput.attributes.accept.value).toBe('.txt'); - }); - - it('should set the file', () => { - const dbInput = fixture.debugElement.query(By.css('input[type=file]')); - const expectedFile = newFile([''], 'test.txt'); - dbInput.triggerEventHandler('change', { target: { files: { item: () => expectedFile } } }); - expect(testhost.component.file).toBe(expectedFile); - }); - - it('should open then close the action buttons', () => { - testhost.component.enterEditMode(); - fixture.detectChanges(false); - expect(overlayContainerElement.querySelector('.editable-field-actions')).toBeTruthy(); - testhost.component.cancel(); - expect(testhost.component.editMode).toBe(false); - }); - - it('should have a confirm button', () => { - vi.spyOn(testhost.component, 'confirm'); - testhost.component.enterEditMode(); - testhost.component.control.setValue('valid value'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-confirm') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.confirm).toHaveBeenCalled(); - }); - - it('should have a cancel button', () => { - vi.spyOn(testhost.component, 'cancel'); - testhost.component.enterEditMode(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-cancel') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.cancel).toHaveBeenCalled(); - }); - - it('should have a spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(true); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeTruthy(); - }); - - it('should hide the spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(false); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeFalsy(); - }); - - it('should display the error message', () => { - testhost.component.control.setValue(''); - fixture.detectChanges(); - const elErrors = fixture.nativeElement.querySelectorAll('.vitamui-input-errors vitamui-common-field-error'); - expect(elErrors.length).toBe(2); - expect(elErrors[0].textContent).toContain('Expected required error message'); - }); - - it('should display the async error message', () => { - testhost.component.control.setValue('invalid value'); - fixture.detectChanges(); - const elErrors = fixture.nativeElement.querySelectorAll('.vitamui-input-errors vitamui-common-field-error'); - expect(elErrors.length).toBe(2); - expect(elErrors[1].textContent).toContain('Expected async error message'); - }); - }); - - describe('Class', () => { - it('should set the control value', waitForAsync(() => { - testhost.value = newFile([''], 'test-file.txt'); - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toBe(testhost.value); - }); - })); - - describe('canConfirm', () => { - it('should return true when the edit mode is active, the value has changed and is valid', () => { - testhost.component.editMode = true; - testhost.component.control.setValue(newFile([''], 'test-file.txt')); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return false if editMode is not active', () => { - testhost.component.editMode = false; - testhost.component.control.setValue(newFile([''], 'test-file.txt')); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pristine', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(newFile([''], 'test-file.txt')); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is invalid', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValidators(Validators.required); - testhost.component.control.setValue(null); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pending', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue(newFile([''], 'test-file.txt')); - testhost.component.control.markAsDirty(); - testhost.component.control.markAsPending(); - expect(testhost.component.canConfirm).toBe(false); - }); - }); - - it('should emit a new value', waitForAsync(() => { - const originFile = newFile([''], 'origin-file.txt'); - const newFileTmp = newFile([''], 'new-file.txt'); - testhost.value = originFile; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue(newFileTmp); - testhost.component.control.markAsDirty(); - fixture.detectChanges(false); - expect(testhost.value).toEqual(originFile); - testhost.component.confirm(); - expect(testhost.value).toEqual(newFileTmp); - }); - })); - - it('should reverse the changes', waitForAsync(() => { - const originFile = newFile([''], 'origin-file.txt'); - const newFileTmp = newFile([''], 'new-file.txt'); - testhost.value = originFile; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue(newFileTmp); - testhost.component.control.markAsDirty(); - fixture.detectChanges(false); - expect(testhost.value).toEqual(originFile); - testhost.component.cancel(); - fixture.detectChanges(false); - expect(testhost.value).toEqual(originFile); - expect(testhost.component.control.value).toEqual(originFile); - }); - })); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts index 5f1c749c45e..143e072dde5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts @@ -38,6 +38,9 @@ import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@an import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; export const EDITABLE_FILE_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -49,7 +52,7 @@ export const EDITABLE_FILE_VALUE_ACCESSOR: any = { selector: 'vitamui-common-editable-file', templateUrl: './editable-file.component.html', providers: [EDITABLE_FILE_VALUE_ACCESSOR], - standalone: false, + imports: [CdkOverlayOrigin, MatProgressSpinner, CdkConnectedOverlay, TranslatePipe], }) export class EditableFileComponent extends EditableFieldComponent { @Input() accept: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.spec.ts deleted file mode 100644 index 04c8cba6c9a..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.spec.ts +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; -import { Component, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { AbstractControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of } from 'rxjs'; - -import { input } from '../../../../../../testing/src/helpers'; -import { VitamUIFieldErrorComponent } from '../../vitamui-field-error/vitamui-field-error.component'; -import { EditableInputComponent } from './editable-input.component'; - -@Component({ - template: ` - - Expected required error message - Expected async error message - - `, - standalone: false, -}) -class TesthostComponent { - value: string; - label = 'Test label'; - maxlength = 42; - @ViewChild(EditableInputComponent) - component: EditableInputComponent; - - validator = Validators.required; - asyncValidator = (control: AbstractControl) => { - return of(control.value !== 'invalid value' ? null : { async: true }); - }; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EditableInputComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - let overlayContainerElement: HTMLElement; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ - FormsModule, - MatProgressSpinnerModule, - NoopAnimationsModule, - OverlayModule, - ReactiveFormsModule, - VitamUIFieldErrorComponent, - ], - declarations: [EditableInputComponent, TesthostComponent], - }).compileComponents(); - - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should call enterEditMode() on click', () => { - vi.spyOn(testhost.component, 'enterEditMode'); - const element = fixture.nativeElement.querySelector('.editable-field'); - element.click(); - expect(testhost.component.enterEditMode).toHaveBeenCalled(); - }); - - it('should display the label', () => { - const elLabel = fixture.nativeElement.querySelector('label'); - expect(elLabel.textContent).toContain('Test label'); - }); - - it('should display the value', waitForAsync(() => { - testhost.value = 'test value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - const elValue = fixture.nativeElement.querySelector('.editable-field .editable-field-content .editable-field-text-content'); - expect(elValue.textContent).toContain('test value'); - }); - })); - - it('should have an input', () => { - const elInput = fixture.nativeElement.querySelector('.editable-field-control > input'); - expect(elInput).toBeTruthy(); - input(elInput, 'input value'); - fixture.detectChanges(); - expect(testhost.component.control.value).toBe('input value'); - expect(elInput.attributes.maxlength.value).toBe('42'); - }); - - it('should open then close the action buttons', () => { - testhost.component.enterEditMode(); - fixture.detectChanges(false); - expect(overlayContainerElement.querySelector('.editable-field-actions')).toBeTruthy(); - testhost.component.cancel(); - expect(testhost.component.editMode).toBe(false); - }); - - it('should have a confirm button', () => { - vi.spyOn(testhost.component, 'confirm'); - testhost.component.enterEditMode(); - testhost.component.control.setValue('valid value'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-confirm') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.confirm).toHaveBeenCalled(); - }); - - it('should have a cancel button', () => { - vi.spyOn(testhost.component, 'cancel'); - testhost.component.enterEditMode(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-cancel') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.cancel).toHaveBeenCalled(); - }); - - it('should have a spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(true); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeTruthy(); - }); - - it('should hide the spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(false); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeFalsy(); - }); - - it('should display the error message', () => { - testhost.component.control.setValue(''); - fixture.detectChanges(); - const elErrors = fixture.nativeElement.querySelectorAll('.vitamui-input-errors vitamui-common-field-error'); - expect(elErrors.length).toBe(2); - expect(elErrors[0].textContent).toContain('Expected required error message'); - }); - - it('should display the async error message', () => { - testhost.component.control.setValue('invalid value'); - fixture.detectChanges(); - const elErrors = fixture.nativeElement.querySelectorAll('.vitamui-input-errors vitamui-common-field-error'); - expect(elErrors.length).toBe(2); - expect(elErrors[1].textContent).toContain('Expected async error message'); - }); - }); - - describe('Class', () => { - it('should set the control value', waitForAsync(() => { - testhost.value = 'test value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toBe(testhost.value); - }); - })); - - describe('canConfirm', () => { - it('should return true when the edit mode is active, the value has changed and is valid', () => { - testhost.component.editMode = true; - testhost.component.control.setValue(['test1.com', 'test2.com']); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return false if editMode is not active', () => { - testhost.component.editMode = false; - testhost.component.control.setValue('test value'); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pristine', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue('test value'); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is invalid', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValidators(Validators.required); - testhost.component.control.setValue(null); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pending', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue('test value'); - testhost.component.control.markAsDirty(); - testhost.component.control.markAsPending(); - expect(testhost.component.canConfirm).toBe(false); - }); - }); - - it('should emit a new value', waitForAsync(() => { - testhost.value = 'origin value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue('new value'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual('origin value'); - testhost.component.confirm(); - expect(testhost.value).toEqual('new value'); - }); - })); - - it('should reverse the changes', waitForAsync(() => { - testhost.value = 'origin value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue('new value'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual('origin value'); - testhost.component.cancel(); - fixture.detectChanges(); - expect(testhost.value).toEqual('origin value'); - expect(testhost.component.control.value).toEqual('origin value'); - }); - })); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts index fef298f40c7..db7d8136f95 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts @@ -35,10 +35,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { EllipsisDirective } from '../../../directives/ellipsis/ellipsis.directive'; export const EDITABLE_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -51,7 +54,7 @@ export const EDITABLE_INPUT_VALUE_ACCESSOR: any = { templateUrl: './editable-input.component.html', styleUrls: ['./editable-input.component.scss'], providers: [EDITABLE_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [CdkOverlayOrigin, FormsModule, ReactiveFormsModule, MatProgressSpinner, CdkConnectedOverlay, EllipsisDirective], }) export class EditableInputComponent extends EditableFieldComponent { @Input() maxlength: number; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts index 507d2352ee0..14e66c707da 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts @@ -54,7 +54,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' multi: true, }, ], - standalone: false, + imports: [ReactiveFormsModule, OverlayModule], }) class LevelInputStubComponent implements ControlValueAccessor { @Input() prefix: string; @@ -71,8 +71,7 @@ describe('EditableLevelInputComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [EditableLevelInputComponent, LevelInputStubComponent, SubLevelPipe], - imports: [ReactiveFormsModule, OverlayModule], + imports: [ReactiveFormsModule, OverlayModule, EditableLevelInputComponent, LevelInputStubComponent, SubLevelPipe], providers: [ { provide: WINDOW_LOCATION, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts index 9adf44c2401..58629a7fc3c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts @@ -35,8 +35,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, forwardRef, Input, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { LevelInputComponent } from '../level-input/level-input.component'; +import { TranslatePipe } from '@ngx-translate/core'; +import { SubLevelPipe } from './sub-level.pipe'; export const EDITABLE_LEVEL_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -49,7 +53,7 @@ export const EDITABLE_LEVEL_INPUT_VALUE_ACCESSOR: any = { templateUrl: './editable-level-input.component.html', styleUrls: ['./editable-level-input.component.scss'], providers: [EDITABLE_LEVEL_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [CdkOverlayOrigin, LevelInputComponent, FormsModule, ReactiveFormsModule, CdkConnectedOverlay, TranslatePipe, SubLevelPipe], }) export class EditableLevelInputComponent extends EditableFieldComponent { @Input() prefix: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/sub-level.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/sub-level.pipe.ts index ad3b4b9ddee..c1188a57141 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/sub-level.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/sub-level.pipe.ts @@ -37,10 +37,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { extractSubLevel } from '../../../utils/level.util'; -@Pipe({ - name: 'subLevel', - standalone: false, -}) +@Pipe({ name: 'subLevel' }) export class SubLevelPipe implements PipeTransform { transform(level: any, userLevel: string): any { return extractSubLevel(userLevel, level); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.spec.ts deleted file mode 100644 index 5863c83411e..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.spec.ts +++ /dev/null @@ -1,280 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { AbstractControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { of } from 'rxjs'; - -import { input } from '../../../../../../testing/src/helpers'; -import { VitamUIFieldErrorStubComponent } from '../../../../../../testing/src/vitamui-common-test.module'; -import { EditableTextareaComponent } from './editable-textarea.component'; - -@Component({ - template: ` - - Expected required error message - Expected async error message - - `, - standalone: false, -}) -class TesthostComponent { - value: string; - label = 'Test label'; - maxlength = 42; - @ViewChild(EditableTextareaComponent) - component: EditableTextareaComponent; - - validator = Validators.required; - asyncValidator = (control: AbstractControl) => { - return of(control.value !== 'invalid value' ? null : { async: true }); - }; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EditableTextareaComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - let overlayContainerElement: HTMLElement; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [OverlayModule, FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, NoopAnimationsModule], - declarations: [TesthostComponent, EditableTextareaComponent, VitamUIFieldErrorStubComponent], - }).compileComponents(); - - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should call enterEditMode() on click', () => { - vi.spyOn(testhost.component, 'enterEditMode'); - const element = fixture.nativeElement.querySelector('.editable-field'); - element.click(); - expect(testhost.component.enterEditMode).toHaveBeenCalled(); - }); - - it('should display the label', () => { - const elLabel = fixture.nativeElement.querySelector('label'); - expect(elLabel.textContent).toContain('Test label'); - }); - - it('should display the value', waitForAsync(() => { - testhost.value = 'test value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - const elValue = fixture.nativeElement.querySelector('.editable-field .editable-field-content .editable-field-text-content'); - expect(elValue.textContent).toContain('test value'); - }); - })); - - it('should have a textarea', () => { - const elInput = fixture.nativeElement.querySelector('.editable-field-control > textarea'); - expect(elInput).toBeTruthy(); - input(elInput, 'input value'); - fixture.detectChanges(); - expect(testhost.component.control.value).toBe('input value'); - expect(elInput.attributes.maxlength.value).toBe('42'); - }); - - it('should open then close the action buttons', () => { - testhost.component.enterEditMode(); - fixture.detectChanges(false); - expect(overlayContainerElement.querySelector('.editable-field-actions')).toBeTruthy(); - testhost.component.cancel(); - expect(testhost.component.editMode).toBe(false); - }); - - it('should have a confirm button', () => { - vi.spyOn(testhost.component, 'confirm'); - testhost.component.enterEditMode(); - testhost.component.control.setValue('valid value'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-confirm') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.confirm).toHaveBeenCalled(); - }); - - it('should have a cancel button', () => { - vi.spyOn(testhost.component, 'cancel'); - testhost.component.enterEditMode(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-cancel') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.cancel).toHaveBeenCalled(); - }); - - it('should have a spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(true); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeTruthy(); - }); - - it('should hide the spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(false); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeFalsy(); - }); - - it('should display the error message', () => { - testhost.component.control.setValue(''); - fixture.detectChanges(); - const elErrors = fixture.nativeElement.querySelectorAll('.vitamui-input-errors vitamui-common-field-error'); - expect(elErrors.length).toBe(2); - expect(elErrors[0].textContent).toContain('Expected required error message'); - }); - - it('should display the async error message', () => { - testhost.component.control.setValue('invalid value'); - fixture.detectChanges(); - const elErrors = fixture.nativeElement.querySelectorAll('.vitamui-input-errors vitamui-common-field-error'); - expect(elErrors.length).toBe(2); - expect(elErrors[1].textContent).toContain('Expected async error message'); - }); - }); - - describe('Class', () => { - it('should set the control value', waitForAsync(() => { - testhost.value = 'test value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toBe(testhost.value); - }); - })); - - describe('canConfirm', () => { - it('should return true when the edit mode is active, the value has changed and is valid', () => { - testhost.component.editMode = true; - testhost.component.control.setValue(['test1.com', 'test2.com']); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return false if editMode is not active', () => { - testhost.component.editMode = false; - testhost.component.control.setValue('test value'); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pristine', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue('test value'); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is invalid', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValidators(Validators.required); - testhost.component.control.setValue(null); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pending', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue('test value'); - testhost.component.control.markAsDirty(); - testhost.component.control.markAsPending(); - expect(testhost.component.canConfirm).toBe(false); - }); - }); - - it('should emit a new value', waitForAsync(() => { - testhost.value = 'origin value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue('new value'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual('origin value'); - testhost.component.confirm(); - expect(testhost.value).toEqual('new value'); - }); - })); - - it('should reverse the changes', waitForAsync(() => { - testhost.value = 'origin value'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue('new value'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual('origin value'); - testhost.component.cancel(); - fixture.detectChanges(); - expect(testhost.value).toEqual('origin value'); - expect(testhost.component.control.value).toEqual('origin value'); - }); - })); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts index b026c9a2202..46081af4bbc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts @@ -35,10 +35,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; export const EDITABLE_TEXTAREA_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -51,7 +53,7 @@ export const EDITABLE_TEXTAREA_VALUE_ACCESSOR: any = { templateUrl: './editable-textarea.component.html', styleUrls: ['./editable-textarea.component.scss'], providers: [EDITABLE_TEXTAREA_VALUE_ACCESSOR], - standalone: false, + imports: [CdkOverlayOrigin, FormsModule, ReactiveFormsModule, MatProgressSpinner, CdkConnectedOverlay], }) export class EditableTextareaComponent extends EditableFieldComponent { @Input() maxlength: number; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-button-toggle.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-button-toggle.component.ts index ba1b0b5b706..73820af959b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-button-toggle.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-button-toggle.component.ts @@ -39,7 +39,6 @@ import { Component, Input } from '@angular/core'; @Component({ selector: 'vitamui-common-editable-button-toggle', template: '', - standalone: false, }) export class EditableButtonToggleComponent { @Input() value: any; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.spec.ts deleted file mode 100644 index 6d69be119e1..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.spec.ts +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { OverlayContainer, OverlayModule } from '@angular/cdk/overlay'; -import { Component, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; - -import { EditableButtonToggleComponent } from './editable-button-toggle.component'; -import { EditableToggleGroupComponent } from './editable-toggle-group.component'; - -@Component({ - template: ` - - - - - - `, - standalone: false, -}) -class TesthostComponent { - value: string; - label = 'Test label'; - maxlength = 42; - - @ViewChild(EditableToggleGroupComponent) - component: EditableToggleGroupComponent; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EditableToggleGroupComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - let overlayContainerElement: HTMLElement; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [OverlayModule, FormsModule, ReactiveFormsModule, MatProgressSpinnerModule, MatButtonToggleModule], - declarations: [TesthostComponent, EditableToggleGroupComponent, EditableButtonToggleComponent], - }).compileComponents(); - - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - describe('DOM', () => { - it('should call enterEditMode() on click', () => { - vi.spyOn(testhost.component, 'enterEditMode'); - const element = fixture.nativeElement.querySelector('.editable-field'); - element.click(); - expect(testhost.component.enterEditMode).toHaveBeenCalled(); - }); - - it('should display the label', () => { - const elLabel = fixture.nativeElement.querySelector('label'); - expect(elLabel.textContent).toContain('Test label'); - }); - - it('should display the value', waitForAsync(() => { - testhost.value = 'value2'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - const elValue = fixture.nativeElement.querySelector('.editable-field .editable-field-content .editable-field-text-content'); - expect(elValue.textContent).toContain('Content 2'); - }); - })); - - it('should have a mat-button-toggle-group', () => { - const elToggleGroup = fixture.nativeElement.querySelector('.editable-field-control > mat-button-toggle-group'); - expect(elToggleGroup).toBeTruthy(); - }); - - it('should open then close the action buttons', () => { - testhost.component.enterEditMode(); - fixture.detectChanges(false); - expect(overlayContainerElement.querySelector('.editable-field-actions')).toBeTruthy(); - testhost.component.cancel(); - fixture.detectChanges(false); - expect(overlayContainerElement.querySelector('.editable-field-actions')).toBeFalsy(); - }); - - it('should have a confirm button', () => { - vi.spyOn(testhost.component, 'confirm'); - testhost.component.enterEditMode(); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-confirm') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.confirm).toHaveBeenCalled(); - }); - - it('should have a cancel button', () => { - vi.spyOn(testhost.component, 'cancel'); - testhost.component.enterEditMode(); - fixture.detectChanges(); - const elButton = overlayContainerElement.querySelector('.editable-field-actions button.editable-field-cancel') as HTMLButtonElement; - expect(elButton).toBeTruthy(); - elButton.click(); - expect(testhost.component.cancel).toHaveBeenCalled(); - }); - - it('should have a spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(true); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeTruthy(); - }); - - it('should hide the spinner', () => { - vi.spyOn(testhost.component as any, 'showSpinner', 'get').mockReturnValue(false); - fixture.detectChanges(); - const elSpinner = fixture.nativeElement.querySelector('.editable-field mat-spinner'); - expect(elSpinner).toBeFalsy(); - }); - }); - - describe('Class', () => { - it('should set the control value', waitForAsync(() => { - testhost.value = 'value1'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toBe(testhost.value); - }); - })); - - describe('canConfirm', () => { - it('should return true when the edit mode is active, the value has changed and is valid', () => { - testhost.component.editMode = true; - testhost.component.control.setValue('value1'); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(true); - }); - - it('should return false if editMode is not active', () => { - testhost.component.editMode = false; - testhost.component.control.setValue('value1'); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pristine', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue('value1'); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is invalid', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValidators(Validators.required); - testhost.component.control.setValue(null); - testhost.component.control.markAsDirty(); - expect(testhost.component.canConfirm).toBe(false); - }); - - it('should return false if control is pending', () => { - testhost.component.enterEditMode(); - testhost.component.control.setValue('value1'); - testhost.component.control.markAsDirty(); - testhost.component.control.markAsPending(); - expect(testhost.component.canConfirm).toBe(false); - }); - }); - - it('should emit a new value', waitForAsync(() => { - testhost.value = 'value1'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue('value2'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual('value1'); - testhost.component.confirm(); - expect(testhost.value).toEqual('value2'); - }); - })); - - it('should reverse the changes', waitForAsync(() => { - testhost.value = 'value1'; - fixture.detectChanges(); - fixture.whenStable().then(() => { - expect(testhost.component.control.value).toEqual(testhost.value); - testhost.component.enterEditMode(); - testhost.component.control.setValue('value2'); - testhost.component.control.markAsDirty(); - fixture.detectChanges(); - expect(testhost.value).toEqual('value1'); - testhost.component.cancel(); - fixture.detectChanges(); - expect(testhost.value).toEqual('value1'); - expect(testhost.component.control.value).toEqual('value1'); - }); - })); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts index d4efa0687a6..f45fa3f6f4e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts @@ -35,10 +35,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ContentChildren, ElementRef, forwardRef, QueryList, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; import { EditableButtonToggleComponent } from './editable-button-toggle.component'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; export const EDITABLE_TOGGLE_GROUP_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -51,7 +54,15 @@ export const EDITABLE_TOGGLE_GROUP_VALUE_ACCESSOR: any = { templateUrl: './editable-toggle-group.component.html', styleUrls: ['./editable-toggle-group.component.scss'], providers: [EDITABLE_TOGGLE_GROUP_VALUE_ACCESSOR], - standalone: false, + imports: [ + CdkOverlayOrigin, + MatButtonToggleGroup, + FormsModule, + ReactiveFormsModule, + MatButtonToggle, + MatProgressSpinner, + CdkConnectedOverlay, + ], }) export class EditableToggleGroupComponent extends EditableFieldComponent { @ContentChildren(EditableButtonToggleComponent) buttons: QueryList; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts index 68a6bea5478..d9637f7d156 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts @@ -47,8 +47,7 @@ describe('LevelInputComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [LevelInputComponent], - imports: [FormsModule], + imports: [FormsModule, LevelInputComponent], providers: [ { provide: WINDOW_LOCATION, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts index e0111d834d0..5723764ed53 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts @@ -36,9 +36,11 @@ */ import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { Component, ElementRef, forwardRef, HostBinding, HostListener, Input, OnInit, ViewChild } from '@angular/core'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; +import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; import { extractSubLevel } from '../../../utils/level.util'; +import { TranslatePipe } from '@ngx-translate/core'; + export const LEVEL_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => LevelInputComponent), @@ -50,7 +52,7 @@ export const LEVEL_INPUT_VALUE_ACCESSOR: any = { templateUrl: './level-input.component.html', styleUrls: ['./level-input.component.scss'], providers: [LEVEL_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [FormsModule, forwardRef(() => LevelInputComponent), TranslatePipe], }) export class LevelInputComponent implements OnInit, ControlValueAccessor { @Input() prefix: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.spec.ts deleted file mode 100644 index 2a774521d2d..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { LevelInputModule } from './level-input.module'; - -describe('LevelInputComponent', () => { - let levelInputModule: LevelInputModule; - - beforeEach(() => { - levelInputModule = new LevelInputModule(); - }); - - it('should create', () => { - expect(levelInputModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.ts deleted file mode 100644 index aaa0c519422..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; - -import { LevelInputComponent } from './level-input.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, FormsModule, TranslatePipe], - declarations: [LevelInputComponent], - exports: [LevelInputComponent], -}) -export class LevelInputModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts index 7849b01ac52..9cccc82fc6d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts @@ -36,15 +36,16 @@ */ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { MatMenuModule } from '@angular/material/menu'; -import { CommonTooltipModule } from '../common-tooltip/common-tooltip.module'; + import { PipesModule } from '../../pipes/pipes.module'; +import { TooltipDirective } from '../common-tooltip/tooltip.directive'; @Component({ selector: 'vitamui-elements', templateUrl: './elements.component.html', styleUrls: ['elements.component.scss'], standalone: true, - imports: [CommonTooltipModule, MatMenuModule, PipesModule], + imports: [TooltipDirective, MatMenuModule, PipesModule], }) export class ElementsComponent { @Input() icon = ''; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/file-selector/display-file/display-file.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/file-selector/display-file/display-file.component.ts index 120fccd6942..d86e79276bc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/file-selector/display-file/display-file.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/file-selector/display-file/display-file.component.ts @@ -38,11 +38,12 @@ import { Component, input, output } from '@angular/core'; import type { DisplayFile } from './display-file.interface'; import { FormErrorComponent } from '../../../../../lib/components/form-errors/form-error/form-error.component'; import { PipesModule } from '../../../pipes/pipes.module'; -import { CommonTooltipModule } from '../../common-tooltip/common-tooltip.module'; + +import { TooltipDirective } from '../../common-tooltip/tooltip.directive'; @Component({ selector: 'vitamui-display-file', - imports: [FormErrorComponent, PipesModule, CommonTooltipModule], + imports: [FormErrorComponent, PipesModule, TooltipDirective], templateUrl: './display-file.component.html', styleUrl: './display-file.component.scss', }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts index 9ba43559308..6382eb1cc18 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts @@ -37,7 +37,7 @@ import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { SafeResourceUrl, SafeUrl } from '@angular/platform-browser'; -import { ActivatedRoute, Router } from '@angular/router'; +import { ActivatedRoute, Router, RouterLink } from '@angular/router'; import { Subject, Subscription } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ApplicationService } from '../../application.service'; @@ -56,12 +56,32 @@ import { SubrogationService } from './../../subrogation/subrogation.service'; import { TENANT_SELECTION_URL_CONDITION, TenantSelectionService } from './../../tenant-selection.service'; import { MenuOverlayService } from './menu/menu-overlay.service'; import { SelectTenantDialogComponent } from './select-tenant-dialog/select-tenant-dialog.component'; +import { MatToolbar } from '@angular/material/toolbar'; +import { SelectSiteComponent } from './select-site/select-site.component'; +import { SelectLanguageComponent } from './select-language/select-language.component'; +import { ItemSelectComponent } from './item-select/item-select.component'; +import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; +import { UserPhotoComponent } from './user-photo/user-photo.component'; +import { MatMiniFabButton } from '@angular/material/button'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-header', templateUrl: './header.component.html', styleUrls: ['./header.component.scss'], - standalone: false, + imports: [ + MatToolbar, + SelectSiteComponent, + SelectLanguageComponent, + ItemSelectComponent, + MatMenuTrigger, + UserPhotoComponent, + MatMenu, + MatMenuItem, + RouterLink, + MatMiniFabButton, + TranslatePipe, + ], }) export class HeaderComponent implements OnInit, OnDestroy { private subrogationService = inject(SubrogationService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.module.ts index 7dd39b854ed..42886c9584a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.module.ts @@ -41,27 +41,21 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatToolbarModule } from '@angular/material/toolbar'; import { RouterModule } from '@angular/router'; import { HeaderComponent } from './header.component'; -import { ItemSelectModule } from './item-select/item-select.module'; + import { MenuModule } from './menu/menu.module'; -import { SelectLanguageModule } from './select-language/select-language.module'; -import { SelectSiteModule } from './select-site/select-site.module'; -import { UserPhotoModule } from './user-photo/user-photo.module'; + import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [HeaderComponent], imports: [ CommonModule, RouterModule, MatMenuModule, MatToolbarModule, MatButtonModule, - ItemSelectModule, - UserPhotoModule, MenuModule.forRoot(), - SelectLanguageModule, - SelectSiteModule, TranslatePipe, + HeaderComponent, ], exports: [HeaderComponent], }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts index 4fadcb6f02f..1aeb4634598 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts @@ -37,12 +37,14 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import type { MenuOption } from '../../../models/menu-option.interface'; import { Option } from '../../autocomplete/utils/option.interface'; +import { MatFormField, MatLabel, MatSuffix } from '@angular/material/form-field'; +import { MatSelect, MatOption } from '@angular/material/select'; @Component({ selector: 'vitamui-common-item-select', templateUrl: './item-select.component.html', styleUrls: ['./item-select.component.scss'], - standalone: false, + imports: [MatFormField, MatLabel, MatSelect, MatOption, MatSuffix], }) export class ItemSelectComponent { @Input() label: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.module.ts deleted file mode 100644 index 654c3083159..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.module.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { MatSelectModule } from '@angular/material/select'; -import { ItemSelectComponent } from './item-select.component'; - -@NgModule({ - declarations: [ItemSelectComponent], - imports: [CommonModule, FormsModule, MatSelectModule], - exports: [ItemSelectComponent], -}) -export class ItemSelectModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu-application-tile/menu-application-tile.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu-application-tile/menu-application-tile.component.ts index ea417e1f5c9..3eb542da06d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu-application-tile/menu-application-tile.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu-application-tile/menu-application-tile.component.ts @@ -36,12 +36,15 @@ */ import { Component, Input, OnInit } from '@angular/core'; import type { Application } from '../../../../models/application/application.interface'; +import { NgClass } from '@angular/common'; +import { HighlightPipe } from '../../../../pipes/highlight.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-menu-application-tile', templateUrl: './menu-application-tile.component.html', styleUrls: ['./menu-application-tile.component.scss'], - standalone: false, + imports: [NgClass, HighlightPipe, TranslatePipe], }) export class MenuApplicationTileComponent implements OnInit { @Input() diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts index 873721be3ed..342a26c4799 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts @@ -46,10 +46,10 @@ import { ViewChild, ViewChildren, } from '@angular/core'; -import { MatSelectionList, MatSelectionListChange } from '@angular/material/list'; -import { MatTabChangeEvent } from '@angular/material/tabs'; +import { MatSelectionList, MatSelectionListChange, MatListOption } from '@angular/material/list'; +import { MatTabChangeEvent, MatTabGroup, MatTab } from '@angular/material/tabs'; import { Router } from '@angular/router'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { take, takeUntil } from 'rxjs/operators'; import { ApplicationService } from '../../../application.service'; @@ -62,6 +62,11 @@ import { Tenant } from './../../../models/customer/tenant.interface'; import { MenuOverlayRef } from './menu-overlay-ref'; import { MenuOption } from '../../../models/menu-option.interface'; import { normalizeString } from '../../../../../lib/utils/string.util'; +import { ItemSelectComponent } from '../item-select/item-select.component'; +import { MatIconButton } from '@angular/material/button'; +import { MenuApplicationTileComponent } from './menu-application-tile/menu-application-tile.component'; +import { CdkTrapFocus } from '@angular/cdk/a11y'; +import { KeyValuePipe } from '@angular/common'; const APPLICATION_TRANSLATE_PATH = 'APPLICATION'; @@ -74,7 +79,19 @@ interface NgxTranslateApp { selector: 'vitamui-common-menu', templateUrl: './menu.component.html', styleUrls: ['./menu.component.scss'], - standalone: false, + imports: [ + SearchBarComponent, + ItemSelectComponent, + MatIconButton, + MatSelectionList, + MatListOption, + MenuApplicationTileComponent, + MatTabGroup, + MatTab, + CdkTrapFocus, + KeyValuePipe, + TranslatePipe, + ], }) export class MenuComponent implements OnInit, AfterViewInit, OnDestroy { private dialogRef = inject(MenuOverlayRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.module.ts index 1c2aa834f0c..4201da8dd26 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.module.ts @@ -44,7 +44,7 @@ import { MatListModule } from '@angular/material/list'; import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; import { PipesModule } from '../../../pipes/pipes.module'; -import { ItemSelectModule } from '../item-select/item-select.module'; + import { MenuApplicationTileComponent } from './menu-application-tile/menu-application-tile.component'; import { MenuOverlayService } from './menu-overlay.service'; import { MenuComponent } from './menu.component'; @@ -52,7 +52,6 @@ import { SearchBarComponent } from '../../search-bar/search-bar.component'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [MenuComponent, MenuApplicationTileComponent], imports: [ CommonModule, OverlayModule, @@ -64,8 +63,9 @@ import { TranslatePipe } from '@ngx-translate/core'; A11yModule, SearchBarComponent, PipesModule, - ItemSelectModule, TranslatePipe, + MenuComponent, + MenuApplicationTileComponent, ], providers: [MenuOverlayService], exports: [MenuComponent, MenuApplicationTileComponent], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts index a317fa63acb..c101cdb5c0b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts @@ -35,18 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; +import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { AuthService } from '../../../auth.service'; import { FullLangString, LanguageService, MinLangString } from '../../../language.service'; import { BaseUserInfoApiService } from './../../../api/base-user-info-api.service'; +import { ItemSelectComponent } from '../item-select/item-select.component'; +import { MatMiniFabButton } from '@angular/material/button'; +import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; @Component({ selector: 'vitamui-common-select-language', templateUrl: './select-language.component.html', styleUrls: ['./select-language.component.scss'], - standalone: false, + imports: [ItemSelectComponent, MatMiniFabButton, MatMenuTrigger, MatMenu, MatMenuItem, TranslatePipe], }) export class SelectLanguageComponent implements OnInit, OnDestroy { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.module.ts deleted file mode 100644 index 7e07a9df809..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.module.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatMenuModule } from '@angular/material/menu'; -import { ItemSelectModule } from '../item-select/item-select.module'; -import { SelectLanguageComponent } from './select-language.component'; -import { TranslatePipe } from '@ngx-translate/core'; - -@NgModule({ - imports: [CommonModule, MatMenuModule, MatButtonModule, ItemSelectModule, TranslatePipe], - declarations: [SelectLanguageComponent], - exports: [SelectLanguageComponent], -}) -export class SelectLanguageModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts index 53ed36da788..9a6befed8a1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts @@ -42,12 +42,13 @@ import { map, switchMap } from 'rxjs/operators'; import { Operators } from '../../../vitamui-table/operators.enum'; import { SiteApiService } from './../../../api/site-api.service'; import { AuthService } from './../../../auth.service'; +import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; @Component({ selector: 'vitamui-common-select-site', templateUrl: './select-site.component.html', styleUrls: ['./select-site.component.scss'], - standalone: false, + imports: [MatMenuTrigger, MatMenu, MatMenuItem], }) export class SelectSiteComponent implements OnInit { protected http = inject(HttpClient); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.module.ts deleted file mode 100644 index 507698a0cba..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.module.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { MatButtonModule } from '@angular/material/button'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatSelectModule } from '@angular/material/select'; -import { MatToolbarModule } from '@angular/material/toolbar'; -import { ItemSelectModule } from './../item-select/item-select.module'; -import { SelectSiteComponent } from './select-site.component'; - -@NgModule({ - declarations: [SelectSiteComponent], - imports: [CommonModule, MatSelectModule, ItemSelectModule, MatMenuModule, MatToolbarModule, MatButtonModule], - exports: [SelectSiteComponent], -}) -export class SelectSiteModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts index 83e9ef7229d..dcf471f03f0 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts @@ -41,13 +41,14 @@ import { MenuOption } from '../../../models/menu-option.interface'; import { MatButtonModule } from '@angular/material/button'; import { TranslatePipe } from '@ngx-translate/core'; -import { ItemSelectModule } from '../item-select/item-select.module'; + +import { ItemSelectComponent } from '../item-select/item-select.component'; @Component({ selector: 'vitamui-common-select-tenant-dialog', templateUrl: './select-tenant-dialog.component.html', styleUrls: ['./select-tenant-dialog.component.scss'], - imports: [MatButtonModule, TranslatePipe, ItemSelectModule, MatDialogModule], + imports: [MatButtonModule, TranslatePipe, ItemSelectComponent, MatDialogModule], }) export class SelectTenantDialogComponent implements OnInit { private dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts index 06f137f1fb2..c993a643574 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts @@ -39,12 +39,13 @@ import { SafeResourceUrl } from '@angular/platform-browser'; import { AuthService } from '../../../auth.service'; import { ThemeDataType } from '../../../models/customer/theme/themeDataType.enum'; import { ThemeService } from '../../../theme.service'; +import { NgClass } from '@angular/common'; @Component({ selector: 'vitamui-common-user-photo', templateUrl: './user-photo.component.html', styleUrls: ['./user-photo.component.scss'], - standalone: false, + imports: [NgClass], }) export class UserPhotoComponent implements OnInit { private themeService = inject(ThemeService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.module.ts deleted file mode 100644 index cfa75580f43..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.module.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { UserPhotoComponent } from './user-photo.component'; - -@NgModule({ - declarations: [UserPhotoComponent], - imports: [CommonModule], - exports: [UserPhotoComponent], -}) -export class UserPhotoModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.spec.ts deleted file mode 100644 index dac26ae64ff..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.spec.ts +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; -import { By } from '@angular/platform-browser'; -import { WINDOW_LOCATION } from '../../injection-tokens'; -import { SlideToggleComponent } from '../../../../lib/components/slide-toggle/slide-toggle.component'; -import { RoleToggleComponent } from './role-toggle.component'; -import { RoleComponent } from './role.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -@Component({ - template: ` - - Role Test 1 - Role Test 2 - Role Test 3 - - `, - standalone: false, -}) -class TesthostComponent { - roles: any[] = [{ name: 'ROLE_TEST_1' }, { name: 'DEFAULT_ROLE_TEST_1' }, { name: 'DEFAULT_ROLE_TEST_2' }]; -} - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('RoleToggleComponent', () => { - let testhost: TesthostComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [RoleToggleComponent, TesthostComponent, RoleComponent], - imports: [SlideToggleComponent, FormsModule], - providers: [ - { - provide: WINDOW_LOCATION, - useValue: {}, - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should display a list of slide toggles', waitForAsync(() => { - const slideToggles = fixture.debugElement.queryAll(By.directive(SlideToggleComponent)); - - expect(slideToggles.length).toBe(3); - - expect(slideToggles[0].nativeElement.textContent).toContain('Role Test 1'); - expect(slideToggles[1].nativeElement.textContent).toContain('Role Test 2'); - expect(slideToggles[2].nativeElement.textContent).toContain('Role Test 3'); - - fixture.whenStable().then(() => { - fixture.detectChanges(); - expect(slideToggles[0].componentInstance.checked).toBe(true); - expect(slideToggles[1].componentInstance.checked).toBe(false); - expect(slideToggles[2].componentInstance.checked).toBe(false); - }); - })); - - it('should add the role to the list', waitForAsync(() => { - const deCheckBoxes = fixture.debugElement.queryAll(By.css('input[type=checkbox]')); - - fixture.whenStable().then(() => { - deCheckBoxes[1].triggerEventHandler('click', null); - - fixture.detectChanges(); - - expect(testhost.roles).toEqual([ - { name: 'ROLE_TEST_1' }, - { name: 'DEFAULT_ROLE_TEST_1' }, - { name: 'DEFAULT_ROLE_TEST_2' }, - { name: 'ROLE_TEST_2' }, - ]); - }); - })); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.ts index bffd3a8bd78..81e62bbd388 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.component.ts @@ -52,7 +52,6 @@ export const ROLE_TOGGLE_VALUE_ACCESSOR: any = { templateUrl: './role-toggle.component.html', styleUrls: ['./role-toggle.component.scss'], providers: [ROLE_TOGGLE_VALUE_ACCESSOR], - standalone: false, }) export class RoleToggleComponent implements ControlValueAccessor, AfterContentInit { @ContentChildren(RoleComponent, { descendants: true }) roleComponents: QueryList; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.module.ts deleted file mode 100644 index cd6ad311af2..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role-toggle.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { RoleToggleComponent } from './role-toggle.component'; -import { RoleComponent } from './role.component'; -import { SlideToggleComponent } from '../../../../lib/components/slide-toggle/slide-toggle.component'; - -@NgModule({ - declarations: [RoleToggleComponent, RoleComponent], - imports: [CommonModule, FormsModule, SlideToggleComponent], - exports: [RoleToggleComponent, RoleComponent], -}) -export class RoleToggleModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.spec.ts index 46636ad7de0..70203aa275c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.spec.ts @@ -37,7 +37,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; -import { VitamUISlideToggleStubComponent } from '../../../../../testing/src/vitamui-common-test.module'; import { RoleComponent } from './role.component'; describe('RoleComponent', () => { @@ -46,8 +45,7 @@ describe('RoleComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [FormsModule], - declarations: [RoleComponent, VitamUISlideToggleStubComponent], + imports: [FormsModule, RoleComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.ts index c62a86d84ae..70b9b775081 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/role-toggle/role.component.ts @@ -36,12 +36,14 @@ */ import { Component, Input } from '@angular/core'; import { Observable, Subject } from 'rxjs'; +import { SlideToggleComponent } from '../../../../lib/components/slide-toggle/slide-toggle.component'; +import { FormsModule } from '@angular/forms'; @Component({ selector: 'vitamui-common-role', templateUrl: './role.component.html', styleUrls: ['./role.component.scss'], - standalone: false, + imports: [SlideToggleComponent, FormsModule], }) export class RoleComponent { @Input() checked: boolean; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.spec.ts deleted file mode 100644 index 66d617c4aeb..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.spec.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { Component, ViewChild, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { CdkStepperModule } from '@angular/cdk/stepper'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; - -import { StepperComponent } from './stepper.component'; - -@Component({ - template: ` - - - - - - `, - standalone: false, -}) -class TesthostComponent { - @ViewChild(StepperComponent) stepper: StepperComponent; -} - -let testhost: TesthostComponent; -let fixture: ComponentFixture; - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('StepperComponent', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [StepperComponent, CdkStepperModule, NoopAnimationsModule], - declarations: [TesthostComponent], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts index 32d74e81caa..a48df74507c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts @@ -35,14 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup } from '@angular/forms'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { debounceTime } from 'rxjs/operators'; +import { NgStyle } from '@angular/common'; +import { DatepickerComponent } from '../datepicker/datepicker.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-interval-date-picker', templateUrl: './vitamui-interval-date-picker.component.html', styleUrls: ['./vitamui-interval-date-picker.component.scss'], - standalone: false, + imports: [FormsModule, ReactiveFormsModule, NgStyle, DatepickerComponent, TranslatePipe], }) export class VitamuiIntervalDatePickerComponent implements OnInit { private formBuilder = inject(FormBuilder); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts index 292e7cc8150..0bdef0947d3 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts @@ -35,9 +35,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, forwardRef, inject, Input, OnChanges, OnDestroy, SimpleChanges, ViewChild } from '@angular/core'; -import { NG_VALUE_ACCESSOR } from '@angular/forms'; +import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; import { EditableFieldComponent } from '../editable-field/editable-field.component'; +import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { NgClass } from '@angular/common'; +import { TruncatePipe } from '../../pipes/truncate.pipe'; export const MULTIPLE_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -50,7 +54,7 @@ export const MULTIPLE_INPUT_VALUE_ACCESSOR: any = { templateUrl: './vitamui-multi-inputs.component.html', styleUrls: ['./vitamui-multi-inputs.component.scss'], providers: [MULTIPLE_INPUT_VALUE_ACCESSOR], - standalone: false, + imports: [CdkOverlayOrigin, FormsModule, ReactiveFormsModule, MatProgressSpinner, CdkConnectedOverlay, NgClass, TruncatePipe], }) export class VitamuiMultiInputsComponent extends EditableFieldComponent implements OnDestroy, OnChanges { values: string[] = []; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.module.ts index d52b569ff92..bb505457214 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.module.ts @@ -40,12 +40,11 @@ import { NgModule } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { PipesModule } from '../../pipes/pipes.module'; -import { EditableFieldModule } from '../editable-field/editable-field.module'; + import { VitamuiMultiInputsComponent } from './vitamui-multi-inputs.component'; @NgModule({ - declarations: [VitamuiMultiInputsComponent], - imports: [CommonModule, EditableFieldModule, MatProgressSpinnerModule, ReactiveFormsModule, OverlayModule, PipesModule], + imports: [CommonModule, MatProgressSpinnerModule, ReactiveFormsModule, OverlayModule, PipesModule, VitamuiMultiInputsComponent], exports: [VitamuiMultiInputsComponent], }) export class VitamuiMultiInputsModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.component.ts index 8c6696862aa..e12f89cac17 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.component.ts @@ -35,12 +35,15 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { NgClass, NgTemplateOutlet } from '@angular/common'; +import { TooltipDirective } from '../common-tooltip/tooltip.directive'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ selector: 'vitamui-common-sidenav-header', templateUrl: './vitamui-sidenav-header.component.html', styleUrls: ['./vitamui-sidenav-header.component.scss'], - standalone: false, + imports: [NgClass, TooltipDirective, NgTemplateOutlet, MatProgressSpinner], }) export class VitamuiSidenavHeaderComponent { @Input() icon: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.module.ts deleted file mode 100644 index 683c9c4704d..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { CommonTooltipModule } from '../common-tooltip/common-tooltip.module'; -import { VitamuiSidenavHeaderComponent } from './vitamui-sidenav-header.component'; - -@NgModule({ - imports: [CommonModule, ReactiveFormsModule, MatProgressSpinnerModule, CommonTooltipModule], - declarations: [VitamuiSidenavHeaderComponent], - exports: [VitamuiSidenavHeaderComponent], -}) -export class VitamuiSidenavHeaderModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts index ddac3c90023..fe6be75a71d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts @@ -39,16 +39,17 @@ import type { FilingHoldingSchemeNode } from '../../models/nodes/node.interface' import { FormsModule } from '@angular/forms'; import { MatButtonModule } from '@angular/material/button'; import { MatCheckboxModule } from '@angular/material/checkbox'; -import { CommonTooltipModule } from '../common-tooltip/common-tooltip.module'; + import { UnitType } from '../../models/units/unit-type.enum'; import { CommonModule } from '@angular/common'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; +import { TooltipDirective } from '../common-tooltip/tooltip.directive'; @Component({ selector: 'vitamui-tree-node', templateUrl: './vitamui-tree-node.component.html', styleUrls: ['./vitamui-tree-node.component.scss'], - imports: [CommonModule, FormsModule, MatButtonModule, MatCheckboxModule, CommonTooltipModule], + imports: [CommonModule, FormsModule, MatButtonModule, MatCheckboxModule, TooltipDirective], standalone: true, }) export class VitamuiTreeNodeComponent implements AfterContentChecked { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.module.ts deleted file mode 100644 index 83e54aca48e..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.module.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { AutocompletePositionDirective } from './autocomplete-position.directive'; - -@NgModule({ - imports: [CommonModule], - declarations: [AutocompletePositionDirective], - exports: [AutocompletePositionDirective], -}) -export class AutocompletePositionDirectiveModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.ts index 575f69134b1..63ee0c89d53 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/autocomplete-position/autocomplete-position.directive.ts @@ -37,10 +37,7 @@ import { Directive, Input, OnDestroy } from '@angular/core'; import { MatAutocompleteTrigger } from '@angular/material/autocomplete'; -@Directive({ - selector: '[vitamuiAutocompletePosition]', - standalone: false, -}) +@Directive({ selector: '[vitamuiAutocompletePosition]' }) export class AutocompletePositionDirective implements OnDestroy { private matAutocompleteTrigger: MatAutocompleteTrigger; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-container.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-container.directive.ts index 17cb3585ad8..32d415d4fee 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-container.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-container.directive.ts @@ -38,10 +38,7 @@ import { AfterContentInit, ContentChildren, Directive, QueryList } from '@angula import { CollapseDirective } from './collapse.directive'; -@Directive({ - selector: '[vitamuiCommonCollapseContainer]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonCollapseContainer]' }) export class CollapseContainerDirective implements AfterContentInit { @ContentChildren(CollapseDirective) collapseDirectives: QueryList; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-trigger-for.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-trigger-for.directive.ts index 33ba9feee14..707e44b3260 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-trigger-for.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse-trigger-for.directive.ts @@ -38,10 +38,7 @@ import { Directive, HostBinding, HostListener, Input } from '@angular/core'; import { CollapseDirective } from './collapse.directive'; -@Directive({ - selector: '[vitamuiCommonCollapseTriggerFor]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonCollapseTriggerFor]' }) export class CollapseTriggerForDirective { @Input() vitamuiCommonCollapseTriggerFor: CollapseDirective; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.spec.ts deleted file mode 100644 index f1c64fe55b9..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CollapseDirectiveModule } from './collapse.directive.module'; - -describe('CollapseModule', () => { - let collapseModule: CollapseDirectiveModule; - - beforeEach(() => { - collapseModule = new CollapseDirectiveModule(); - }); - - it('should create an instance', () => { - expect(collapseModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.ts deleted file mode 100644 index 81a3c73f23f..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -import { CollapseContainerDirective } from './collapse-container.directive'; -import { CollapseTriggerForDirective } from './collapse-trigger-for.directive'; -import { CollapseDirective } from './collapse.directive'; - -@NgModule({ - imports: [CommonModule], - declarations: [CollapseDirective, CollapseTriggerForDirective, CollapseContainerDirective], - exports: [CollapseDirective, CollapseTriggerForDirective, CollapseContainerDirective], -}) -export class CollapseDirectiveModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.spec.ts deleted file mode 100644 index 47baf8b9baf..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.spec.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { Component, NgModule, NO_ERRORS_SCHEMA, QueryList, ViewChildren } from '@angular/core'; -import { CollapseDirectiveModule } from './collapse.directive.module'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; - -import { CollapseContainerDirective } from './collapse-container.directive'; -import { CollapseTriggerForDirective } from './collapse-trigger-for.directive'; -import { CollapseDirective } from './collapse.directive'; - -@Component({ - template: ` -
- -
- -
- -
- -
- @if (showCollapse) { - -
- } -
- `, - standalone: false, -}) -class TesthostComponent { - @ViewChildren(CollapseDirective) collapseDirectives: QueryList; - showCollapse = false; -} - -@NgModule({ declarations: [TesthostComponent], imports: [CollapseDirectiveModule], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -let fixture: ComponentFixture; -let testhost: TesthostComponent; - -class Page { - get buttons() { - return fixture.debugElement.queryAll(By.css('button')); - } -} - -let page: Page; - -describe('CollapseContainerDirective', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [TesthostComponent, CollapseContainerDirective, CollapseTriggerForDirective, CollapseDirective], - providers: [], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - page = new Page(); - }); - - it('should create an instance', () => { - expect(testhost).toBeTruthy(); - }); - - it('should have 4 collapse directives', () => { - expect(testhost.collapseDirectives.length).toBe(4); - }); - - it('should collapse everything by default', () => { - testhost.collapseDirectives.forEach((collapseDirective) => { - expect(collapseDirective.state).toBe('collapsed'); - }); - }); - - it('should expand the first div', () => { - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - }); - - it('should expand the second div', () => { - expect(testhost.collapseDirectives.toArray()[1].state).toBe('collapsed'); - page.buttons[1].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[1].state).toBe('expanded'); - }); - - it('should expand the third div', () => { - expect(testhost.collapseDirectives.toArray()[2].state).toBe('collapsed'); - page.buttons[2].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[2].state).toBe('expanded'); - }); - - it('should expand the fourth div', () => { - expect(testhost.collapseDirectives.toArray()[3].state).toBe('collapsed'); - page.buttons[3].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[3].state).toBe('expanded'); - }); - - it('should expand and collapse the div', () => { - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - }); - - it('should collapse all other divs', () => { - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - page.buttons[1].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[1].state).toBe('expanded'); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - }); - - it('should work when the template changes', () => { - testhost.showCollapse = true; - fixture.changeDetectorRef.detectChanges(); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - expect(testhost.collapseDirectives.toArray()[4].state).toBe('collapsed'); - page.buttons[4].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - expect(testhost.collapseDirectives.toArray()[4].state).toBe('expanded'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - expect(testhost.collapseDirectives.toArray()[4].state).toBe('collapsed'); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.ts index 3bda9279b80..409af2ae87c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/collapse/collapse.directive.ts @@ -39,7 +39,6 @@ import { Directive, EventEmitter, Input } from '@angular/core'; @Directive({ selector: '[vitamuiCommonCollapse]', exportAs: 'vitamuiCommonCollapse', - standalone: false, }) export class CollapseDirective { @Input() vitamuiCommonCollapse: any; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.module.ts deleted file mode 100644 index fa8d7080438..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { CommonTooltipModule } from '../../components/common-tooltip/common-tooltip.module'; -import { EllipsisDirective } from './ellipsis.directive'; - -@NgModule({ - imports: [CommonModule, CommonTooltipModule], - declarations: [EllipsisDirective], - exports: [EllipsisDirective], -}) -export class EllipsisDirectiveModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.spec.ts deleted file mode 100644 index 4bdbb591024..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.spec.ts +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { Component, ViewChildren, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; - -import { EllipsisDirective } from './ellipsis.directive'; - -@Component({ - template: `
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc efficitur, eros a blandit rhoncus, neque nunc suscipit metus, ut pretium - elit nunc a purus. In a lacus nulla. Maecenas sed malesuada nibh. -
`, - standalone: false, -}) -class TestHostComponent { - @ViewChildren(EllipsisDirective) ellipsisDirective: EllipsisDirective; -} - -let fixture: ComponentFixture; -let testhost: TestHostComponent; - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('EllipsisDirective', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [TestHostComponent, EllipsisDirective], - providers: [], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create an instance', () => { - expect(testhost).toBeTruthy(); - }); - - it('should have a text with ellipsis at the end', () => { - const directiveEl = fixture.debugElement.query(By.directive(EllipsisDirective)); - expect(directiveEl).not.toBeNull(); - - expect(directiveEl.nativeElement.className).toContain('text-ellipsis'); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.ts index 4493cc08784..f2d22b7183e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/ellipsis/ellipsis.directive.ts @@ -59,10 +59,7 @@ const ELLIPSIS_TOOLTIP_POSITION: ConnectedPosition = { overlayY: 'top', }; -@Directive({ - selector: '[vitamuiCommonEllipsis]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonEllipsis]' }) export class EllipsisDirective implements OnInit, AfterViewInit, OnDestroy { private renderer = inject(Renderer2); private elementRef = inject(ElementRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.directive.ts index 3135223249f..8048710823a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.directive.ts @@ -38,10 +38,7 @@ import { Directive, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angu const DEFAULT_SCROLL_THRESHOLD = 0.8; -@Directive({ - selector: '[vitamuiCommonInfiniteScroll]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonInfiniteScroll]' }) export class InfiniteScrollDirective implements OnInit, OnDestroy { @Input() vitamuiCommonInfiniteScrollThreshold = DEFAULT_SCROLL_THRESHOLD; @Input() vitamuiCommonInfiniteScrollDisable = false; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.spec.ts deleted file mode 100644 index eba9048179b..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { InfiniteScrollModule } from './infinite-scroll.module'; - -describe('InfiniteScrollModule', () => { - let infiniteScrollModule: InfiniteScrollModule; - - beforeEach(() => { - infiniteScrollModule = new InfiniteScrollModule(); - }); - - it('should create an instance', () => { - expect(infiniteScrollModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.ts deleted file mode 100644 index 8ebb79351b0..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/infinite-scroll/infinite-scroll.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -import { InfiniteScrollDirective } from './infinite-scroll.directive'; - -@NgModule({ - imports: [CommonModule], - declarations: [InfiniteScrollDirective], - exports: [InfiniteScrollDirective], -}) -export class InfiniteScrollModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts index 098c46d09f8..4ec7c9934da 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts @@ -55,7 +55,8 @@ import { ResizeSidebarDirective } from './resize-sidebar.directive'; } `, ], - standalone: false, + standalone: true, + imports: [ResizeSidebarDirective], }) class ResizeSidebarTestComponent {} @@ -64,7 +65,7 @@ describe('ResizeSidebarDirective', () => { beforeEach(() => { fixture = TestBed.configureTestingModule({ - declarations: [ResizeSidebarDirective, ResizeSidebarTestComponent], + imports: [ResizeSidebarTestComponent], }).createComponent(ResizeSidebarTestComponent); fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts index dc1473b407a..36e1df28dd9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts @@ -38,10 +38,7 @@ import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2, inject } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -@Directive({ - selector: '[vitamuiCommonResizeSidebar]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonResizeSidebar]', standalone: true }) export class ResizeSidebarDirective implements OnInit { private elementRef = inject(ElementRef); private renderer = inject(Renderer2); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.module.ts deleted file mode 100644 index 1d065ed9e3d..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { ResizeSidebarDirective } from './resize-sidebar.directive'; -import { ResizeVerticalDirective } from './resize-vertical.directive'; - -@NgModule({ - imports: [CommonModule], - declarations: [ResizeSidebarDirective, ResizeVerticalDirective], - exports: [ResizeSidebarDirective, ResizeVerticalDirective], -}) -export class ResizeSidebarModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts index 79b1696be89..444836759de 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts @@ -59,7 +59,8 @@ import { ResizeVerticalDirective } from './resize-vertical.directive'; } `, ], - standalone: false, + standalone: true, + imports: [ResizeVerticalDirective], }) class ResizeVerticalBarTestComponent {} @@ -68,7 +69,7 @@ describe('ResizeVerticalDirective', () => { beforeEach(() => { fixture = TestBed.configureTestingModule({ - declarations: [ResizeVerticalDirective, ResizeVerticalBarTestComponent], + imports: [ResizeVerticalBarTestComponent], }).createComponent(ResizeVerticalBarTestComponent); fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts index 3174ccc62a1..afebc103cf9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts @@ -38,10 +38,7 @@ import { Directive, ElementRef, HostListener, Input, OnInit, inject } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -@Directive({ - selector: '[vitamuiVerticalResizeSidebar]', - standalone: false, -}) +@Directive({ selector: '[vitamuiVerticalResizeSidebar]', standalone: true }) export class ResizeVerticalDirective implements OnInit { private elementRef = inject(ElementRef); private document = inject(DOCUMENT); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-container.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-container.directive.ts index b0408125aed..afcc41fa90d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-container.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-container.directive.ts @@ -38,10 +38,7 @@ import { AfterContentInit, ContentChildren, Directive, QueryList } from '@angula import { RowCollapseDirective } from './row-collapse.directive'; -@Directive({ - selector: '[vitamuiCommonRowCollapseContainer]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonRowCollapseContainer]' }) export class RowCollapseContainerDirective implements AfterContentInit { @ContentChildren(RowCollapseDirective) collapseDirectives: QueryList; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-trigger-for.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-trigger-for.directive.ts index 20282928e0a..56f4186afd1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-trigger-for.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse-trigger-for.directive.ts @@ -38,10 +38,7 @@ import { Directive, HostBinding, HostListener, Input } from '@angular/core'; import { RowCollapseDirective } from './row-collapse.directive'; -@Directive({ - selector: '[vitamuiCommonRowCollapseTriggerFor]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonRowCollapseTriggerFor]' }) export class RowCollapseTriggerForDirective { @Input() vitamuiCommonRowCollapseTriggerFor: RowCollapseDirective; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.spec.ts deleted file mode 100644 index 156f582304c..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.spec.ts +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ - -import { Component, NgModule, NO_ERRORS_SCHEMA, QueryList, ViewChildren } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { By } from '@angular/platform-browser'; - -import { RowCollapseContainerDirective } from './row-collapse-container.directive'; -import { RowCollapseTriggerForDirective } from './row-collapse-trigger-for.directive'; -import { RowCollapseDirective } from './row-collapse.directive'; -import { RowCollapseModule } from './row-collapse.module'; - -@Component({ - template: ` -
- -
- -
- -
- -
- @if (showCollapse) { - -
- } -
- `, - standalone: false, -}) -class TesthostComponent { - @ViewChildren(RowCollapseDirective) collapseDirectives: QueryList; - showCollapse = false; -} - -@NgModule({ declarations: [TesthostComponent], imports: [RowCollapseModule], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -let fixture: ComponentFixture; -let testhost: TesthostComponent; - -class Page { - get buttons() { - return fixture.debugElement.queryAll(By.css('button')); - } -} - -let page: Page; - -describe('CollapseContainerDirective', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [TesthostComponent, RowCollapseContainerDirective, RowCollapseTriggerForDirective, RowCollapseDirective], - providers: [], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - page = new Page(); - }); - - it('should create an instance', () => { - expect(testhost).toBeTruthy(); - }); - - it('should have 4 collapse directives', () => { - expect(testhost.collapseDirectives.length).toBe(4); - }); - - it('should collapse everything by default', () => { - testhost.collapseDirectives.forEach((collapseDirective) => { - expect(collapseDirective.state).toBe('collapsed'); - }); - }); - - it('should expand the first div', () => { - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - }); - - it('should expand the second div', () => { - expect(testhost.collapseDirectives.toArray()[1].state).toBe('collapsed'); - page.buttons[1].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[1].state).toBe('expanded'); - }); - - it('should expand the third div', () => { - expect(testhost.collapseDirectives.toArray()[2].state).toBe('collapsed'); - page.buttons[2].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[2].state).toBe('expanded'); - }); - - it('should expand the fourth div', () => { - expect(testhost.collapseDirectives.toArray()[3].state).toBe('collapsed'); - page.buttons[3].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[3].state).toBe('expanded'); - }); - - it('should expand and collapse the div', () => { - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - }); - - it('should collapse all other divs', () => { - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - page.buttons[1].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[1].state).toBe('expanded'); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - }); - - it('should work when the template changes', () => { - testhost.showCollapse = true; - fixture.changeDetectorRef.detectChanges(); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - expect(testhost.collapseDirectives.toArray()[4].state).toBe('collapsed'); - page.buttons[4].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('collapsed'); - expect(testhost.collapseDirectives.toArray()[4].state).toBe('expanded'); - page.buttons[0].triggerEventHandler('click', null); - expect(testhost.collapseDirectives.toArray()[0].state).toBe('expanded'); - expect(testhost.collapseDirectives.toArray()[4].state).toBe('collapsed'); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.ts index 1caf5f6b38e..89e256fe3b6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.directive.ts @@ -39,7 +39,6 @@ import { Directive, EventEmitter, Output } from '@angular/core'; @Directive({ selector: '[vitamuiCommonRowCollapse]', exportAs: 'vitamuiRowCollapse', - standalone: false, }) export class RowCollapseDirective { @Output() expanded = new EventEmitter(); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.spec.ts deleted file mode 100644 index 90f0f311ae8..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { RowCollapseModule } from './row-collapse.module'; - -describe('RowCollapseModule', () => { - let rowCollapseModule: RowCollapseModule; - - beforeEach(() => { - rowCollapseModule = new RowCollapseModule(); - }); - - it('should create an instance', () => { - expect(rowCollapseModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.ts deleted file mode 100644 index 8021a9caf34..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/row-collapse/row-collapse.module.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -import { RowCollapseContainerDirective } from './row-collapse-container.directive'; -import { RowCollapseTriggerForDirective } from './row-collapse-trigger-for.directive'; -import { RowCollapseDirective } from './row-collapse.directive'; - -@NgModule({ - imports: [CommonModule], - declarations: [RowCollapseDirective, RowCollapseTriggerForDirective, RowCollapseContainerDirective], - exports: [RowCollapseDirective, RowCollapseTriggerForDirective, RowCollapseContainerDirective], -}) -export class RowCollapseModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/history.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/history.module.ts index 86ba1a7ae6e..893ddaa955f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/history.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/history.module.ts @@ -38,7 +38,6 @@ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { CollapseModule } from '../../components/collapse/collapse.module'; import { PipesModule } from '../../pipes/pipes.module'; import { MultiOperationHistoryTabComponent } from './multi-operation-history-tab/multi-operation-history-tab.component'; import { OperationHistoryTabComponent } from './operation-history-tab/operation-history-tab.component'; @@ -47,7 +46,6 @@ import { EventTypeLabelComponent } from '../event-type-label/event-type-label.co @NgModule({ imports: [ CommonModule, - CollapseModule, MatProgressSpinnerModule, EventTypeLabelComponent, PipesModule, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/multi-operation-history-tab/multi-operation-history-tab.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/multi-operation-history-tab/multi-operation-history-tab.component.ts index cfbc11f00a3..6d2300bee1d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/multi-operation-history-tab/multi-operation-history-tab.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/multi-operation-history-tab/multi-operation-history-tab.component.ts @@ -44,8 +44,9 @@ import { HistoryEvent } from '../../../models/logbook/event.interface'; import { LogbookService } from '../../logbook.service'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; -import { CollapseModule } from '../../../components/collapse/collapse.module'; + import { HistoryEventsComponent } from '../history-events/history-events.component'; +import { CollapseComponent } from '../../../components/collapse/collapse.component'; const EVENT_LIMIT = 100; @@ -53,7 +54,7 @@ const EVENT_LIMIT = 100; selector: 'vitamui-common-multi-operation-history-tab', templateUrl: './multi-operation-history-tab.component.html', styleUrls: ['./multi-operation-history-tab.component.scss'], - imports: [MatProgressSpinner, TranslatePipe, CollapseModule, HistoryEventsComponent], + imports: [MatProgressSpinner, TranslatePipe, CollapseComponent, HistoryEventsComponent], }) export class MultiOperationHistoryTabComponent implements OnChanges, OnDestroy { private authService = inject(AuthService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/operation-history-tab/operation-history-tab.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/operation-history-tab/operation-history-tab.component.ts index 7bf2acd4bfe..d1625e17bf6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/operation-history-tab/operation-history-tab.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/logbook/history/operation-history-tab/operation-history-tab.component.ts @@ -43,9 +43,10 @@ import { AuthService } from '../../../auth.service'; import { HistoryEvent } from '../../../models/logbook/event.interface'; import { LogbookService } from '../../logbook.service'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { CollapseModule } from '../../../components/collapse/collapse.module'; + import { TranslatePipe } from '@ngx-translate/core'; import { HistoryEventsComponent } from '../history-events/history-events.component'; +import { CollapseComponent } from '../../../components/collapse/collapse.component'; const EVENT_LIMIT = 100; @@ -53,7 +54,7 @@ const EVENT_LIMIT = 100; selector: 'vitamui-common-operation-history-tab', templateUrl: './operation-history-tab.component.html', styleUrls: ['./operation-history-tab.component.scss'], - imports: [MatProgressSpinner, CollapseModule, HistoryEventsComponent, TranslatePipe], + imports: [MatProgressSpinner, CollapseComponent, HistoryEventsComponent, TranslatePipe], }) export class OperationHistoryTabComponent implements OnChanges, OnDestroy { private authService = inject(AuthService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.spec.ts index 913f4c5697a..702f53f5a50 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.spec.ts @@ -47,8 +47,7 @@ describe('GroupEditorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [GroupEditorComponent], - imports: [LoggerModule.forRoot(), PipesModule, MatDialogModule], + imports: [LoggerModule.forRoot(), PipesModule, MatDialogModule, GroupEditorComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts index 0f2e84e1fb9..355430fd250 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { AfterViewInit, Component, Input, OnChanges, OnDestroy, SimpleChanges, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; +import { MatDialog, MatDialogConfig, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { Subscription, of } from 'rxjs'; import { filter, switchMap } from 'rxjs/operators'; import { FavoriteEntryService } from '../../../object-viewer/services/favorite-entry.service'; @@ -44,12 +44,36 @@ import { TypeService } from '../../../object-viewer/services/type.service'; import { DisplayObjectType } from '../../../object-viewer/types'; import { Action } from '../../models/edit-object.model'; import type { EditObject } from '../../models/edit-object.model'; +import { AccordionComponent } from '../../../components/accordion/accordion.component'; +import { NgClass, NgTemplateOutlet } from '@angular/common'; +import { VitamuiMenuButtonComponent } from '../../../components/vitamui-menu-button/vitamui-menu-button.component'; +import { MatMenuItem } from '@angular/material/menu'; +import { ListEditorComponent } from '../list-editor/list-editor.component'; +import { PrimitiveEditorComponent } from '../primitive-editor/primitive-editor.component'; +import { DialogHeaderComponent } from '../../../../../lib/components/dialog/dialog-header/dialog-header.component'; +import { EmptyPipe } from '../../../pipes/empty.pipe'; +import { AppendStarPipe } from '../../required.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-group-editor', templateUrl: './group-editor.component.html', styleUrls: ['./group-editor.component.scss'], - standalone: false, + imports: [ + AccordionComponent, + NgClass, + VitamuiMenuButtonComponent, + MatMenuItem, + NgTemplateOutlet, + ListEditorComponent, + PrimitiveEditorComponent, + DialogHeaderComponent, + MatDialogActions, + MatDialogClose, + EmptyPipe, + AppendStarPipe, + TranslatePipe, + ], }) export class GroupEditorComponent implements OnChanges, AfterViewInit, OnDestroy { private layoutService = inject(LayoutService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.spec.ts index c0f35faf307..7e31a55e9a4 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.spec.ts @@ -45,8 +45,7 @@ describe('ListEditorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ListEditorComponent], - imports: [LoggerModule.forRoot()], + imports: [LoggerModule.forRoot(), ListEditorComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts index ab45a86d849..4640a285ede 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts @@ -35,16 +35,42 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { FormControl } from '@angular/forms'; +import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FavoriteEntryService } from '../../../object-viewer/services/favorite-entry.service'; import { DisplayObjectType } from '../../../object-viewer/types'; import type { EditObject } from '../../models/edit-object.model'; +import { NgClass, NgTemplateOutlet } from '@angular/common'; +import { GroupEditorComponent } from '../group-editor/group-editor.component'; +import { PrimitiveEditorComponent } from '../primitive-editor/primitive-editor.component'; +import { InputComponent } from '../../../../../lib/components/input/input.component'; +import { EditorListInputComponent } from '../editor-list-input.component'; +import { EditorListTextareaComponent } from '../editor-list-textarea.component'; +import { EditorListSelectComponent } from '../editor-list-select.component'; +import { EditorListDateComponent } from '../editor-list-date.component'; +import { EmptyPipe } from '../../../pipes/empty.pipe'; +import { AppendStarPipe } from '../../required.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-list-editor', templateUrl: './list-editor.component.html', styleUrls: ['./list-editor.component.scss'], - standalone: false, + imports: [ + NgClass, + NgTemplateOutlet, + GroupEditorComponent, + PrimitiveEditorComponent, + InputComponent, + FormsModule, + ReactiveFormsModule, + EditorListInputComponent, + EditorListTextareaComponent, + EditorListSelectComponent, + EditorListDateComponent, + EmptyPipe, + AppendStarPipe, + TranslatePipe, + ], }) export class ListEditorComponent implements OnChanges { private favoriteEntryService = inject(FavoriteEntryService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.spec.ts index 87a9a951f66..ad3bbdef81c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.spec.ts @@ -45,8 +45,7 @@ describe('PrimitiveEditorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [PrimitiveEditorComponent], - imports: [LoggerModule.forRoot()], + imports: [LoggerModule.forRoot(), PrimitiveEditorComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts index 8a61d6aa1ac..63d30d08305 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts @@ -39,14 +39,31 @@ import { Logger } from '../../../logger/logger'; import { DateDisplayService } from '../../../object-viewer/services/date-display.service'; import { ComponentType } from '../../../object-viewer/types'; import type { EditObject } from '../../models/edit-object.model'; -import { FormControl } from '@angular/forms'; +import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { DatePatternConstants } from '../../../dates.constants'; +import { EditorInputComponent } from '../editor-input.component'; +import { EditorTextareaComponent } from '../editor-textarea.component'; +import { EditorSelectComponent } from '../editor-select.component'; +import { DatepickerComponent } from '../../../components/datepicker/datepicker.component'; +import { HintComponent } from '../../../components/hint/hint.component'; +import { EmptyPipe } from '../../../pipes/empty.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-primitive-editor', templateUrl: './primitive-editor.component.html', styleUrls: ['./primitive-editor.component.scss'], - standalone: false, + imports: [ + EditorInputComponent, + EditorTextareaComponent, + EditorSelectComponent, + DatepickerComponent, + FormsModule, + ReactiveFormsModule, + HintComponent, + EmptyPipe, + TranslatePipe, + ], }) export class PrimitiveEditorComponent implements OnInit { private logger = inject(Logger); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.spec.ts index dd9ec460b5b..3790d9b75f6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.spec.ts @@ -46,8 +46,7 @@ describe('ObjectEditorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ObjectEditorComponent], - imports: [LoggerModule.forRoot(), ObjectViewerModule], + imports: [LoggerModule.forRoot(), ObjectViewerModule, ObjectEditorComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.ts index 5b0e7bf1524..9186919f819 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.component.ts @@ -35,15 +35,18 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; -import { FormGroup } from '@angular/forms'; +import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { DisplayObjectType } from '../object-viewer/types'; import type { EditObject } from './models/edit-object.model'; +import { GroupEditorComponent } from './components/group-editor/group-editor.component'; +import { ListEditorComponent } from './components/list-editor/list-editor.component'; +import { PrimitiveEditorComponent } from './components/primitive-editor/primitive-editor.component'; @Component({ selector: 'vitamui-common-object-editor', templateUrl: './object-editor.component.html', styles: [], - standalone: false, + imports: [FormsModule, ReactiveFormsModule, GroupEditorComponent, ListEditorComponent, PrimitiveEditorComponent], }) export class ObjectEditorComponent { @Input() editObject!: EditObject; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.module.ts index 3d8bbc93190..3ab3ef30428 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/object-editor.module.ts @@ -73,7 +73,6 @@ import { MatMenuItem } from '@angular/material/menu'; import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - declarations: [ObjectEditorComponent, GroupEditorComponent, ListEditorComponent, PrimitiveEditorComponent], providers: [ { provide: DisplayObjectService, useClass: PathStrategyDisplayObjectService }, EditObjectService, @@ -109,6 +108,10 @@ import { TranslatePipe } from '@ngx-translate/core'; DialogHeaderComponent, MatMenuItem, TranslatePipe, + ObjectEditorComponent, + GroupEditorComponent, + ListEditorComponent, + PrimitiveEditorComponent, ], exports: [ObjectEditorComponent, GroupEditorComponent, ListEditorComponent, PrimitiveEditorComponent], }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/group/group.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/group/group.component.ts index dd1935bdac0..b261816d6ba 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/group/group.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/group/group.component.ts @@ -40,12 +40,19 @@ import { internationalizedKeys } from '../../services/display-object-helper.serv import { FavoriteEntryService } from '../../services/favorite-entry.service'; import { LayoutService } from '../../services/layout.service'; import { DisplayObjectType } from '../../types'; +import { DataComponent } from '../../../components/data/data.component'; +import { NgTemplateOutlet } from '@angular/common'; +import { AccordionComponent } from '../../../components/accordion/accordion.component'; +import { ListComponent } from '../list/list.component'; +import { PrimitiveComponent } from '../primitive/primitive.component'; +import { EmptyPipe } from '../../../pipes/empty.pipe'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-group', templateUrl: './group.component.html', styleUrls: ['./group.component.scss'], - standalone: false, + imports: [DataComponent, NgTemplateOutlet, AccordionComponent, ListComponent, PrimitiveComponent, EmptyPipe, TranslatePipe], }) export class GroupComponent implements OnInit, OnChanges { private layoutService = inject(LayoutService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/list/list.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/list/list.component.ts index fe17e17bbd4..7f354c0da47 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/list/list.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/list/list.component.ts @@ -39,12 +39,16 @@ import type { DisplayObject } from '../../models/display-object.model'; import { FavoriteEntryService } from '../../services/favorite-entry.service'; import { TypeService } from '../../services/type.service'; import { DisplayObjectType } from '../../types'; +import { GroupComponent } from '../group/group.component'; +import { PrimitiveComponent } from '../primitive/primitive.component'; +import { DataComponent } from '../../../components/data/data.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-list', templateUrl: './list.component.html', styleUrls: ['./list.component.scss'], - standalone: false, + imports: [GroupComponent, PrimitiveComponent, DataComponent, TranslatePipe], }) export class ListComponent implements OnChanges { private typeService = inject(TypeService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/primitive/primitive.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/primitive/primitive.component.ts index f8227ce41a6..bbabb1c9607 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/primitive/primitive.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/components/primitive/primitive.component.ts @@ -38,12 +38,14 @@ import { DatePipe } from '@angular/common'; import { Component, inject, Input, OnInit } from '@angular/core'; import type { DisplayObject } from '../../models/display-object.model'; import { DateDisplayService } from '../../services/date-display.service'; +import { DataComponent } from '../../../components/data/data.component'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-primitive', templateUrl: './primitive.component.html', styleUrls: ['./primitive.component.scss'], - standalone: false, + imports: [DataComponent, TranslatePipe], }) export class PrimitiveComponent implements OnInit { private dateDisplayService = inject(DateDisplayService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts index 9500227a413..b1e02415522 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts @@ -91,9 +91,8 @@ describe('ObjectViewerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ObjectViewerComponent, GroupComponent, ListComponent, PrimitiveComponent, EmptyPipe], schemas: [CUSTOM_ELEMENTS_SCHEMA], - imports: [LoggerModule.forRoot()], + imports: [LoggerModule.forRoot(), ObjectViewerComponent, GroupComponent, ListComponent, PrimitiveComponent, EmptyPipe], providers: [ DataStructureService, TypeService, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.ts index 01e48516be3..bd941c7bfb7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.ts @@ -40,12 +40,16 @@ import { DisplayObjectService } from './models/display-object-service'; import { DisplayRule } from './models/display-rule.model'; import { Mode } from './models/display-object.enum'; import { AUMode } from '../archive-unit/components/archive-unit-viewer/archive-unit-viewer.service'; +import { GroupComponent } from './components/group/group.component'; +import { ListComponent } from './components/list/list.component'; +import { PrimitiveComponent } from './components/primitive/primitive.component'; +import { AsyncPipe } from '@angular/common'; @Component({ selector: 'vitamui-common-object-viewer', templateUrl: './object-viewer.component.html', styleUrls: ['./object-viewer.component.scss'], - standalone: false, + imports: [GroupComponent, ListComponent, PrimitiveComponent, AsyncPipe], }) export class ObjectViewerComponent implements OnInit, OnChanges { private logger = inject(Logger); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.module.ts index 7bb37d5b5e7..0d111a867d2 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.module.ts @@ -52,8 +52,18 @@ import { AccordionComponent } from '../components/accordion/accordion.component' import { TranslatePipe } from '@ngx-translate/core'; @NgModule({ - imports: [CommonModule, PipesModule, MatProgressSpinnerModule, AccordionComponent, DataComponent, TranslatePipe], - declarations: [ObjectViewerComponent, GroupComponent, ListComponent, PrimitiveComponent], + imports: [ + CommonModule, + PipesModule, + MatProgressSpinnerModule, + AccordionComponent, + DataComponent, + TranslatePipe, + ObjectViewerComponent, + GroupComponent, + ListComponent, + PrimitiveComponent, + ], providers: [ DisplayObjectHelperService, DisplayRuleHelperService, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts index 3696cff69fd..99ac591bdb7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts @@ -43,10 +43,7 @@ import localeFr from '@angular/common/locales/fr'; registerLocaleData(localeFr, 'fr'); -@Pipe({ - name: 'bytes', - standalone: false, -}) +@Pipe({ name: 'bytes' }) export class BytesPipe implements PipeTransform { private numberPipe = inject(DecimalPipe); private logger = inject(Logger, { optional: true }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts index 1ce3b4ad1c3..da31a6b7b87 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts @@ -37,10 +37,7 @@ import { DatePipe } from '@angular/common'; import { Pipe, PipeTransform, inject } from '@angular/core'; -@Pipe({ - name: 'dateTime', - standalone: false, -}) +@Pipe({ name: 'dateTime' }) export class DateTimePipe implements PipeTransform { private datePipe: DatePipe; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/empty.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/empty.pipe.ts index 9da8d9fec1f..1fae1a6a7b4 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/empty.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/empty.pipe.ts @@ -36,10 +36,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ - name: 'empty', - standalone: false, -}) +@Pipe({ name: 'empty' }) export class EmptyPipe implements PipeTransform { transform(value: string): any { return value?.trim() ? value : '— —'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/filesize.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/filesize.pipe.ts index d2f5123fc5c..6ef248763a7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/filesize.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/filesize.pipe.ts @@ -36,10 +36,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ - name: 'fileSize', - standalone: false, -}) +@Pipe({ name: 'fileSize' }) export class FileSizePipe implements PipeTransform { fileSizeUnit = 1024; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts index b12d7183e09..be1e4fd4eae 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts @@ -40,10 +40,7 @@ import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import DOMPurify from 'dompurify'; import { normalizeString } from '../../../lib/utils/string.util'; -@Pipe({ - name: 'highlight', - standalone: false, -}) +@Pipe({ name: 'highlight' }) export class HighlightPipe implements PipeTransform { private sanitizer: DomSanitizer; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/pipes.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/pipes.module.ts index 9649483933f..e05f9c34efc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/pipes.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/pipes.module.ts @@ -63,8 +63,7 @@ const pipes = [ ]; @NgModule({ - imports: [CommonModule], - declarations: pipes, + imports: [CommonModule, ...pipes], exports: pipes, providers: [DatePipe, DecimalPipe], }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/plural.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/plural.pipe.ts index a836d7ac5fd..c72bd80ab6a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/plural.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/plural.pipe.ts @@ -36,10 +36,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ - name: 'plural', - standalone: false, -}) +@Pipe({ name: 'plural' }) export class PluralPipe implements PipeTransform { transform(value: string, count: number) { if (value.charAt(value.length - 1) === 's') { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts index 3b58930b0bd..52be9aedf44 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts @@ -37,10 +37,7 @@ import { Pipe, PipeTransform, inject } from '@angular/core'; import { DomSanitizer, SafeStyle } from '@angular/platform-browser'; -@Pipe({ - name: 'safeStyle', - standalone: false, -}) +@Pipe({ name: 'safeStyle' }) export class SafeStylePipe implements PipeTransform { private sanitizer = inject(DomSanitizer); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/strongify.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/strongify.pipe.ts index 144bd03d0e2..3115e47b001 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/strongify.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/strongify.pipe.ts @@ -36,10 +36,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ - name: 'strongify', - standalone: false, -}) +@Pipe({ name: 'strongify' }) export class StrongifyPipe implements PipeTransform { transform(value: any, search: string): any { if (!search) { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/truncate.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/truncate.pipe.ts index f7f4f4a655f..2c1b74898b9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/truncate.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/truncate.pipe.ts @@ -36,10 +36,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ - name: 'truncate', - standalone: false, -}) +@Pipe({ name: 'truncate' }) export class TruncatePipe implements PipeTransform { transform(value: string = '', limit: number): any { const ellipsis = '...'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/unitI18n.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/unitI18n.pipe.ts index 60e8ec2f169..e22fc254a15 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/unitI18n.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/unitI18n.pipe.ts @@ -45,10 +45,7 @@ import { Unit } from '../models/units/unit.interface'; * Otherwise, it'll get any available translation. * Otherwise, empty string. */ -@Pipe({ - name: 'unitI18n', - standalone: false, -}) +@Pipe({ name: 'unitI18n' }) export class UnitI18nPipe implements PipeTransform { transform(unit: Unit, attribute: 'Title' | 'Description') { return getUnitI18nAttribute(unit, attribute); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts index 995f48f445c..7446f250a06 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts @@ -37,10 +37,7 @@ import { Pipe, PipeTransform, inject } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; -@Pipe({ - name: 'yesNo', - standalone: false, -}) +@Pipe({ name: 'yesNo' }) export class YesNoPipe implements PipeTransform { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts index f708bc5586e..70eb232fe2f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts @@ -46,7 +46,8 @@ const TEST_ELEMENT_ID = 'test'; @Component({ template: ` Lorem ipsum `, - standalone: false, + standalone: true, + imports: [HasAnyRoleDirective], }) class TestHostComponent { public roles: string[] = ['ROLE_GET', 'ROLE_CREATE']; @@ -63,7 +64,7 @@ describe('HasAnyRoleDirective', () => { user$: new Subject(), }; TestBed.configureTestingModule({ - declarations: [TestHostComponent, HasAnyRoleDirective], + imports: [TestHostComponent, HasAnyRoleDirective], providers: [ { provide: AuthService, useValue: authStubService }, { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts index af52b1efff3..0564d580145 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts @@ -40,10 +40,7 @@ import { Subscription } from 'rxjs'; import { ApplicationId } from '../application-id.enum'; import { SecurityService } from './security.service'; -@Directive({ - selector: '[vitamuiCommonHasAnyRole]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonHasAnyRole]', standalone: true }) export class HasAnyRoleDirective implements OnDestroy { private templateRef = inject>(TemplateRef); private viewContainer = inject(ViewContainerRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts index dcd927c3c3e..60a525b7929 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts @@ -48,7 +48,8 @@ const TEST_ELEMENT_ID = 'test'; template: ` Lorem ipsum `, - standalone: false, + standalone: true, + imports: [HasRoleDirective], }) class TestHostComponent {} @@ -72,7 +73,7 @@ describe('HasRoleDirective', () => { }), }; TestBed.configureTestingModule({ - declarations: [TestHostComponent, HasRoleDirective], + imports: [TestHostComponent, HasRoleDirective], providers: [ { provide: AuthService, useValue: authStubService }, { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts index a0e261fff97..2aec1ee943f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts @@ -38,10 +38,7 @@ import { Directive, Input, OnDestroy, TemplateRef, ViewContainerRef, inject } fr import { Subscription } from 'rxjs'; import { SecurityService } from './security.service'; -@Directive({ - selector: '[vitamuiCommonHasRole]', - standalone: false, -}) +@Directive({ selector: '[vitamuiCommonHasRole]', standalone: true }) export class HasRoleDirective implements OnDestroy { private templateRef = inject>(TemplateRef); private viewContainer = inject(ViewContainerRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.spec.ts deleted file mode 100644 index 8913ac62b49..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { SecurityModule } from './security.module'; - -describe('SecurityModule', () => { - let securityModule: SecurityModule; - - beforeEach(() => { - securityModule = new SecurityModule(); - }); - - it('should create an instance', () => { - expect(securityModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.ts deleted file mode 100644 index 8e5243063cb..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/security.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { NgModule } from '@angular/core'; - -import { HasAnyRoleDirective } from './has-any-role.directive'; -import { HasRoleDirective } from './has-role.directive'; - -@NgModule({ - imports: [], - declarations: [HasRoleDirective, HasAnyRoleDirective], - exports: [HasRoleDirective, HasAnyRoleDirective], -}) -export class SecurityModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.spec.ts index bb4ea209b2a..1db7b068e5e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.spec.ts @@ -50,8 +50,7 @@ describe('SubrogationBannerComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatDialogModule, VitamUICommonTestModule], - declarations: [SubrogationBannerComponent], + imports: [MatDialogModule, VitamUICommonTestModule, SubrogationBannerComponent], providers: [ { provide: AuthService, useValue: { user$: of(EMPTY) } }, { provide: SubrogationService, useValue: { getCurrent: () => of(null), stop: () => of(null) } }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.ts index 59f03e30d73..7b2cea1a825 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-banner/subrogation-banner.component.ts @@ -41,11 +41,13 @@ import { AuthService } from '../../auth.service'; import { Subrogation } from '../../models/subrogation/subrogation.interface'; import { AuthUser } from '../../models/user/auth-user.interface'; import { SubrogationService } from '../subrogation.service'; +import { DatePipe } from '@angular/common'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-subrogation-banner', templateUrl: './subrogation-banner.component.html', - standalone: false, + imports: [DatePipe, TranslatePipe], }) export class SubrogationBannerComponent implements OnInit { authService = inject(AuthService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts index 2510bb9cfaf..6767f6cfb9d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts @@ -35,18 +35,39 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; import { AuthService } from '../../auth.service'; import { SnackBarService } from '../../components/snack-bar/snack-bar.service'; import { Subrogation } from '../../models/subrogation/subrogation.interface'; import { SubrogationService } from '../subrogation.service'; +import { DialogHeaderComponent } from '../../../../lib/components/dialog/dialog-header/dialog-header.component'; +import { StepperComponent } from '../../components/stepper/stepper.component'; +import { CdkStep } from '@angular/cdk/stepper'; +import { CdkScrollable } from '@angular/cdk/scrolling'; +import { InputComponent } from '../../../../lib/components/input/input.component'; +import { SelectComponent } from '../../../../lib/components/select/select.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-subrogation-modal', templateUrl: './subrogation-modal.component.html', styleUrls: ['./subrogation-modal.component.scss'], - standalone: false, + imports: [ + DialogHeaderComponent, + StepperComponent, + CdkStep, + CdkScrollable, + MatDialogContent, + FormsModule, + ReactiveFormsModule, + InputComponent, + SelectComponent, + MatDialogActions, + MatProgressSpinner, + TranslatePipe, + ], }) export class SubrogationModalComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts index 741a43cf877..6ad5ee13ed4 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts @@ -52,8 +52,7 @@ describe('SubrogationSnackBarComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [SubrogationSnackBarComponent], - imports: [VitamUICommonTestModule], + imports: [VitamUICommonTestModule, SubrogationSnackBarComponent], providers: [ { provide: MAT_SNACK_BAR_DATA, useValue: {} }, { provide: BASE_URL, useValue: '/fakeapi' }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.ts index 4f59dc0a860..10d2595166d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.ts @@ -38,10 +38,11 @@ import { Component, inject } from '@angular/core'; import { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar'; import { SubrogationApiService } from '../../api/subrogation-api.service'; import { SnackBarService } from '../../components/snack-bar/snack-bar.service'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ templateUrl: './subrogation-snack-bar.component.html', - standalone: false, + imports: [TranslatePipe], }) export class SubrogationSnackBarComponent { data = inject(MAT_SNACK_BAR_DATA); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.module.ts index 308886d3973..320a6d41925 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.module.ts @@ -43,7 +43,6 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { ConfirmDialogModule } from '../components/common-confirm-dialog/confirm-dialog.module'; import { WINDOW_LOCATION } from '../injection-tokens'; import { PipesModule } from '../pipes/pipes.module'; import { SubrogationBannerComponent } from './subrogation-banner/subrogation-banner.component'; @@ -68,15 +67,16 @@ import { TranslatePipe } from '@ngx-translate/core'; CdkStepperModule, StepperComponent, ReactiveFormsModule, - ConfirmDialogModule, CommonProgressBarComponent, PipesModule, DialogHeaderComponent, SelectComponent, InputComponent, TranslatePipe, + SubrogationBannerComponent, + SubrogationModalComponent, + SubrogationSnackBarComponent, ], - declarations: [SubrogationBannerComponent, SubrogationModalComponent, SubrogationSnackBarComponent], exports: [SubrogationBannerComponent], providers: [{ provide: WINDOW_LOCATION, useValue: window.location }], }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-common.module.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-common.module.ts index 20e7bc87ab1..c5cccf8cea7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-common.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-common.module.ts @@ -41,39 +41,30 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatDialogModule } from '@angular/material/dialog'; import { first, switchMap } from 'rxjs/operators'; -import { AccountModule } from './account/account.module'; + import { ArchiveUnitModule } from './archive-unit/archive-unit.module'; import { AuthService } from './auth.service'; import { ChipComponent } from './components/chip/chip.component'; -import { CollapseModule } from './components/collapse/collapse.module'; -import { CommonTooltipModule } from './components/common-tooltip/common-tooltip.module'; -import { ConfirmDialogModule } from './components/common-confirm-dialog/confirm-dialog.module'; -import { DownloadSnackBarModule } from './components/download-snack-bar/download-snack-bar.module'; -import { EditableFieldModule } from './components/editable-field/editable-field.module'; + import { FileSelectorComponent } from './components/file-selector/file-selector.component'; import { HeaderModule } from './components/header/header.module'; -import { SelectLanguageModule } from './components/header/select-language/select-language.module'; -import { UserPhotoModule } from './components/header/user-photo/user-photo.module'; + import { LogbookOperationFacetComponent } from './components/logbook-operation-facet/logbook-operation-facet.component'; import { VitamuiIntervalDatePickerComponent } from './components/vitamui-interval-date-picker/vitamui-interval-date-picker.component'; import { VitamuiMultiInputsModule } from './components/vitamui-multi-inputs/vitamui-multi-inputs.module'; -import { VitamuiSidenavHeaderModule } from './components/vitamui-sidenav-header/vitamui-sidenav-header.module'; + import { ConfigService } from './config.service'; -import { AutocompletePositionDirectiveModule } from './directives/autocomplete-position/autocomplete-position.directive.module'; -import { CollapseDirectiveModule } from './directives/collapse/collapse.directive.module'; + import { DragAndDropDirective } from './directives/drag-and-drop/drag-and-drop.directive'; import { ClickOutsideDirective } from './directives/click-outside/click-outside.directive'; -import { EllipsisDirectiveModule } from './directives/ellipsis/ellipsis.directive.module'; -import { InfiniteScrollModule } from './directives/infinite-scroll/infinite-scroll.module'; -import { ResizeSidebarModule } from './directives/resize-sidebar/resize-sidebar.module'; -import { RowCollapseModule } from './directives/row-collapse/row-collapse.module'; + import { ENVIRONMENT, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION } from './injection-tokens'; import { LogbookModule } from './logbook/logbook.module'; import { LoggerModule } from './logger/logger.module'; import { ObjectEditorModule } from './object-editor/object-editor.module'; import { ObjectViewerModule } from './object-viewer/object-viewer.module'; import { PipesModule } from './pipes/pipes.module'; -import { SecurityModule } from './security/security.module'; + import { StartupService } from './startup.service'; import { SubrogationModule } from './subrogation/subrogation.module'; import { VitamUIHttpInterceptor } from './vitamui-http-interceptor'; @@ -111,6 +102,41 @@ import { EventTypeLabelComponent } from './logbook/event-type-label/event-type-l import { HistoryEventsComponent } from './logbook/history/history-events/history-events.component'; import { TranslatePipe } from '@ngx-translate/core'; +import { AutocompletePositionDirective } from './directives/autocomplete-position/autocomplete-position.directive'; +import { ClosePopupDialogComponent } from './components/common-confirm-dialog/close-popup-dialog.component'; +import { CollapseComponent } from './components/collapse/collapse.component'; +import { CollapseContainerDirective } from './directives/collapse/collapse-container.directive'; +import { CollapseDirective } from './directives/collapse/collapse.directive'; +import { CollapseTriggerForDirective } from './directives/collapse/collapse-trigger-for.directive'; +import { CommonConfirmDialogComponent } from './components/common-confirm-dialog/common-confirm-dialog.component'; +import { CommonTooltipComponent } from './components/common-tooltip/common-tooltip.component'; +import { DialogHeaderComponent } from '../../lib/components/dialog/dialog-header/dialog-header.component'; +import { DownloadSnackBarComponent } from './components/download-snack-bar/download-snack-bar.component'; +import { EditableButtonToggleComponent } from './components/editable-field/editable-toggle-group/editable-button-toggle.component'; +import { EditableEmailInputComponent } from './components/editable-field/editable-email-input/editable-email-input.component'; +import { EditableFieldComponent } from './components/editable-field/editable-field.component'; +import { EditableFileComponent } from './components/editable-field/editable-file/editable-file.component'; +import { EditableInputComponent } from './components/editable-field/editable-input/editable-input.component'; +import { EditableLevelInputComponent } from './components/editable-field/editable-level-input/editable-level-input.component'; +import { EditableTextareaComponent } from './components/editable-field/editable-textarea/editable-textarea.component'; +import { EditableToggleGroupComponent } from './components/editable-field/editable-toggle-group/editable-toggle-group.component'; +import { EllipsisDirective } from './directives/ellipsis/ellipsis.directive'; +import { FilingPlanComponent } from '../../lib/components/filing-plan/filing-plan.component'; +import { InfiniteScrollDirective } from './directives/infinite-scroll/infinite-scroll.directive'; +import { LevelInputComponent } from './components/editable-field/level-input/level-input.component'; +import { RoleComponent } from './components/role-toggle/role.component'; +import { RoleToggleComponent } from './components/role-toggle/role-toggle.component'; +import { RowCollapseContainerDirective } from './directives/row-collapse/row-collapse-container.directive'; +import { RowCollapseDirective } from './directives/row-collapse/row-collapse.directive'; +import { RowCollapseTriggerForDirective } from './directives/row-collapse/row-collapse-trigger-for.directive'; +import { SelectLanguageComponent } from './components/header/select-language/select-language.component'; +import { SubLevelPipe } from './components/editable-field/editable-level-input/sub-level.pipe'; +import { TooltipDirective } from './components/common-tooltip/tooltip.directive'; +import { UserPhotoComponent } from './components/header/user-photo/user-photo.component'; +import { VitamuiSidenavHeaderComponent } from './components/vitamui-sidenav-header/vitamui-sidenav-header.component'; +import { VitamUIRadioComponent } from '../../lib/components/vitamui-radio/vitamui-radio.component'; +import { VitamUIRadioGroupComponent } from '../../lib/components/vitamui-radio-group/vitamui-radio-group.component'; + export function loadConfigFactory(configService: ConfigService, environment: any) { const p = () => configService.load(environment.configUrls).toPromise(); @@ -135,13 +161,10 @@ export function startupServiceFactory(startupService: StartupService, authServic } @NgModule({ - declarations: [VitamuiIntervalDatePickerComponent], exports: [ AccordionComponent, - AccountModule, ApplicationCardComponent, ArchiveUnitModule, - AutocompletePositionDirectiveModule, BadgeComponent, InformationBlocComponent, InformationDetailComponent, @@ -149,22 +172,15 @@ export function startupServiceFactory(startupService: StartupService, authServic ChipComponent, ElementsComponent, ClickOutsideDirective, - CollapseDirectiveModule, - CollapseModule, CommonProgressBarComponent, - CommonTooltipModule, - ConfirmDialogModule, DataComponent, DatepickerComponent, DragAndDropDirective, - EditableFieldModule, - EllipsisDirectiveModule, EventTypeLabelComponent, FileSelectorComponent, FooterComponent, HeaderModule, HistoryEventsComponent, - InfiniteScrollModule, InputComponent, LogbookModule, LogbookOperationFacetComponent, @@ -173,11 +189,7 @@ export function startupServiceFactory(startupService: StartupService, authServic ObjectViewerModule, OrderByButtonComponent, PipesModule, - ResizeSidebarModule, - RowCollapseModule, SearchBarComponent, - SecurityModule, - SelectLanguageModule, SlideToggleComponent, StepperComponent, SubrogationModule, @@ -185,7 +197,6 @@ export function startupServiceFactory(startupService: StartupService, authServic TableFilterDirective, TableFilterOptionComponent, TableFilterSearchComponent, - UserPhotoModule, VitamUIFieldErrorComponent, SnackBarComponent, VitamuiBannerComponent, @@ -195,39 +206,65 @@ export function startupServiceFactory(startupService: StartupService, authServic VitamuiIntervalDatePickerComponent, VitamuiMenuButtonComponent, VitamuiMultiInputsModule, - VitamuiSidenavHeaderModule, VitamuiSupHeaderComponent, VitamuiTitleBreadcrumbComponent, VitamuiTreeNodeComponent, + + AutocompletePositionDirective, + ClosePopupDialogComponent, + CollapseComponent, + CollapseContainerDirective, + CollapseDirective, + CollapseTriggerForDirective, + CommonConfirmDialogComponent, + CommonTooltipComponent, + DialogHeaderComponent, + DownloadSnackBarComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FilingPlanComponent, + InfiniteScrollDirective, + LevelInputComponent, + RoleComponent, + RoleToggleComponent, + RowCollapseContainerDirective, + RowCollapseDirective, + RowCollapseTriggerForDirective, + SelectLanguageComponent, + SubLevelPipe, + TooltipDirective, + UserPhotoComponent, + VitamuiSidenavHeaderComponent, + VitamUIRadioComponent, + VitamUIRadioGroupComponent, ], imports: [ AccordionComponent, - AccountModule, ApplicationCardComponent, ArchiveUnitModule, - AutocompletePositionDirectiveModule, BadgeComponent, InformationBlocComponent, InformationDetailComponent, ChipComponent, ElementsComponent, ClickOutsideDirective, - CollapseDirectiveModule, CommonModule, CommonProgressBarComponent, - ConfirmDialogModule, DataComponent, DatepickerComponent, - DownloadSnackBarModule, DragAndDropDirective, - EditableFieldModule, - EllipsisDirectiveModule, EventTypeLabelComponent, FileSelectorComponent, FooterComponent, HeaderModule, HistoryEventsComponent, - InfiniteScrollModule, InputComponent, LogbookModule, LogbookOperationFacetComponent, @@ -239,10 +276,7 @@ export function startupServiceFactory(startupService: StartupService, authServic OrderByButtonComponent, PipesModule, ReactiveFormsModule, - ResizeSidebarModule, - RowCollapseModule, SearchBarComponent, - SecurityModule, SlideToggleComponent, StepperComponent, SubrogationModule, @@ -250,7 +284,6 @@ export function startupServiceFactory(startupService: StartupService, authServic TableFilterDirective, TableFilterOptionComponent, TableFilterSearchComponent, - UserPhotoModule, VitamUIFieldErrorComponent, SnackBarComponent, VitamuiBannerComponent, @@ -259,11 +292,46 @@ export function startupServiceFactory(startupService: StartupService, authServic VitamuiFacetComponent, VitamuiMenuButtonComponent, VitamuiMultiInputsModule, - VitamuiSidenavHeaderModule, VitamuiSupHeaderComponent, VitamuiTitleBreadcrumbComponent, VitamuiTreeNodeComponent, TranslatePipe, + VitamuiIntervalDatePickerComponent, + + AutocompletePositionDirective, + ClosePopupDialogComponent, + CollapseComponent, + CollapseContainerDirective, + CollapseDirective, + CollapseTriggerForDirective, + CommonConfirmDialogComponent, + CommonTooltipComponent, + DialogHeaderComponent, + DownloadSnackBarComponent, + EditableButtonToggleComponent, + EditableEmailInputComponent, + EditableFieldComponent, + EditableFileComponent, + EditableInputComponent, + EditableLevelInputComponent, + EditableTextareaComponent, + EditableToggleGroupComponent, + EllipsisDirective, + FilingPlanComponent, + InfiniteScrollDirective, + LevelInputComponent, + RoleComponent, + RoleToggleComponent, + RowCollapseContainerDirective, + RowCollapseDirective, + RowCollapseTriggerForDirective, + SelectLanguageComponent, + SubLevelPipe, + TooltipDirective, + UserPhotoComponent, + VitamuiSidenavHeaderComponent, + VitamUIRadioComponent, + VitamUIRadioGroupComponent, ], providers: [provideHttpClient(withInterceptorsFromDi())], }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.ts index 1d32d8c7bed..914b1ed10b5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.ts @@ -74,14 +74,15 @@ import { Component, Input } from '@angular/core'; import { MatDialogModule } from '@angular/material/dialog'; -import { ConfirmDialogModule } from '../../../app/modules/components/common-confirm-dialog/confirm-dialog.module'; + import { TranslatePipe } from '@ngx-translate/core'; +import { CommonConfirmDialogComponent } from '../../../app/modules/components/common-confirm-dialog/common-confirm-dialog.component'; @Component({ selector: 'vitamui-confirm-action', templateUrl: './confirm-action.component.html', styleUrls: ['./confirm-action.component.scss'], - imports: [MatDialogModule, ConfirmDialogModule, TranslatePipe], + imports: [MatDialogModule, CommonConfirmDialogComponent, TranslatePipe], }) export class ConfirmActionComponent { // delete or changeTab diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/dialog/confirm-dialog/confirm-dialog.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/dialog/confirm-dialog/confirm-dialog.component.ts index 617d81c723c..aafa2312657 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/dialog/confirm-dialog/confirm-dialog.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/dialog/confirm-dialog/confirm-dialog.component.ts @@ -38,12 +38,13 @@ import { DialogModule } from '@angular/cdk/dialog'; import { Component, inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog'; import { ConfirmDialogData } from '../../../models/confirm-dialog-data.interface'; -import { ConfirmDialogModule } from '../../../../app/modules/components/common-confirm-dialog/confirm-dialog.module'; + import { TranslatePipe } from '@ngx-translate/core'; +import { CommonConfirmDialogComponent } from '../../../../app/modules/components/common-confirm-dialog/common-confirm-dialog.component'; @Component({ selector: 'vitamui-confirm-dialog', - imports: [DialogModule, MatDialogModule, ConfirmDialogModule, TranslatePipe], + imports: [DialogModule, MatDialogModule, CommonConfirmDialogComponent, TranslatePipe], templateUrl: './confirm-dialog.component.html', }) export class ConfirmDialogComponent { diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-list/discussion-list.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-list/discussion-list.component.ts index b09a9e59377..e79856f21cc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-list/discussion-list.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-list/discussion-list.component.ts @@ -39,11 +39,12 @@ import { DatePipe } from '@angular/common'; import { Discussion, DiscussionDto, Message } from '../discussion.service'; import { ContentDividerComponent } from '../content-divider/content-divider.component'; import { TranslatePipe } from '@ngx-translate/core'; -import { EllipsisDirectiveModule } from '../../../../app/modules/directives/ellipsis/ellipsis.directive.module'; + +import { EllipsisDirective } from '../../../../app/modules/directives/ellipsis/ellipsis.directive'; @Component({ selector: 'vitamui-discussion-list', - imports: [DatePipe, TranslatePipe, ContentDividerComponent, EllipsisDirectiveModule], + imports: [DatePipe, TranslatePipe, ContentDividerComponent, EllipsisDirective], templateUrl: './discussion-list.component.html', styleUrl: './discussion-list.component.scss', }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-title/discussion-title.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-title/discussion-title.component.ts index ec940d87458..e8723e9926a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-title/discussion-title.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion-title/discussion-title.component.ts @@ -36,7 +36,7 @@ */ import { Component, inject, input, output } from '@angular/core'; import { NgTemplateOutlet } from '@angular/common'; -import { VitamUICommonModule } from '../../../../app/modules/vitamui-common.module'; +import { TooltipDirective } from '../../../../app/modules/components/common-tooltip/tooltip.directive'; import { TranslatePipe } from '@ngx-translate/core'; import { CdkDragMove, DragDropModule } from '@angular/cdk/drag-drop'; import { MatMenuItem, MatMenuModule } from '@angular/material/menu'; @@ -51,7 +51,7 @@ import { DiscussionIconComponent } from '../discussion-icon/discussion-icon.comp VitamuiMenuButtonComponent, TranslatePipe, NgTemplateOutlet, - VitamUICommonModule, + TooltipDirective, DragDropModule, MatMenuModule, MatMenuItem, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion/message/message.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion/message/message.component.ts index d5d62ce1bbd..dbaca642af3 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion/message/message.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/discussions/discussion/message/message.component.ts @@ -39,7 +39,7 @@ import { Component, computed, HostBinding, HostListener, inject, input, output } import { AuthService } from '../../../../../app/modules/auth.service'; import { VitamUICommonModule } from '../../../../../app/modules/vitamui-common.module'; import { Discussion, DiscussionService, Message } from '../../discussion.service'; -import { CommonTooltipModule } from '../../../../../app/modules/components/common-tooltip/common-tooltip.module'; + import { InputComponent } from '../../../input/input.component'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { TranslatePipe } from '@ngx-translate/core'; @@ -47,10 +47,11 @@ import { MatDialog } from '@angular/material/dialog'; import { ConfirmDialogComponent } from '../../../dialog/confirm-dialog/confirm-dialog.component'; import { ConfirmDialogData } from '../../../../models/confirm-dialog-data.interface'; import { firstValueFrom } from 'rxjs'; +import { TooltipDirective } from '../../../../../app/modules/components/common-tooltip/tooltip.directive'; @Component({ selector: 'vitamui-message', - imports: [DatePipe, CommonTooltipModule, InputComponent, ReactiveFormsModule, TranslatePipe, VitamUICommonModule], + imports: [DatePipe, TooltipDirective, InputComponent, ReactiveFormsModule, TranslatePipe, VitamUICommonModule], templateUrl: './message.component.html', styleUrl: './message.component.scss', }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.spec.ts index 61790dabc25..bb2f42fa071 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.spec.ts @@ -50,7 +50,7 @@ import { FileType } from '../../../app/modules/file-type.enum'; @Component({ selector: 'lib-vitamui-library-node', template: '', - standalone: false, + imports: [MatTreeModule, MatProgressSpinnerModule], }) class NodeStubComponent { @Input() tenantIdentifier: any; @@ -71,8 +71,7 @@ describe('FilingPlanComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatTreeModule, MatProgressSpinnerModule], - declarations: [FilingPlanComponent, NodeStubComponent], + imports: [MatTreeModule, MatProgressSpinnerModule, FilingPlanComponent, NodeStubComponent], providers: [ { provide: FilingPlanService, useValue: fillingPlanStub }, { provide: AuthService, useValue: { user: { profileGroup: { profiles: [] } } } }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts index 1943025398a..a9d3f9558e0 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts @@ -37,13 +37,23 @@ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, forwardRef, inject, Injector, Input, OnInit } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { MatTreeNestedDataSource } from '@angular/material/tree'; +import { + MatTreeNestedDataSource, + MatTree, + MatTreeNodeDef, + MatTreeNode, + MatNestedTreeNode, + MatTreeNodeOutlet, +} from '@angular/material/tree'; import { v4 as uuid } from 'uuid'; import { Node } from '../../models/node.interface'; import { FilingPlanMode, FilingPlanService } from './filing-plan.service'; import { Unit } from '../../../app/modules/models/units/unit.interface'; import { AbstractFormInputDirective } from '../abstract-form-input.directive'; +import { NodeComponent } from './node.component'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { FormErrorsComponent } from '../form-errors/form-errors.component'; export const NODE_SELECT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -56,7 +66,16 @@ export const NODE_SELECT_VALUE_ACCESSOR: any = { templateUrl: './filing-plan.component.html', styleUrls: ['./filing-plan.component.scss'], providers: [NODE_SELECT_VALUE_ACCESSOR], - standalone: false, + imports: [ + MatTree, + MatTreeNodeDef, + MatTreeNode, + NodeComponent, + MatNestedTreeNode, + MatTreeNodeOutlet, + MatProgressSpinner, + FormErrorsComponent, + ], }) export class FilingPlanComponent extends AbstractFormInputDirective implements OnInit { filingPlanService = inject(FilingPlanService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.spec.ts deleted file mode 100644 index 5b72413dc27..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.spec.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { FilingPlanModule } from './filing-plan.module'; - -describe('FilingPlanModule', () => { - let filingPlanModule: FilingPlanModule; - - beforeEach(() => { - filingPlanModule = new FilingPlanModule(); - }); - - it('should create an instance', () => { - expect(filingPlanModule).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.ts deleted file mode 100644 index 820ddb1a29f..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.module.ts +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule } from '@angular/forms'; -import { MatButtonModule } from '@angular/material/button'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { MatTreeModule } from '@angular/material/tree'; - -import { FilingPlanComponent } from './filing-plan.component'; -import { NodeComponent } from './node.component'; -import { FormErrorsComponent } from '../form-errors/form-errors.component'; - -@NgModule({ - imports: [CommonModule, FormsModule, MatTreeModule, MatButtonModule, MatCheckboxModule, MatProgressSpinnerModule, FormErrorsComponent], - declarations: [FilingPlanComponent, NodeComponent], - exports: [FilingPlanComponent], -}) -export class FilingPlanModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.spec.ts index d7962763045..ac08dfcd778 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.spec.ts @@ -45,7 +45,7 @@ describe('NodeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [NodeComponent], + imports: [NodeComponent], providers: [], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.ts index b87c067cda6..e29f4749609 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/node.component.ts @@ -39,12 +39,15 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import type { Node } from '../../models/node.interface'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; +import { MatIconButton } from '@angular/material/button'; +import { MatCheckbox } from '@angular/material/checkbox'; +import { FormsModule } from '@angular/forms'; @Component({ selector: 'vitamui-library-node', templateUrl: './node.component.html', styleUrls: ['./node.component.scss'], - standalone: false, + imports: [MatIconButton, MatCheckbox, FormsModule], }) export class NodeComponent { @Input() tenantIdentifier: number; diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts index 30a9a490b0f..fe5bd44033e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts @@ -39,7 +39,7 @@ import { FormsModule } from '@angular/forms'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { input } from '../../../../testing/src/helpers'; -import { CommonTooltipModule } from '../../../app/modules/components/common-tooltip/common-tooltip.module'; +import { TooltipDirective } from '../../../app/modules/components/common-tooltip/tooltip.directive'; import { InputComponent } from './input.component'; let component: InputComponent; @@ -52,7 +52,7 @@ function getInputs() { describe('VitamuiInputComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [FormsModule, NoopAnimationsModule, CommonTooltipModule], + imports: [FormsModule, NoopAnimationsModule, TooltipDirective], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.ts index 1a864269890..38d2829c100 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.ts @@ -37,10 +37,11 @@ import { Component, ElementRef, forwardRef, HostBinding, HostListener, inject, Injector, Input } from '@angular/core'; import { FormsModule, NG_VALUE_ACCESSOR, Validators } from '@angular/forms'; import { AbstractFormInputDirective } from '../abstract-form-input.directive'; -import { CommonTooltipModule } from '../../../app/modules/components/common-tooltip/common-tooltip.module'; + import { FormErrorsComponent } from '../form-errors/form-errors.component'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; +import { TooltipDirective } from '../../../app/modules/components/common-tooltip/tooltip.directive'; export const INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -55,7 +56,7 @@ type InternalValue = { id: number; value: string | number | boolean }; templateUrl: './input.component.html', styleUrls: ['./input.component.scss'], providers: [INPUT_VALUE_ACCESSOR], - imports: [FormsModule, CommonTooltipModule, FormErrorsComponent, MatProgressSpinner, TranslatePipe], + imports: [FormsModule, TooltipDirective, FormErrorsComponent, MatProgressSpinner, TranslatePipe], }) export class InputComponent extends AbstractFormInputDirective { private elRef = inject(ElementRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts index 6788f4d7168..301f25f9953 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts @@ -41,7 +41,7 @@ import { Observable, Subject } from 'rxjs'; import { debounceTime, filter, map, takeUntil } from 'rxjs/operators'; import { DatepickerComponent } from '../../../app/modules/components/datepicker/datepicker.component'; -import { EditableFieldModule } from '../../../app/modules/components/editable-field/editable-field.module'; + import { CriteriaOperator } from '../../../app/modules/models/criteria/criteria.enums'; import { ELIMINATION_TECHNICAL_ID, @@ -74,6 +74,7 @@ import { ManagementRuleFormUtils } from './utils/management-rule-form.utils'; import { ManagementRuleCriteriaService } from './services/management-rule-criteria.service'; import { ManagementRuleCheckboxComponent } from './management-rule-checkbox.component'; import { TranslatePipe } from '@ngx-translate/core'; +import { EditableInputComponent } from '../../../app/modules/components/editable-field/editable-input/editable-input.component'; type RuleForm = { ruleIdentifier: FormControl; @@ -87,7 +88,14 @@ type RuleForm = { templateUrl: './management-rule-search.component.html', styleUrls: ['./management-rule-search.component.scss'], standalone: true, - imports: [ReactiveFormsModule, SelectComponent, ManagementRuleCheckboxComponent, DatepickerComponent, EditableFieldModule, TranslatePipe], + imports: [ + ReactiveFormsModule, + SelectComponent, + ManagementRuleCheckboxComponent, + DatepickerComponent, + EditableInputComponent, + TranslatePipe, + ], providers: [ ManagementRuleCriteriaService, { diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/pattern/pattern.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/pattern/pattern.component.spec.ts deleted file mode 100644 index 9c14112dbaa..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/pattern/pattern.component.spec.ts +++ /dev/null @@ -1,287 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { OverlayContainer } from '@angular/cdk/overlay'; -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; - -import { PatternComponent } from './pattern.component'; -import { SelectComponent } from '../select/select.component'; -import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; -import { MatSelectHarness } from '@angular/material/select/testing'; - -@Component({ - template: ``, - standalone: false, -}) -class TestHostComponent { - patterns: string[]; - options = [ - { value: 'option1.com', disabled: false }, - { value: 'option2.com', disabled: false }, - { value: 'option3.com', disabled: false }, - { value: 'option4.com', disabled: true }, - ]; - - @ViewChild(PatternComponent, { static: false }) - component: PatternComponent; -} - -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('PatternComponent', () => { - let testhost: TestHostComponent; - let fixture: ComponentFixture; - let selectHarness: MatSelectHarness; - - beforeEach(async () => { - await TestBed.configureTestingModule({ - imports: [ - FormsModule, - ReactiveFormsModule, - MatSelectModule, - NoopAnimationsModule, - VitamUICommonTestModule, - PatternComponent, - SelectComponent, - ], - declarations: [TestHostComponent], - }).compileComponents(); - }); - - beforeEach(async () => { - fixture = TestBed.createComponent(TestHostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - - selectHarness = await TestbedHarnessEnvironment.loader(fixture).getHarness(MatSelectHarness); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should set the patterns', waitForAsync(() => { - testhost.component.writeValue(['option1.com', 'option2.com']); - fixture.whenStable().then(() => { - expect(testhost.component.patterns).toEqual(['option1.com', 'option2.com']); - }); - })); - - function add(value: string) { - testhost.component.control.setValue(value); - testhost.component.add(); - } - - it('should add the pattern', () => { - add('option2.com'); - expect(testhost.component.patterns).toEqual(['option2.com']); - expect(testhost.patterns).toEqual(['option2.com']); - }); - - it('should not add a pattern already selected', () => { - add('option2.com'); - expect(testhost.component.patterns).toEqual(['option2.com']); - add('option2.com'); - expect(testhost.component.patterns).toEqual(['option2.com']); - }); - - it('should not add an empty pattern', () => { - add(''); - expect(testhost.component.patterns).toEqual([]); - }); - - it('should remove the pattern', () => { - add('option2.com'); - expect(testhost.component.patterns).toEqual(['option2.com']); - expect(testhost.patterns).toEqual(['option2.com']); - testhost.component.remove('option2.com'); - expect(testhost.component.patterns).toEqual([]); - expect(testhost.patterns).toEqual([]); - }); - - it('should do nothing', () => { - add('option2.com'); - expect(testhost.component.patterns).toEqual(['option2.com']); - expect(testhost.patterns).toEqual(['option2.com']); - testhost.component.remove('option3.com'); - expect(testhost.patterns).toEqual(['option2.com']); - expect(testhost.patterns).toEqual(['option2.com']); - }); - - it('should disable then enable the select list', () => { - expect(testhost.component.control.disabled).toBe(false); - add('option1.com'); - expect(testhost.component.control.disabled).toBe(false); - add('option2.com'); - expect(testhost.component.control.disabled).toBe(false); - add('option3.com'); - expect(testhost.component.control.disabled).toBe(true); - testhost.component.remove('option3.com'); - expect(testhost.component.control.disabled).toBe(false); - }); - - it('should return the available options', () => { - expect(testhost.component.availableOptions).toEqual([ - expect.objectContaining({ key: 'option1.com', disabled: false }), - expect.objectContaining({ key: 'option2.com', disabled: false }), - expect.objectContaining({ key: 'option3.com', disabled: false }), - expect.objectContaining({ key: 'option4.com', disabled: true }), - ]); - add('option2.com'); - expect(testhost.component.availableOptions).toEqual([ - expect.objectContaining({ key: 'option1.com', disabled: false }), - expect.objectContaining({ key: 'option2.com', disabled: true }), - expect.objectContaining({ key: 'option3.com', disabled: false }), - expect.objectContaining({ key: 'option4.com', disabled: true }), - ]); - add('option1.com'); - expect(testhost.component.availableOptions).toEqual([ - expect.objectContaining({ key: 'option1.com', disabled: true }), - expect.objectContaining({ key: 'option2.com', disabled: true }), - expect.objectContaining({ key: 'option3.com', disabled: false }), - expect.objectContaining({ key: 'option4.com', disabled: true }), - ]); - add('option3.com'); - expect(testhost.component.availableOptions).toEqual([ - expect.objectContaining({ key: 'option1.com', disabled: true }), - expect.objectContaining({ key: 'option2.com', disabled: true }), - expect.objectContaining({ key: 'option3.com', disabled: true }), - expect.objectContaining({ key: 'option4.com', disabled: true }), - ]); - }); - - it('should return true when the pattern can be added, false otherwise', () => { - add('option2.com'); - testhost.component.control.setValue('option1.com'); - expect(testhost.component.controlValueValid()).toBe(true); - testhost.component.control.setValue('option2.com'); - expect(testhost.component.controlValueValid()).toBe(false); - testhost.component.control.setValue(''); - expect(testhost.component.controlValueValid()).toBe(false); - }); - - it('should return true if an option can be selected', () => { - add('option2.com'); - expect(testhost.component.isAvailable('option1.com')).toBe(true); - expect(testhost.component.isAvailable('option2.com')).toBe(false); - }); - - it('should return the enabled options', () => { - expect(testhost.component.enabledOptions()).toEqual([ - expect.objectContaining({ key: 'option1.com', disabled: false }), - expect.objectContaining({ key: 'option2.com', disabled: false }), - expect.objectContaining({ key: 'option3.com', disabled: false }), - ]); - }); - - describe('DOM', () => { - let overlayContainerElement: HTMLElement; - - beforeEach(() => { - inject([OverlayContainer], (oc: OverlayContainer) => { - overlayContainerElement = oc.getContainerElement(); - })(); - }); - - it('should have a select with the patterns', async () => { - await selectHarness.open(); - - const elOptions = overlayContainerElement.querySelectorAll('mat-option'); - expect(elOptions.length).toBe(4); - expect(elOptions[0].textContent).toContain('option1.com'); - expect(elOptions[1].textContent).toContain('option2.com'); - expect(elOptions[2].textContent).toContain('option3.com'); - expect(elOptions[3].textContent).toContain('option4.com'); - expect(elOptions[3].textContent).toContain('SHARED.PATTERN_ALREADY_USED'); - expect(elOptions[3].className).toContain('mdc-list-item--disabled'); - }); - - it('should hide the already selected options', async () => { - add('option3.com'); - await selectHarness.open(); - - const selectOptions = await selectHarness.getOptions(); - - expect(await selectOptions[0].getText()).toContain('option1.com'); - expect(await selectOptions[0].isDisabled()).toBe(false); - - expect(await selectOptions[1].getText()).toContain('option2.com'); - expect(await selectOptions[1].isDisabled()).toBe(false); - - expect(await selectOptions[2].getText()).toContain('option3.com'); - expect(await selectOptions[2].isDisabled()).toBe(true); - - expect(await selectOptions[3].getText()).toContain('option4.com'); - expect(await selectOptions[3].isDisabled()).toBe(true); - }); - - it('should have a list of selected patterns', () => { - add('option1.com'); - add('option2.com'); - fixture.detectChanges(); - const elPatterns = fixture.nativeElement.querySelectorAll('.vitamui-chip-list .vitamui-chip'); - expect(elPatterns.length).toBe(2); - expect(elPatterns[0].textContent).toContain('option1.com'); - expect(elPatterns[1].textContent).toContain('option2.com'); - }); - - it('should remove the pattern', () => { - vi.spyOn(testhost.component, 'remove'); - add('option1.com'); - add('option2.com'); - fixture.detectChanges(); - const elPatterns = fixture.nativeElement.querySelectorAll('.vitamui-chip-list .vitamui-chip'); - const elRemoveButton = elPatterns[0].querySelector('.vitamui-remove-chip'); - elRemoveButton.click(); - expect(testhost.component.remove).toHaveBeenCalledWith('option1.com'); - }); - - it('should call add() on click', () => { - vi.spyOn(testhost.component, 'add'); - testhost.component.control.setValue('option2.com'); - fixture.detectChanges(); - const elAddButton = fixture.nativeElement.querySelector('button'); - elAddButton.click(); - expect(testhost.component.add).toHaveBeenCalled(); - }); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.ts index b423c8b1311..b5f1416ed6c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.ts @@ -55,7 +55,7 @@ import { Unit } from '../../../app/modules/models/units/unit.interface'; import { StartupService } from '../../../app/modules/startup.service'; import { ReclassificationService } from '../../../app/modules/services/reclassification.service'; import { DialogHeaderComponent } from '../dialog/dialog-header/dialog-header.component'; -import { FilingPlanModule } from '../filing-plan/filing-plan.module'; + import { FilingPlanMode } from '../filing-plan/filing-plan.service'; import { InputComponent } from '../input/input.component'; import { NextStepComponent } from '../next-step/next-step.component'; @@ -67,6 +67,7 @@ import { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop'; import { searchAllRecordsQuery } from './reclassification-dialog.queries'; import { BaseReclassificationDialogService, BuildQueryParams } from './reclassification-dialog.service'; import { ReclassificationMode } from './reclassification-dialog.types'; +import { FilingPlanComponent } from '../filing-plan/filing-plan.component'; export { ReclassificationMode }; @@ -96,7 +97,7 @@ const atLeastOneFilingPlan: ValidatorFn = (control) => { SelectComponent, MatButtonToggleGroup, MatButtonToggle, - FilingPlanModule, + FilingPlanComponent, MatDialogContent, MatDialogActions, NextStepComponent, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.ts index f20083a3649..2cb83d52ec6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.ts @@ -60,10 +60,9 @@ import { Subject, Subscription } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators'; import { AbstractFormInputDirective } from '../abstract-form-input.directive'; import { normalizeString } from '../../utils/string.util'; -import { AutocompletePositionDirectiveModule } from '../../../app/modules/directives/autocomplete-position/autocomplete-position.directive.module'; + import { CommonModule } from '@angular/common'; -import { CommonTooltipModule } from '../../../app/modules/components/common-tooltip/common-tooltip.module'; -import { EllipsisDirectiveModule } from '../../../app/modules/directives/ellipsis/ellipsis.directive.module'; + import { FormErrorsComponent } from '../form-errors/form-errors.component'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { MatCheckboxModule } from '@angular/material/checkbox'; @@ -73,6 +72,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatListModule } from '@angular/material/list'; import { PipesModule } from '../../../app/modules/pipes/pipes.module'; import { TranslatePipe } from '@ngx-translate/core'; +import { EllipsisDirective } from '../../../app/modules/directives/ellipsis/ellipsis.directive'; const VITAMUI_SELECT_WITH_TREE_VALUE_ACCESSOR = { provide: NG_VALUE_ACCESSOR, @@ -85,10 +85,8 @@ const VITAMUI_SELECT_WITH_TREE_VALUE_ACCESSOR = { templateUrl: './select-with-tree.component.html', styleUrls: ['./select-with-tree.component.scss'], imports: [ - AutocompletePositionDirectiveModule, CommonModule, - CommonTooltipModule, - EllipsisDirectiveModule, + EllipsisDirective, FormErrorsComponent, FormsModule, MatAutocompleteModule, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts index 7c1a9e80b3e..baa5a1157c8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts @@ -59,10 +59,9 @@ import { filter } from 'rxjs/operators'; import { Option } from '../../../app/modules/components/autocomplete/utils/option.interface'; import { SearchBarComponent } from '../../../app/modules/components/search-bar/search-bar.component'; import { AbstractFormInputDirective } from '../abstract-form-input.directive'; -import { AutocompletePositionDirectiveModule } from '../../../app/modules/directives/autocomplete-position/autocomplete-position.directive.module'; + import { CommonModule } from '@angular/common'; -import { CommonTooltipModule } from '../../../app/modules/components/common-tooltip/common-tooltip.module'; -import { EllipsisDirectiveModule } from '../../../app/modules/directives/ellipsis/ellipsis.directive.module'; + import { FormErrorsComponent } from '../form-errors/form-errors.component'; import { MatAutocompleteModule } from '@angular/material/autocomplete'; import { MatCheckboxModule } from '@angular/material/checkbox'; @@ -76,6 +75,8 @@ import { PipesModule } from '../../../app/modules/pipes/pipes.module'; import { TranslatePipe } from '@ngx-translate/core'; import { normalizeString } from '../../utils/string.util'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TooltipDirective } from '../../../app/modules/components/common-tooltip/tooltip.directive'; +import { EllipsisDirective } from '../../../app/modules/directives/ellipsis/ellipsis.directive'; export const VITAMUI_SELECT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, @@ -93,10 +94,9 @@ export interface VitamuiSelectOptions { templateUrl: './select.component.html', styleUrls: ['./select.component.scss'], imports: [ - AutocompletePositionDirectiveModule, CommonModule, - CommonTooltipModule, - EllipsisDirectiveModule, + TooltipDirective, + EllipsisDirective, FormErrorsComponent, FormsModule, MatAutocompleteModule, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/slide-toggle/slide-toggle.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/slide-toggle/slide-toggle.component.spec.ts deleted file mode 100644 index 3382ef809b7..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/slide-toggle/slide-toggle.component.spec.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; - -import { WINDOW_LOCATION } from '../../../app/modules/injection-tokens'; -import { SlideToggleComponent } from './slide-toggle.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -@Component({ - template: ` `, - standalone: false, -}) -class TesthostComponent { - @ViewChild(SlideToggleComponent) toggle: SlideToggleComponent; - stateOn = false; - disabled = false; - required = false; -} - -let fixture: ComponentFixture; -let testhost: TesthostComponent; - -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - -describe('SlideToggleComponent', () => { - beforeEach(async () => { - await TestBed.configureTestingModule({ - declarations: [TesthostComponent], - imports: [SlideToggleComponent, FormsModule], - providers: [ - { - provide: WINDOW_LOCATION, - useValue: {}, - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(TesthostComponent); - testhost = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(testhost).toBeTruthy(); - }); - - it('should be off by default', () => { - expect(testhost.stateOn).toBeFalsy(); - const elInput = fixture.nativeElement.querySelector('input[type=checkbox]'); - fixture.detectChanges(); - expect(elInput.checked).toBeFalsy(); - }); - - it('should be on', async () => { - testhost.stateOn = true; - fixture.detectChanges(); - await fixture.whenStable(); - expect(fixture.componentInstance.toggle.checked).toBeTruthy(); - }); - - it('should turn on on click', () => { - const elInput = fixture.nativeElement.querySelector('input[type=checkbox]'); - elInput.click(); - expect(testhost.stateOn).toBeTruthy(); - }); - - it('should turn on and off', () => { - const elInput = fixture.nativeElement.querySelector('input[type=checkbox]'); - elInput.click(); - expect(testhost.stateOn).toBeTruthy(); - elInput.click(); - expect(testhost.stateOn).toBeFalsy(); - }); - - it('should not toggle when disabled', () => { - testhost.disabled = true; - fixture.detectChanges(); - const elInput = fixture.nativeElement.querySelector('input[type=checkbox]'); - elInput.click(); - expect(testhost.stateOn).toBeFalsy(); - }); -}); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.spec.ts index 4de21ce5cf0..685d69c4bad 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.spec.ts @@ -45,7 +45,7 @@ describe('VitamuiRadioGroupComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [VitamUIRadioGroupComponent], + imports: [VitamUIRadioGroupComponent], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts index 7e39fa3d929..5df8f6bb840 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts @@ -51,7 +51,6 @@ export const RADIO_GROUP_VALUE_ACCESSOR: any = { templateUrl: './vitamui-radio-group.component.html', styleUrls: ['./vitamui-radio-group.component.scss'], providers: [RADIO_GROUP_VALUE_ACCESSOR, VitamUIRadioGroupService], - standalone: false, }) export class VitamUIRadioGroupComponent implements OnInit, AfterContentInit { private radioGroupService = inject(VitamUIRadioGroupService, { self: true }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.module.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.module.ts deleted file mode 100644 index 2fac49bc333..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.module.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; -import { FormsModule, ReactiveFormsModule } from '@angular/forms'; - -import { VitamUIRadioGroupComponent } from './vitamui-radio-group.component'; - -@NgModule({ - declarations: [VitamUIRadioGroupComponent], - imports: [CommonModule, FormsModule, ReactiveFormsModule], - exports: [VitamUIRadioGroupComponent], -}) -export class VitamUIRadioGroupModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.spec.ts index bc8436e41ee..7025039d42d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.spec.ts @@ -46,7 +46,7 @@ describe('VitamUIRadioComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [VitamUIRadioComponent], + imports: [VitamUIRadioComponent], providers: [{ provide: VitamUIRadioGroupService, useValue: { vitamUIRadioGroupMock } }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts index 09ec7f23314..6562ad696cd 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts @@ -38,12 +38,13 @@ import { Component, Input, OnInit, inject } from '@angular/core'; import { VitamUIRadioGroupService } from '../vitamui-radio-group/vitamui-radio-group.service'; +import { NgClass } from '@angular/common'; @Component({ selector: 'vitamui-radio', templateUrl: './vitamui-radio.component.html', styleUrls: ['./vitamui-radio.component.scss'], - standalone: false, + imports: [NgClass], }) export class VitamUIRadioComponent implements OnInit { private radioGroupService = inject(VitamUIRadioGroupService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.module.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.module.ts deleted file mode 100644 index 8977a487643..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.module.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { CommonModule } from '@angular/common'; -import { NgModule } from '@angular/core'; - -import { VitamUIRadioComponent } from './vitamui-radio.component'; - -@NgModule({ - imports: [CommonModule], - declarations: [VitamUIRadioComponent], - exports: [VitamUIRadioComponent], -}) -export class VitamUIRadioModule {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/vitamui-library.module.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/vitamui-library.module.ts index 52860492d76..dc324616777 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/vitamui-library.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/vitamui-library.module.ts @@ -36,9 +36,6 @@ */ import { NgModule } from '@angular/core'; -import { FilingPlanModule } from './components/filing-plan/filing-plan.module'; -import { VitamUIRadioGroupModule } from './components/vitamui-radio-group/vitamui-radio-group.module'; -import { VitamUIRadioModule } from './components/vitamui-radio/vitamui-radio.module'; import { MAT_TABS_CONFIG } from '@angular/material/tabs'; import { SelectComponent } from './components/select/select.component'; import { MAT_DIALOG_DEFAULT_OPTIONS } from '@angular/material/dialog'; @@ -72,7 +69,6 @@ const components = [ DialogContentWithStateComponent, ErrorDialogComponent, ErrorsDetailsDialogComponent, - FilingPlanModule, FormFieldValueWrapperComponent, ManagementRuleSearchComponent, NextStepComponent, @@ -84,8 +80,6 @@ const components = [ SelectComponent, SelectWithTreeComponent, TranslateWithOptionalTypeSuffixPipe, - VitamUIRadioGroupModule, - VitamUIRadioModule, ]; @NgModule({ diff --git a/ui/ui-frontend/projects/vitamui-library/src/public-api.ts b/ui/ui-frontend/projects/vitamui-library/src/public-api.ts index b68930e88e5..109b6611e5e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/public-api.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/public-api.ts @@ -44,14 +44,13 @@ export * from './lib/api/search-unit-api.service'; /* COMPONENTS */ export * from './lib/components/confirm-action/confirm-action.component'; export * from './lib/components/filing-plan/filing-plan.component'; -export * from './lib/components/filing-plan/filing-plan.module'; + export * from './lib/components/filing-plan/filing-plan.service'; export * from './lib/components/filing-plan/node.component'; export * from './lib/components/form-errors/form-control-warn'; export * from './lib/components/vitamui-radio-group/vitamui-radio-group.component'; -export * from './lib/components/vitamui-radio-group/vitamui-radio-group.module'; + export * from './lib/components/vitamui-radio/vitamui-radio.component'; -export * from './lib/components/vitamui-radio/vitamui-radio.module'; export * from './lib/components/dialog/alert-dialog/alert-dialog.component'; export * from './lib/components/dialog/confirm-dialog/confirm-dialog.component'; @@ -144,16 +143,16 @@ export * from './app/modules/base-http-client'; export * from './app/modules/components/application-card/application-card.component'; export * from './app/modules/components/autocomplete/utils/item-node.interface'; export * from './app/modules/components/autocomplete/utils/option.interface'; -export * from './app/modules/components/collapse/collapse.module'; + export * from './app/modules/components/common-confirm-dialog/close-popup-dialog.component'; export * from './app/modules/components/common-confirm-dialog/common-confirm-dialog.component'; -export * from './app/modules/components/common-confirm-dialog/confirm-dialog.module'; + export * from './app/modules/components/common-confirm-dialog/confirm-dialog.service'; export * from './app/modules/components/data/data.component'; export * from './app/modules/components/download-snack-bar/download-snack-bar.component'; export * from './app/modules/components/editable-field/editable-email-input/editable-email-input.component'; export * from './app/modules/components/editable-field/editable-field.component'; -export * from './app/modules/components/editable-field/editable-field.module'; + export * from './app/modules/components/editable-field/editable-file/editable-file.component'; export * from './app/modules/components/editable-field/editable-input/editable-input.component'; export * from './app/modules/components/editable-field/editable-level-input/editable-level-input.component'; @@ -162,11 +161,11 @@ export * from './app/modules/components/editable-field/editable-textarea/editabl export * from './app/modules/components/editable-field/editable-toggle-group/editable-button-toggle.component'; export * from './app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component'; export * from './app/modules/components/editable-field/level-input/level-input.component'; -export * from './app/modules/components/editable-field/level-input/level-input.module'; + export * from './app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component'; export * from './app/modules/components/order-by-button/order-by-button.component'; export * from './app/modules/components/role-toggle/role-toggle.component'; -export * from './app/modules/components/role-toggle/role-toggle.module'; + export * from './app/modules/components/role-toggle/role.component'; export * from './app/modules/components/search-bar/search-bar.component'; export * from './app/modules/components/stepper/stepper.component'; @@ -182,11 +181,11 @@ export * from './app/modules/country.service'; export * from './app/modules/customer-selection.service'; export * from './app/modules/directives/collapse/collapse-container.directive'; export * from './app/modules/directives/collapse/collapse-trigger-for.directive'; -export * from './app/modules/directives/collapse/collapse.directive.module'; + export * from './app/modules/directives/collapse/collapse.directive'; export * from './app/modules/directives/drag-and-drop/drag-and-drop.directive'; export * from './app/modules/directives/infinite-scroll/infinite-scroll.directive'; -export * from './app/modules/directives/infinite-scroll/infinite-scroll.module'; + export * from './app/modules/directives/row-collapse/row-collapse-container.directive'; export * from './app/modules/directives/row-collapse/row-collapse-trigger-for.directive'; export * from './app/modules/directives/row-collapse/row-collapse.directive'; @@ -340,7 +339,6 @@ export * from './app/modules/vitamui-table/paginated-response.interface'; export * from './app/modules/vitamui-table/request-param.model'; export * from './app/modules/vitamui-table/search.service'; -export * from './app/modules/account/account.module'; export * from './app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component'; export * from './app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component'; export * from './app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component'; @@ -354,16 +352,16 @@ export * from './app/modules/components/collapse/collapse.component'; export * from './app/modules/components/common-progress-bar/common-progress-bar.component'; export * from './app/modules/components/common-tooltip/common-tooltip.component'; export * from './app/modules/components/common-tooltip/tooltip.directive'; -export * from './app/modules/components/common-tooltip/common-tooltip.module'; + export * from './app/modules/components/file-selector/file-selector.component'; export * from './app/modules/components/file-selector/file-selector-validators'; export * from './app/modules/components/footer/footer.component'; export * from './app/modules/components/header/header.component'; export * from './app/modules/components/header/header.module'; export * from './app/modules/components/header/select-language/select-language.component'; -export * from './app/modules/components/header/select-language/select-language.module'; + export * from './app/modules/components/header/user-photo/user-photo.component'; -export * from './app/modules/components/header/user-photo/user-photo.module'; + export * from './app/modules/components/logbook-operation-facet/logbook-operation-facet.component'; export * from './app/modules/components/datepicker/datepicker.component'; export * from './app/modules/components/datepicker/datepicker.interface'; @@ -380,20 +378,20 @@ export * from './app/modules/components/vitamui-interval-date-picker/vitamui-int export * from './app/modules/components/vitamui-menu-button/vitamui-menu-button.component'; export * from './lib/components/input/input.component'; export * from './app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.component'; -export * from './app/modules/components/vitamui-sidenav-header/vitamui-sidenav-header.module'; + export * from './app/modules/components/snack-bar/snack-bar.interface'; export * from './app/modules/components/snack-bar/snack-bar.component'; export * from './app/modules/components/snack-bar/snack-bar.service'; export * from './app/modules/components/vitamui-sup-header/vitamui-sup-header.component'; export * from './app/modules/directives/autocomplete-position/autocomplete-position.directive'; -export * from './app/modules/directives/autocomplete-position/autocomplete-position.directive.module'; + export * from './app/modules/directives/click-outside/click-outside.directive'; export * from './app/modules/directives/ellipsis/ellipsis.directive'; -export * from './app/modules/directives/ellipsis/ellipsis.directive.module'; + export * from './app/modules/directives/resize-sidebar/resize-sidebar.directive'; -export * from './app/modules/directives/resize-sidebar/resize-sidebar.module'; + export * from './app/modules/directives/resize-sidebar/resize-vertical.directive'; -export * from './app/modules/directives/row-collapse/row-collapse.module'; + export * from './app/modules/logbook/event-type-label/event-type-label.component'; export * from './app/modules/logbook/history/history-events/history-events.component'; export * from './app/modules/logbook/history/multi-operation-history-tab/multi-operation-history-tab.component'; @@ -421,7 +419,7 @@ export * from './app/modules/pipes/yes-no.pipe'; export * from './lib/components/reclassification-dialog/reclassification-dialog.component'; export * from './app/modules/security/has-any-role.directive'; export * from './app/modules/security/has-role.directive'; -export * from './app/modules/security/security.module'; + export * from './app/modules/subrogation/subrogation-banner/subrogation-banner.component'; export * from './app/modules/subrogation/subrogation.module'; export * from './app/modules/object-viewer/services/type.service'; diff --git a/ui/ui-frontend/test.ts b/ui/ui-frontend/test.ts index 633ec228ec1..24d8ca31b78 100644 --- a/ui/ui-frontend/test.ts +++ b/ui/ui-frontend/test.ts @@ -42,6 +42,10 @@ import { TestBed } from '@angular/core/testing'; import '@angular/compiler'; import '@analogjs/vitest-angular/setup-zone'; import 'zone.js/testing'; +import { provideAnimations } from '@angular/platform-browser/animations'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { provideRouter } from '@angular/router'; +import { BASE_URL, LoggerModule, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION } from 'vitamui-library'; import { provideTranslateService, TranslatePipe } from '@ngx-translate/core'; @@ -49,7 +53,16 @@ const configureTestingModule = TestBed.configureTestingModule.bind(TestBed); TestBed.configureTestingModule = ((moduleDef: any) => configureTestingModule({ ...moduleDef, - imports: [...(moduleDef?.imports ?? []), TranslatePipe], + imports: [...(moduleDef?.imports ?? []), LoggerModule.forRoot(), TranslatePipe], schemas: [...(moduleDef?.schemas ?? []), CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], - providers: [provideTranslateService({ fallbackLang: 'fr' }), ...(moduleDef?.providers ?? [])], + providers: [ + provideTranslateService({ fallbackLang: 'fr' }), + { provide: BASE_URL, useValue: '/fake-api' }, + { provide: SUBROGRATION_REFRESH_RATE_MS, useValue: 10000 }, + { provide: WINDOW_LOCATION, useValue: typeof location !== 'undefined' ? location : ({} as Location) }, + provideAnimations(), + provideNativeDateAdapter(), + provideRouter([]), + ...(moduleDef?.providers ?? []), + ], })) as typeof TestBed.configureTestingModule; diff --git a/ui/ui-frontend/tsconfig.json b/ui/ui-frontend/tsconfig.json index cbce10927f4..5f35c15a838 100644 --- a/ui/ui-frontend/tsconfig.json +++ b/ui/ui-frontend/tsconfig.json @@ -9,7 +9,6 @@ "declaration": false, "module": "preserve", "moduleResolution": "bundler", - "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, "target": "ES2022", From c0ab8e7ffda952cd66111ae208a95405716ca94b Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 19 Aug 2026 17:34:38 +0200 Subject: [PATCH 04/33] Story #16471: Clean code - optimize imports --- .../archive-search/src/app/app.component.ts | 2 +- .../archive-preview.component.ts | 20 +++--- .../archive-unit-description-tab.component.ts | 18 +++--- .../archive-unit-information-tab.component.ts | 13 +++- ...unit-objects-details-tab.component.spec.ts | 3 +- ...hive-unit-objects-details-tab.component.ts | 11 ++-- ...e-unit-rules-details-tab.component.spec.ts | 3 +- ...rchive-unit-rules-details-tab.component.ts | 5 +- ...e-unit-rules-informations-tab.component.ts | 7 +-- .../dip-request-create.component.ts | 28 ++++----- .../add-management-rules.component.ts | 10 +-- .../add-update-property.component.spec.ts | 3 +- .../add-update-property.component.ts | 6 +- .../archive-unit-rules.component.spec.ts | 4 +- .../archive-unit-rules.component.ts | 2 +- ...ock-category-inheritance.component.spec.ts | 3 +- .../block-category-inheritance.component.ts | 2 +- .../block-rules-inheritance.component.spec.ts | 3 +- .../block-rules-inheritance.component.ts | 8 +-- .../delete-unit-rules.component.ts | 16 ++--- ...ock-category-inheritance.component.spec.ts | 3 +- .../unlock-category-inheritance.component.ts | 6 +- .../unlock-rules-inheritance.component.ts | 12 ++-- .../update-unit-rules.component.ts | 14 ++--- .../management-rules.component.spec.ts | 3 +- .../management-rules.component.ts | 8 +-- .../reassignment-dialog.service.spec.ts | 3 +- .../preservation-dialog.service.spec.ts | 3 +- .../preservation-dialog.service.ts | 5 +- .../transfer-request-modal.component.spec.ts | 3 +- .../transfer-request-modal.component.ts | 28 ++++----- .../archive-search-rules-facets.component.ts | 2 +- .../search-access-rules-facets.component.ts | 7 +-- ...search-appraisal-rules-facets.component.ts | 7 +-- ...ch-dissemination-rules-facets.component.ts | 7 +-- .../search-reuse-rules-facets.component.ts | 7 +-- .../search-storage-rules-facets.component.ts | 7 +-- .../archive-search.component.spec.ts | 1 + .../archive-search.component.ts | 50 +++++++-------- .../confirm-action.component.ts | 12 +--- .../search-criteria-list.component.ts | 7 +-- .../search-criteria-saver.component.ts | 16 ++--- .../simple-criteria-search.component.ts | 47 +++----------- ...cription-criteria-search.component.spec.ts | 3 +- ...d-description-criteria-search.component.ts | 37 +---------- .../transfer-acknowledgment.component.spec.ts | 3 +- .../src/app/archive/archive.component.ts | 12 ++-- .../src/app/archive/archive.service.spec.ts | 3 +- .../archive-facets.service.spec.ts | 3 +- .../archive-unit-elimination.service.ts | 3 +- .../update-unit-management-rule.service.ts | 5 +- .../criteria-search.component.ts | 13 ++-- .../classification-tree.component.ts | 9 ++- .../filing-holding-scheme.component.spec.ts | 3 +- .../filing-holding-scheme.component.ts | 7 +-- .../leaves-tree/leaves-tree.component.ts | 8 +-- .../found-object-modal.component.spec.ts | 7 +-- .../found-object-modal.component.ts | 4 +- .../persistent-identifier-search.component.ts | 2 +- ...sistent-identifier-modal.component.spec.ts | 5 +- ...d-persistent-identifier-modal.component.ts | 4 +- .../archive-unit-validator.service.ts | 5 +- .../app/core/api/archive-api.service.spec.ts | 3 +- .../src/app/core/core.module.ts | 5 +- .../projects/archive-search/src/main.ts | 7 +-- .../projects/collect/src/app/app.component.ts | 2 +- .../add-units/add-units.component.spec.ts | 3 +- .../add-units/add-units.component.ts | 27 ++++---- .../archive-preview.component.ts | 19 +++--- .../archive-unit-description-tab.component.ts | 12 ++-- .../archive-unit-information-tab.component.ts | 14 ++--- ...e-unit-rules-details-tab.component.spec.ts | 3 +- ...rchive-unit-rules-details-tab.component.ts | 5 +- ...e-unit-rules-informations-tab.component.ts | 7 +-- ...object-group-details-tab.component.spec.ts | 3 +- ...lect-object-group-details-tab.component.ts | 18 +++--- .../archive-search-collect.component.ts | 56 ++++++++--------- .../archive-search-rules-facets.component.ts | 2 +- .../search-access-rules-facets.component.ts | 7 +-- ...search-appraisal-rules-facets.component.ts | 7 +-- ...ch-dissemination-rules-facets.component.ts | 7 +-- .../search-reuse-rules-facets.component.ts | 7 +-- .../search-storage-rules-facets.component.ts | 7 +-- .../criteria-search.component.ts | 14 +++-- .../classification-tree.component.ts | 9 ++- .../filing-holding-scheme.component.spec.ts | 3 +- .../filing-holding-scheme.component.ts | 7 +-- .../leaves-tree/leaves-tree.component.ts | 10 +-- .../confirm-action.component.ts | 14 +---- .../search-criteria-list.component.ts | 7 +-- .../search-criteria-saver.component.ts | 16 ++--- .../simple-criteria-search.component.ts | 44 +++---------- ...-criteria-search-collect.component.spec.ts | 3 +- ...ption-criteria-search-collect.component.ts | 35 +---------- .../update-units-metadata.component.spec.ts | 3 +- .../update-units-metadata.component.ts | 14 ++--- .../core/api/project-api.service.spec.ts | 3 +- .../src/app/collect/core/core.module.ts | 5 +- .../create-project.component.ts | 44 +++++++------ .../project-list/project-list.component.ts | 8 +-- .../collect/projects/projects.component.ts | 6 +- .../transaction-list.component.spec.ts | 3 +- .../transaction-list.component.ts | 8 +-- .../transactions/transactions.component.ts | 2 +- ui/ui-frontend/projects/collect/src/main.ts | 7 +-- .../design-system/src/app/app.component.ts | 13 ++-- .../design-system/src/app/app.module.ts | 32 +--------- ...ign-system-information-detail.component.ts | 3 +- .../atoms/tooltip/tooltip.component.ts | 2 +- .../design-system-datepicker.component.ts | 3 +- .../design-system-old-inputs.component.ts | 3 +- ...esign-system-select-with-tree.component.ts | 5 +- .../design-system-discussion.component.ts | 2 +- .../organisms/snackbar/snackbar.component.ts | 5 +- .../tokens/typography/typography.component.ts | 4 +- .../translation/translation.component.ts | 6 +- .../app/components/upload/upload.component.ts | 3 +- .../projects/design-system/src/main.ts | 4 +- .../identity/src/app/app.component.ts | 3 +- .../app/core/api/customer-api.service.spec.ts | 3 +- .../identity/src/app/core/core.module.ts | 5 +- .../src/app/core/customer.service.spec.ts | 3 +- .../identity/src/app/core/customer.service.ts | 5 +- .../customer-alerting.component.ts | 5 +- .../customer-colors-input.component.ts | 9 ++- .../input-color/input-color.component.ts | 5 +- .../customer-create.component.spec.ts | 3 +- .../customer-create.component.ts | 24 ++++--- .../customer-list.component.spec.ts | 3 +- .../customer-list/customer-list.component.ts | 12 ++-- .../customer-list.service.spec.ts | 3 +- .../customer-list/customer-list.service.ts | 5 +- .../owner-list/owner-list.component.ts | 5 +- .../customer-preview.component.spec.ts | 4 +- .../customer-preview.component.ts | 8 +-- .../graphic-identity-tab.component.ts | 5 +- .../graphic-identity-update.component.spec.ts | 3 +- .../graphic-identity-update.component.ts | 4 +- .../graphic-identity-form.component.ts | 5 +- .../graphic-identity.component.ts | 7 +-- .../homepage-message-tab.component.ts | 2 +- .../homepage-message-update.component.ts | 4 +- .../homepage-message-translation.ts | 3 +- .../homepage-message.component.ts | 11 ++-- .../information-tab.component.ts | 37 +++-------- ...identity-provider-create.component.spec.ts | 3 +- .../identity-provider-create.component.ts | 18 +++--- .../identity-provider-details.component.ts | 33 +++------- .../sso-tab/identity-provider.service.ts | 5 +- .../sso-tab/sso-tab.component.ts | 2 +- .../customer-resolver.service.spec.ts | 3 +- .../app/customer/customer.component.spec.ts | 3 +- .../src/app/customer/customer.component.ts | 6 +- .../owner-create/owner-create.component.ts | 16 +++-- .../owner-form/owner-form.component.ts | 7 +-- .../information-tab.component.ts | 41 +++--------- .../owner-operation-history-tab.component.ts | 3 +- .../owner-preview.component.spec.ts | 6 +- .../owner-preview/owner-preview.component.ts | 6 +- .../src/app/customer/owner.service.spec.ts | 3 +- .../src/app/customer/owner.service.ts | 5 +- .../tenant-create/tenant-create.component.ts | 21 ++----- .../src/app/customer/tenant.service.spec.ts | 3 +- .../src/app/customer/tenant.service.ts | 5 +- ...nal-param-profile-create.component.spec.ts | 5 +- ...external-param-profile-create.component.ts | 24 ++++--- ...nal-param-profile-detail.component.spec.ts | 3 +- ...external-param-profile-detail.component.ts | 9 +-- .../information-tab.component.ts | 36 ++--------- .../thresholds-tab.component.ts | 7 +-- ...ernal-param-profile-list.component.spec.ts | 2 +- .../external-param-profile-list.component.ts | 8 +-- ...rnal-param-profile-service.service.spec.ts | 3 +- .../external-param-profile.component.ts | 6 +- .../external-param-profile.module.ts | 8 +-- .../group-create.component.spec.ts | 5 +- .../group-create/group-create.component.ts | 16 +++-- .../group-list/group-criteria-builder.util.ts | 3 +- .../group-list/group-list.component.spec.ts | 3 +- .../group/group-list/group-list.component.ts | 14 ++--- .../group-preview/group-preview.component.ts | 10 +-- .../information-tab.component.ts | 33 ++-------- .../units-edit/units-edit.component.ts | 18 ++---- .../profiles-edit/profiles-edit.component.ts | 20 ++---- .../profiles-tab/profiles-tab.component.ts | 5 +- .../src/app/group/group.component.spec.ts | 7 +-- .../identity/src/app/group/group.component.ts | 6 +- .../src/app/group/group.service.spec.ts | 3 +- .../identity/src/app/group/group.service.ts | 5 +- .../group/units-form/units-form.component.ts | 6 +- .../hierarchy-create.component.spec.ts | 5 +- .../hierarchy-create.component.ts | 16 +++-- .../hierarchy-detail.component.ts | 10 +-- .../information-tab.component.ts | 33 ++-------- .../hierarchy-list.component.ts | 10 +-- .../src/app/hierarchy/hierarchy.component.ts | 7 +-- .../app/hierarchy/hierarchy.service.spec.ts | 3 +- .../profile-create.component.ts | 14 ++--- .../information-tab.component.ts | 38 +++--------- .../profile-detail.component.ts | 8 +-- .../profile-list/profile-list.component.ts | 10 +-- .../src/app/profile/profile.component.ts | 7 +-- .../src/app/profile/profile.module.ts | 4 +- .../src/app/profile/profile.service.spec.ts | 3 +- .../custom-params/custom-params.component.ts | 4 +- .../domains-input.component.spec.ts | 2 +- .../domains-input/domains-input.component.ts | 2 +- .../editable-custom-params.component.ts | 4 +- .../editable-domain-input.component.ts | 5 +- .../editable-field/editable-field.module.ts | 2 +- .../editable-keystore.component.ts | 8 +-- .../editable-patterns.component.ts | 7 +-- .../profiles-form/profiles-form.component.ts | 8 +-- .../identity/src/app/shared/shared.module.ts | 2 +- .../customer-select.service.spec.ts | 3 +- .../subrogation/customer-select.service.ts | 5 +- .../subrogate-user-list.component.ts | 8 +-- .../subrogate-user.component.ts | 4 +- .../group-attribution.component.ts | 7 +-- .../group-attribution.module.ts | 2 +- .../group-detail/group-detail.component.ts | 7 +-- .../group-list/group-list.component.ts | 23 ++----- .../user/user-create/user-create.component.ts | 24 ++++--- .../user-list/user-criteria-builder.util.ts | 3 +- .../app/user/user-list/user-list.component.ts | 22 +++---- .../user-group-tab.component.ts | 5 +- .../user-information-tab.component.ts | 45 +++++--------- .../user-preview/user-preview.component.ts | 20 +++--- .../identity/src/app/user/user.component.ts | 8 +-- ui/ui-frontend/projects/identity/src/main.ts | 7 +-- .../projects/ingest/src/app/app.component.ts | 3 +- .../app/core/api/ingest-api.service.spec.ts | 3 +- .../src/app/core/api/ingest-api.service.ts | 5 +- .../app/core/common/upload.component.spec.ts | 3 +- .../src/app/core/common/upload.component.ts | 20 ++---- .../ingest/src/app/core/core.module.ts | 5 +- .../holding-filling-scheme.component.spec.ts | 1 - .../holding-filling-scheme.component.ts | 7 +-- .../ingest-list/ingest-list.component.ts | 18 ++++-- .../ingest-errors-details-tab.component.ts | 10 +-- .../event-display/event-display.component.ts | 2 +- .../ingest-event-detail.component.ts | 2 +- .../ingest-information-tab.component.ts | 10 ++- .../ingest-preview.component.ts | 17 ++--- .../ingest/src/app/ingest/ingest.component.ts | 8 +-- .../ingest/src/app/ingest/ingest.service.ts | 5 +- ui/ui-frontend/projects/ingest/src/main.ts | 7 +-- .../projects/pastis/src/app/app.component.ts | 2 +- .../pastis/src/app/core/core.module.ts | 2 +- .../pastis/src/app/main/main.component.ts | 4 +- .../create-profil-notice.component.ts | 10 ++- .../create-profile.component.ts | 10 ++- .../edit-profile/edit-profile.component.ts | 7 +-- .../attributes/attributes.component.ts | 55 ++++------------ .../file-tree-metadata.component.spec.ts | 3 +- .../file-tree-metadata.component.ts | 62 ++++++------------- .../file-tree/file-tree.component.ts | 15 +++-- .../file-tree/file-tree.module.ts | 4 +- .../list-profile/list-profile.component.ts | 24 +++---- .../profile-information-tab.component.ts | 7 +-- .../profile-preview.component.ts | 12 ++-- .../seda-visualizer.component.ts | 2 +- .../pastis-breadcrumb.component.ts | 2 +- .../pastis-title-breadcrumb.component.ts | 2 +- .../pastis-dialog-confirm.component.ts | 9 ++- ...astis-popup-metadata-language.component.ts | 2 +- .../pastis-popup-option.component.ts | 4 +- .../standalone/standalone-startup.service.ts | 5 +- .../add-metadata/add-metadata.component.ts | 4 +- .../add-pua-control.component.ts | 4 +- .../duplicate-metadata.component.ts | 2 +- .../remove-metadata.component.ts | 2 +- .../save-profile-popup.component.ts | 10 ++- .../save-profile.component.spec.ts | 3 +- .../save-profile/save-profile.component.ts | 5 +- .../select-notice/select-notice.component.ts | 12 ++-- ui/ui-frontend/projects/pastis/src/main.ts | 14 ++--- .../portal/src/app/app-routing.module.ts | 3 +- .../portal/src/app/app.component.spec.ts | 3 +- .../projects/portal/src/app/app.component.ts | 5 +- .../content-list/content-list.component.ts | 3 +- ui/ui-frontend/projects/portal/src/main.ts | 12 ++-- .../access-contract-list.component.ts | 16 ++--- ...tract-authorizations-tab.component.spec.ts | 3 +- ...s-contract-authorizations-tab.component.ts | 13 +++- ...ct-authorizations-update.component.spec.ts | 3 +- ...ontract-authorizations-update.component.ts | 20 +++--- ...cess-contract-information-tab.component.ts | 7 +-- .../access-contract-nodes-tab.component.ts | 12 +++- .../access-contract-node-update.component.ts | 12 ++-- .../access-contract-preview.component.ts | 13 ++-- ...ess-contract-write-access-tab.component.ts | 17 +++-- .../access-contract.component.spec.ts | 3 +- .../access-contract.component.ts | 6 +- ...sion-register-advanced-search.component.ts | 6 +- .../accession-register-facets.component.ts | 5 +- .../accession-register-list.component.spec.ts | 3 +- .../accession-register-list.component.ts | 10 +-- .../accession-register-detail.component.ts | 4 +- ...register-operations-list.component.spec.ts | 3 +- ...sion-register-operations-list.component.ts | 8 +-- .../accession-register-preview.component.ts | 7 +-- .../accession-register.component.ts | 8 +-- .../accession-register.module.ts | 4 +- .../app/admin-dsl/admin-dsl.component.spec.ts | 3 +- .../src/app/admin-dsl/admin-dsl.component.ts | 12 ++-- .../src/app/admin-dsl/admin-dsl.service.ts | 5 +- .../agency-create.component.spec.ts | 3 +- .../agency-create/agency-create.component.ts | 11 ++-- .../agency-list/agency-list.component.spec.ts | 3 +- .../agency-list/agency-list.component.ts | 3 +- .../agency-information-tab.component.ts | 5 +- .../agency-preview.component.ts | 5 +- .../src/app/agency/agency.component.spec.ts | 3 +- .../src/app/agency/agency.component.ts | 1 - .../src/app/agency/agency.schema.ts | 3 +- .../agency/edit-agency/edit-agency.guard.ts | 5 +- .../referential/src/app/app.component.ts | 2 +- .../audit/audit-list/audit-list.component.ts | 14 ++--- .../audit-information-tab.component.ts | 3 +- .../audit-preview.component.spec.ts | 3 +- .../audit-preview/audit-preview.component.ts | 2 +- .../src/app/audit/audit.component.spec.ts | 3 +- .../src/app/audit/audit.component.ts | 8 +-- .../context-create.component.spec.ts | 3 +- .../context-create.component.ts | 5 +- .../context-edit-permission.component.ts | 6 +- .../context-edit/context-edit.component.ts | 18 ++---- .../context-list.component.spec.ts | 3 +- .../context-list/context-list.component.ts | 20 +++--- .../context-information-tab.component.ts | 7 +-- .../context-permission-tab.component.spec.ts | 3 +- .../context-permission-tab.component.ts | 17 +++-- .../context-preview.component.ts | 7 +-- .../src/app/context/context.component.spec.ts | 3 +- .../src/app/context/context.component.ts | 6 +- .../src/app/context/context.service.ts | 5 +- .../app/core/api/context-api.service.spec.ts | 3 +- .../app/core/api/customer-api.service.spec.ts | 3 +- .../api/ingest-contract-api.service.spec.ts | 3 +- ...k-management-operation-api.service.spec.ts | 3 +- .../management-contracts-api.service.spec.ts | 3 +- .../app/core/api/ontology-api.service.spec.ts | 3 +- .../core/api/operation-api.service.spec.ts | 3 +- .../src/app/core/api/operation-api.service.ts | 5 +- .../api/security-profile-api.service.spec.ts | 3 +- .../referential/src/app/core/core.module.ts | 5 +- .../file-format-create.component.ts | 24 +++---- .../file-format-list.component.spec.ts | 2 +- .../file-format-list.component.ts | 26 ++++---- .../file-format-information-tab.component.ts | 19 ++++-- .../file-format-preview.component.ts | 7 +-- .../file-format/file-format.component.spec.ts | 3 +- .../app/file-format/file-format.component.ts | 6 +- .../app/file-format/file-format.service.ts | 5 +- .../ingest-contract-list.component.ts | 16 ++--- ...ngest-contract-attachment-tab.component.ts | 12 +++- ...est-contract-node-update.component.spec.ts | 5 +- .../ingest-contract-node-update.component.ts | 18 +++--- .../ingest-contract-format-tab.component.ts | 7 +-- .../ingest-contract-heritage-tab.component.ts | 7 +-- ...gest-contract-information-tab.component.ts | 16 +++-- .../ingest-contract-object-tab.component.ts | 7 +-- .../ingest-contract-preview.component.ts | 9 +-- ...ingest-contract-signature-tab.component.ts | 7 +-- .../ingest-contract.component.spec.ts | 3 +- .../ingest-contract.component.ts | 6 +- .../ingest-contract.service.ts | 5 +- ...ook-management-operation-list.component.ts | 14 ++--- ...ent-operation-information-tab.component.ts | 5 +- ...-management-operation-preview.component.ts | 18 ++---- ...ook-management-operation.component.spec.ts | 3 +- .../logbook-management-operation.component.ts | 8 +-- ...logbook-operation-detail.component.spec.ts | 3 +- .../logbook-operation-detail.component.ts | 16 ++--- .../logbook-operation-popup.component.ts | 2 +- .../logbook-operation-list.component.ts | 20 +++--- .../logbook-operation.component.spec.ts | 3 +- .../logbook-operation.component.ts | 6 +- ...istent-identifier-policy-form.component.ts | 11 ++-- ...istent-identifier-policy-form.component.ts | 11 ++-- ...management-contract-list.component.spec.ts | 3 +- .../management-contract-list.component.ts | 14 ++--- ...t-contract-identification-tab.component.ts | 9 ++- ...contract-information-tab.component.spec.ts | 3 +- ...ment-contract-information-tab.component.ts | 7 +-- ...agement-contract-preview.component.spec.ts | 3 +- .../management-contract-preview.component.ts | 10 +-- ...ent-contract-storage-tab.component.spec.ts | 3 +- ...nagement-contract-storage-tab.component.ts | 9 ++- .../management-contract.component.spec.ts | 3 +- .../management-contract.component.ts | 8 +-- .../management-contract.service.ts | 5 +- .../ontology-create.component.spec.ts | 3 +- .../ontology-create.component.ts | 3 +- .../schema-delete-dialog.component.ts | 3 +- .../schema-list/schema-list.component.ts | 4 +- ...ontology-information-tab.component.spec.ts | 3 +- .../ontology-information-tab.component.ts | 3 +- .../ontology-preview.component.ts | 3 +- .../schema-information-tab.component.spec.ts | 3 +- .../schema-information-tab.component.ts | 3 +- .../app/ontology/ontology.component.spec.ts | 3 +- .../src/app/ontology/ontology.component.ts | 8 +-- .../griffin-list.component.spec.ts | 3 +- ...eservation-scenario-list.component.spec.ts | 3 +- ...tion-scenario-information-tab.component.ts | 3 +- .../preservation.component.spec.ts | 3 +- .../probative-value-create.component.ts | 16 +++-- .../probative-value-list.component.ts | 10 +-- .../probative-value-preview.component.spec.ts | 3 +- .../probative-value-preview.component.ts | 13 ++-- .../probative-value.component.spec.ts | 3 +- .../probative-value.component.ts | 8 +-- .../probative-value.service.ts | 5 +- .../rule-create/rule-create.component.spec.ts | 3 +- .../rule/rule-create/rule-create.component.ts | 14 ++--- .../app/rule/rule-list/rule-list.component.ts | 26 ++++---- .../rule-information-tab.component.ts | 7 +-- .../rule-preview/rule-preview.component.ts | 7 +-- .../src/app/rule/rule.component.spec.ts | 2 +- .../src/app/rule/rule.component.ts | 6 +- .../securisation-list.component.ts | 16 ++--- .../securisation-check-tab.component.spec.ts | 3 +- .../securisation-check-tab.component.ts | 16 ++++- .../securisation-information-tab.component.ts | 5 +- .../securisation-preview.component.spec.ts | 3 +- .../securisation-preview.component.ts | 14 ++--- .../securisation.component.spec.ts | 3 +- .../securisation/securisation.component.ts | 8 +-- .../app/securisation/securisation.service.ts | 5 +- .../security-profile-create.component.spec.ts | 2 - .../security-profile-create.component.ts | 3 +- ...urity-profile-edit-permission.component.ts | 4 +- .../security-profile-list.component.ts | 14 ++++- ...urity-profile-information-tab.component.ts | 7 +-- ...urity-profile-permissions-tab.component.ts | 5 +- .../security-profile-preview.component.ts | 7 +-- .../security-profile.component.spec.ts | 3 +- .../security-profile.component.ts | 6 +- .../import-dialog/import-dialog.component.ts | 12 ++-- .../referential-import-api.service.spec.ts | 3 +- .../referential-import.service.ts | 3 +- .../projects/referential/src/main.ts | 12 ++-- .../account-information-tab.component.ts | 4 +- .../app/modules/account/account.component.ts | 4 +- .../archive-unit-count.component.ts | 2 +- .../physical-archive-viewer.component.ts | 2 +- .../components/collapse/collapse.component.ts | 2 +- .../common-confirm-dialog.component.ts | 5 +- .../common-tooltip/tooltip.directive.ts | 2 +- .../modules/components/data/data.component.ts | 2 +- .../download-snack-bar.component.ts | 9 ++- .../editable-email-input.component.ts | 8 +-- .../editable-field.component.ts | 4 +- .../editable-file/editable-file.component.ts | 4 +- .../editable-input.component.ts | 6 +- .../editable-level-input.component.ts | 6 +- .../editable-textarea.component.ts | 6 +- .../editable-toggle-group.component.ts | 8 +-- .../level-input/level-input.component.ts | 2 +- .../components/header/header.component.ts | 2 +- .../item-select/item-select.component.ts | 2 +- .../components/header/menu/menu.component.ts | 6 +- .../select-language.component.ts | 6 +- .../select-site/select-site.component.ts | 4 +- .../select-tenant-dialog.component.ts | 2 +- .../header/user-photo/user-photo.component.ts | 2 +- .../vitamui-interval-date-picker.component.ts | 2 +- .../vitamui-multi-inputs.component.ts | 4 +- .../resize-sidebar.directive.ts | 2 +- .../resize-vertical.directive.ts | 2 +- .../group-editor/group-editor.component.ts | 8 +-- .../list-editor/list-editor.component.ts | 2 +- .../primitive-editor.component.ts | 2 +- .../src/app/modules/pipes/bytes.pipe.ts | 6 +- .../src/app/modules/pipes/datetime.pipe.ts | 2 +- .../src/app/modules/pipes/highlight.pipe.ts | 2 +- .../src/app/modules/pipes/safe-style.pipe.ts | 2 +- .../src/app/modules/pipes/yes-no.pipe.ts | 2 +- .../security/has-any-role.directive.ts | 2 +- .../modules/security/has-role.directive.ts | 2 +- .../subrogation-modal.component.ts | 6 +- .../filing-plan/filing-plan.component.ts | 6 +- .../lib/components/select/select.component.ts | 2 +- .../vitamui-radio-group.component.ts | 2 +- .../vitamui-radio/vitamui-radio.component.ts | 2 +- ui/ui-frontend/test.ts | 14 ++--- 488 files changed, 1609 insertions(+), 2343 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/app.component.ts b/ui/ui-frontend/projects/archive-search/src/app/app.component.ts index b895a21460e..f4e05448797 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/app.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/app.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; -import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { FooterComponent, HeaderModule, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library'; import { RouterOutlet } from '@angular/router'; @Component({ diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts index ad667574e2e..199f84ab367 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts @@ -39,35 +39,35 @@ import { Component, EventEmitter, HostListener, + inject, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, - inject, } from '@angular/core'; import { MatTab, MatTabChangeEvent, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { Unit, AccessContract, AccessContractService } from 'vitamui-library'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { - CommonTooltipComponent, + AccessContract, + AccessContractService, + ClickOutsideDirective, + PipesModule, TooltipDirective, - VitamuiSidenavHeaderComponent, + Unit, unitToVitamuiIcon, VitamuiMenuButtonComponent, - ClickOutsideDirective, - PipesModule, + VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { ArchiveUnitDescriptionTabComponent } from './archive-unit-description-tab/archive-unit-description-tab.component'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { MatMenuItem } from '@angular/material/menu'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { ArchiveUnitInformationTabComponent } from './archive-unit-information-tab/archive-unit-information-tab.component'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab/archive-unit-rules-details-tab.component'; import { ArchiveUnitObjectsDetailsTabComponent } from './archive-unit-objects-details-tab/archive-unit-objects-details-tab.component'; -import { AddManagementRulesComponent } from '../archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component'; import { ReactiveFormsModule } from '@angular/forms'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @@ -87,11 +87,9 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; ClickOutsideDirective, ArchiveUnitRulesDetailsTabComponent, ArchiveUnitObjectsDetailsTabComponent, - AddManagementRulesComponent, PipesModule, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, VitamuiSidenavHeaderComponent, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts index 9ceca9d9c30..f4920b48850 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts @@ -36,35 +36,35 @@ */ import { Component, + computed, EventEmitter, + inject, + input, + Input, OnChanges, OnDestroy, Output, SimpleChanges, TemplateRef, ViewChild, - computed, - inject, - input, - Input, } from '@angular/core'; -import { MatDialog, MatDialogConfig, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogConfig } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { merge, Observable, pipe, Subscription, UnaryFunction } from 'rxjs'; import { filter, map, startWith, switchMap, tap } from 'rxjs/operators'; import { ApplicationId, ArchiveUnit, ArchiveUnitEditorComponent, + ArchiveUnitModule, + DialogHeaderComponent, EditObject, JsonPatch, Logger, OperationId, - SpinnerOverlayService, SnackBarService, - ArchiveUnitModule, - DialogHeaderComponent, + SpinnerOverlayService, } from 'vitamui-library'; import { ArchiveUnitService } from './archive-unit.service'; import { NgClass } from '@angular/common'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts index 9751253b43a..b8accb274c7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts @@ -34,10 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; -import { Unit, VersionWithQualifierDto, AccessContract, AccessContractService } from 'vitamui-library'; -import { ObjectQualifierType, DataComponent, PipesModule } from 'vitamui-library'; +import { + AccessContract, + AccessContractService, + DataComponent, + ObjectQualifierType, + PipesModule, + Unit, + VersionWithQualifierDto, +} from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { AsyncPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts index 1f95c2edb43..809cc09556c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.spec.ts @@ -51,9 +51,10 @@ import { import { ArchiveService } from '../../archive.service'; import { ArchiveUnitObjectsDetailsTabComponent } from './archive-unit-objects-details-tab.component'; import { vi } from 'vitest'; +import { ActivatedRoute } from '@angular/router'; + const createSpyObj = (methods: string[]): any => Object.fromEntries(methods.map((m) => [m, vi.fn()])); const anything = () => expect.anything(); -import { ActivatedRoute } from '@angular/router'; describe('ArchiveUnitObjectsDetailsTabComponent', () => { let component: ArchiveUnitObjectsDetailsTabComponent; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts index 7c67b0aa7d6..17235901dbe 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-objects-details-tab/archive-unit-objects-details-tab.component.ts @@ -36,18 +36,19 @@ */ import { Clipboard } from '@angular/cdk/clipboard'; import { HttpHeaders } from '@angular/common/http'; -import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; -import { Unit, VersionWithQualifierDto } from 'vitamui-library'; +import { Component, inject, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { AccessContract, AccessContractService, + ArchiveUnitModule, DescriptionLevel, + PipesModule, qualifiersToVersionsWithQualifier, TenantSelectionService, - VitamuiHttpHeaders, - ArchiveUnitModule, TooltipDirective, - PipesModule, + Unit, + VersionWithQualifierDto, + VitamuiHttpHeaders, } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { Subscription } from 'rxjs'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 547405c2aab..9b4a072c2a1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -39,8 +39,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; -import { BASE_URL, Unit, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, Unit, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts index 4dd34b992ca..1d717794d74 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts @@ -34,11 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; +import { Component, inject, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { SearchCriteriaEltDto, Unit } from 'vitamui-library'; -import { CriteriaDataType, CriteriaOperator, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, SearchCriteriaEltDto, SearchCriteriaTypeEnum, Unit } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveUnitRulesInformationsTabComponent } from './archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts index 8df43b365f9..1295d14204b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts @@ -34,10 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { InheritedPropertyDto, RuleActionDetails, Unit, UnitRuleDto, Logger } from 'vitamui-library'; -import { PipesModule } from 'vitamui-library'; +import { Component, inject, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { InheritedPropertyDto, Logger, PipesModule, RuleActionDetails, Unit, UnitRuleDto } from 'vitamui-library'; import { NgClass } from '@angular/common'; @Component({ diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts index 1ac0c22138c..d0355e13596 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.ts @@ -34,39 +34,38 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, ResourceRef, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Component, inject, OnDestroy, OnInit, ResourceRef } from '@angular/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { finalize, Subscription } from 'rxjs'; import * as uuid from 'uuid'; import { AgencyService, ApplicationId, ConfirmDialogService, + DialogHeaderComponent, + InputComponent, Logger, + NextStepComponent, ObjectQualifierTypeList, ObjectQualifierTypeType, + PreviousStepComponent, SearchCriteriaEltDto, + SelectComponent, + SlideToggleComponent, SnackBarService, + StepperComponent, UsageVersionEnum, VitamuiSelectOptions, - DialogHeaderComponent, - StepperComponent, - InputComponent, - SelectComponent, - NextStepComponent, - SlideToggleComponent, - PreviousStepComponent, } from 'vitamui-library'; import { ArchiveService } from '../../../archive.service'; import { ExportDIPRequestDto, QualifierVersion } from '../../../models/dip.interface'; import { distinctUntilChanged, map } from 'rxjs/operators'; import { rxResource } from '@angular/core/rxjs-interop'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; @Component({ selector: 'app-dip-request-create', @@ -77,7 +76,6 @@ import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; StepperComponent, CdkStep, ReactiveFormsModule, - CdkScrollable, MatDialogContent, InputComponent, SelectComponent, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts index 8eeb823911f..5f5aef30c7d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts @@ -35,16 +35,19 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { merge, Observable, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; import { CriteriaDataType, CriteriaOperator, + DatepickerComponent, + DialogHeaderComponent, diff, + InputComponent, ManagementRuleValidators, Rule, RuleService, @@ -52,9 +55,6 @@ import { SearchCriteriaEltDto, VitamTenantConfigService, SelectComponent, - DatepickerComponent, - InputComponent, - DialogHeaderComponent, VitamuiSelectOptions, } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../../../core/management-rules-shared-data.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index c7b3d245321..df8fb34da1c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -42,8 +42,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { AddUpdatePropertyComponent } from './add-update-property.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts index d3d49298707..63c14cd1683 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.ts @@ -34,15 +34,15 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, OnInit, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { ManagementRulesSharedDataService } from '../../../../../../core/management-rules-shared-data.service'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; -import { SelectComponent, DialogHeaderComponent } from 'vitamui-library'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { DialogHeaderComponent, SelectComponent } from 'vitamui-library'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index 3ecbe658e54..2e6cd407038 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -47,9 +47,9 @@ import { InjectorModule, LoggerModule, SearchCriteriaDto, - WINDOW_LOCATION, - TenantSelectionService, Tenant, + TenantSelectionService, + WINDOW_LOCATION, } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { UpdateUnitManagementRuleService } from '../../../../common-services/update-unit-management-rule.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts index be703858538..d28c42c1c4f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; import { ManagementRulesSharedDataService } from '../../../../../core/management-rules-shared-data.service'; import { ActionsRules, ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../models/ruleAction.interface'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index 1141eecf94b..ecbe0fe5ca3 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -42,8 +42,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts index 8b588f78581..3758967682f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Subscription } from 'rxjs'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index f633c9bf32a..2cc14889304 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -43,8 +43,7 @@ import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, Rule, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, Rule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { BlockRulesInheritanceComponent } from './block-rules-inheritance.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts index 72d0e914da6..1cd17f13fee 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.ts @@ -34,21 +34,21 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { merge, Observable, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; import { + DialogHeaderComponent, diff, ManagementRuleValidators, Rule, RuleService, SearchCriteriaDto, - VitamuiSelectOptions, SelectComponent, - DialogHeaderComponent, + VitamuiSelectOptions, } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum'; import { ManagementRules, RuleAction, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts index cf601403bff..f6cb6ea802b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.ts @@ -34,27 +34,27 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; -import { merge, Subscription, Observable } from 'rxjs'; +import { merge, Observable, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; import { CriteriaDataType, CriteriaOperator, + DialogHeaderComponent, + diff, ManagementRuleValidators, Rule, RuleService, SearchCriteriaDto, SearchCriteriaEltDto, - VitamuiSelectOptions, - diff, - VitamTenantConfigService, SelectComponent, - DialogHeaderComponent, + VitamTenantConfigService, + VitamuiSelectOptions, } from 'vitamui-library'; import { ArchiveService } from '../../../../../archive.service'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index 64831be6b7d..60433215b2d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -42,8 +42,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts index 0c37e6dba52..3d6ee97eb51 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Subscription } from 'rxjs'; @@ -44,10 +44,10 @@ import { filter } from 'rxjs/operators'; import { CriteriaDataType, CriteriaOperator, + DialogHeaderComponent, SearchCriteriaDto, SearchCriteriaEltDto, VitamTenantConfigService, - DialogHeaderComponent, } from 'vitamui-library'; import { ArchiveService } from '../../../../../archive.service'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts index 463ed425dd3..9cc2e88a3bb 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; @@ -46,16 +46,16 @@ import { debounceTime, filter, map } from 'rxjs/operators'; import { CriteriaDataType, CriteriaOperator, + DialogHeaderComponent, diff, ManagementRuleValidators, Rule, RuleService, SearchCriteriaDto, SearchCriteriaEltDto, - VitamuiSelectOptions, - VitamTenantConfigService, SelectComponent, - DialogHeaderComponent, + VitamTenantConfigService, + VitamuiSelectOptions, } from 'vitamui-library'; import { ArchiveService } from '../../../../../archive.service'; import { ArchiveSearchConstsEnum } from '../../../../../models/archive-search-consts-enum'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts index 3c45136c139..28a7e651851 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.ts @@ -34,28 +34,28 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, ValidationErrors, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { AbstractControl, FormBuilder, FormGroup, ReactiveFormsModule, ValidationErrors, Validators } from '@angular/forms'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { finalize, merge, Observable, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; import { CriteriaDataType, CriteriaOperator, + DatepickerComponent, + DialogHeaderComponent, diff, ManagementRuleValidators, Rule, RuleService, SearchCriteriaDto, SearchCriteriaEltDto, - VitamuiSelectOptions, - VitamTenantConfigService, SelectComponent, SlideToggleComponent, - DatepickerComponent, - DialogHeaderComponent, + VitamTenantConfigService, + VitamuiSelectOptions, } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../../../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index e1e2813da33..fd642b6e66f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -42,8 +42,7 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, SearchCriteriaDto, StartupService, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, SearchCriteriaDto, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../archive.service'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../models/ruleAction.interface'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts index 2f16e3447bf..a8b4054d2fe 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.ts @@ -34,15 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnChanges, OnDestroy, OnInit, SimpleChanges, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Observable, Subscription } from 'rxjs'; import { filter, map, shareReplay } from 'rxjs/operators'; import { ApplicationId, BreadCrumbData, + DialogHeaderComponent, Logger, Option, Rule, @@ -53,7 +54,6 @@ import { SnackBarService, VitamTenantConfigService, VitamuiTitleBreadcrumbComponent, - DialogHeaderComponent, } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../archive.service'; @@ -68,7 +68,7 @@ import { import { Location } from '@angular/common'; import { MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { MatRadioButton } from '@angular/material/radio'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { ArchiveUnitRulesComponent } from './archive-unit-rules/archive-unit-rules.component'; const ARCHIVE_UNIT_HOLDING_UNIT = 'ARCHIVE_UNIT_HOLDING_UNIT'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts index 015260afe8a..d6a2aa94a34 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service.spec.ts @@ -40,8 +40,7 @@ import { of, throwError } from 'rxjs'; import { HttpErrorResponse } from '@angular/common/http'; import { ReassignmentDialogService } from './reassignment-dialog.service'; import { ArchiveService } from '../../../archive.service'; -import { SearchCriteriaEltDto } from 'vitamui-library'; -import { SnackBarService, CriteriaOperator, CriteriaDataType, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, SearchCriteriaEltDto, SearchCriteriaTypeEnum, SnackBarService } from 'vitamui-library'; import { ReassignmentMode } from '../../../models/reassign-request.interface'; describe('ReassignmentDialogService', () => { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts index 49433232d46..a343cdcf4a9 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.spec.ts @@ -40,8 +40,7 @@ import { of, throwError } from 'rxjs'; import { HttpErrorResponse } from '@angular/common/http'; import { PreservationDialogService } from './preservation-dialog.service'; import { ArchiveService } from '../../../archive.service'; -import { SearchCriteriaEltDto } from 'vitamui-library'; -import { SnackBarService, CriteriaOperator, CriteriaDataType, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, SearchCriteriaEltDto, SearchCriteriaTypeEnum, SnackBarService } from 'vitamui-library'; import { PreservationUsage, PreservationVersion } from '../../../models/preservation-request.interface'; describe('PreservationDialogService', () => { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts index 8f3d04d47d6..91717ef9008 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/preservation-dialog/preservation-dialog.service.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { HttpErrorResponse } from '@angular/common/http'; import { catchError, filter, switchMap } from 'rxjs/operators'; import { EMPTY } from 'rxjs'; -import { SearchCriteriaDto, SearchCriteriaEltDto, SnackBarService } from 'vitamui-library'; -import { ApplicationId } from 'vitamui-library'; +import { ApplicationId, SearchCriteriaDto, SearchCriteriaEltDto, SnackBarService } from 'vitamui-library'; import { ArchiveService } from '../../../archive.service'; import { PreservationDialogComponent } from './preservation-dialog.component'; import { PreservationRequestDto } from '../../../models/preservation-request.interface'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts index 38f3f61e422..0a5c9ca9ead 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts @@ -41,8 +41,7 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule, UsageVersionEnum } from 'vitamui-library'; +import { BASE_URL, ConfirmDialogService, InjectorModule, LoggerModule, UsageVersionEnum, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveApiService } from '../../../../core/api/archive-api.service'; import { TransferRequestModalComponent } from './transfer-request-modal.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts index d9486f392af..306026cc1ac 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.ts @@ -34,35 +34,34 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { ApplicationId, ConfirmDialogService, + DialogHeaderComponent, + InputComponent, Logger, + NextStepComponent, ObjectQualifierTypeList, ObjectQualifierTypeType, + PreviousStepComponent, SearchCriteriaEltDto, - UsageVersionEnum, - VitamuiSelectOptions, + SelectComponent, SnackBarService, - DialogHeaderComponent, StepperComponent, - InputComponent, - NextStepComponent, - SelectComponent, - PreviousStepComponent, + UsageVersionEnum, + VitamuiSelectOptions, } from 'vitamui-library'; import { ArchiveService } from '../../../archive.service'; import { QualifierVersion, TransferRequestDto } from '../../../models/dip.interface'; import { delay, distinctUntilChanged, map } from 'rxjs/operators'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; @Component({ selector: 'app-transfer-request-modal', @@ -73,7 +72,6 @@ import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; StepperComponent, CdkStep, ReactiveFormsModule, - CdkScrollable, MatDialogContent, InputComponent, MatDialogActions, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts index 897488686ce..faec2d4dbd7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/archive-search-rules-facets.component.ts @@ -37,7 +37,7 @@ import { Component, Input } from '@angular/core'; import { RuleFacets } from 'vitamui-library'; -import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { MatTab, MatTabGroup, MatTabLabel } from '@angular/material/tabs'; import { SearchStorageRulesFacetsComponent } from './search-storage-rules-facets/search-storage-rules-facets.component'; import { SearchAppraisalRulesFacetsComponent } from './search-appraisal-rules-facets/search-appraisal-rules-facets.component'; import { SearchAccessRulesFacetsComponent } from './search-access-rules-facets/search-access-rules-facets.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts index aaef01d21b1..ee49029974a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts index 083d6f0c378..8c12c5a1a70 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts index 4f9cfdf3f23..12dd4a7fe10 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts index 34be5127393..65c9e38c75d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts index 164cf061d18..8f5be97451e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveFacetsService } from '../../../common-services/archive-facets.service'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index c3faf244435..de2cde69eae 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -78,6 +78,7 @@ import { TransferAcknowledgmentComponent } from './transfer-acknowledgment/trans import { SimpleCriteriaSearchComponent } from './simple-criteria-search/simple-criteria-search.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NodeData } from '../models/nodedata.interface'; + const arrayWithExactContents = (arr: T[]) => expect.arrayContaining(arr as any); const translations: any = { TEST: 'Mock translate test' }; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts index 4dbf83080d7..3ae2584b7f4 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts @@ -41,6 +41,7 @@ import { ChangeDetectorRef, Component, EventEmitter, + inject, OnChanges, OnDestroy, OnInit, @@ -48,11 +49,10 @@ import { SimpleChanges, TemplateRef, ViewChild, - inject, } from '@angular/core'; -import { MatDialog, MatDialogConfig, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogConfig, MatDialogContent } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { merge, Observable, Subject, Subscription } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; import { @@ -68,20 +68,27 @@ import { ARCHIVE_UNIT_WITH_OBJECTS, ARCHIVE_UNIT_WITHOUT_OBJECTS, ArchiveSearchResultFacets, + ArchiveUnitModule, ConfigService, CriteriaDataType, CriteriaOperator, CriteriaSearchCriteria, CriteriaValue, + DialogHeaderComponent, Direction, DISSEMINATION_RULE, FilingHoldingSchemeNode, + HasRoleDirective, + InfiniteScrollDirective, Logger, MANAGEMENT_RULE_SHARED_DATA_SERVICE, + ManagementRuleSearchComponent, NODES, + OrderByButtonComponent, ORIGIN_WAITING_RECALCULATE, ORPHANS_NODE_ID, PagedResult, + PipesModule, QueryParamsService, ReclassificationDialogComponent, REUSE_RULE, @@ -102,23 +109,15 @@ import { STORAGE_RULE, TermsFacet, toManagementRuleType, + TooltipDirective, Unit, UnitType, VALID_COMPUTED_INHERITED_RULES_FACET, - VitamuiRoles, - WAITING_RECALCULATE, VitamTenantConfigService, VitamuiMenuButtonComponent, - ManagementRuleSearchComponent, + VitamuiRoles, VitamuiSupHeaderComponent, - ArchiveUnitModule, - TooltipDirective, - DialogHeaderComponent, - OrderByButtonComponent, - PipesModule, - HasAnyRoleDirective, - HasRoleDirective, - InfiniteScrollDirective, + WAITING_RECALCULATE, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../../core/management-rules-shared-data.service'; @@ -133,32 +132,31 @@ import { ActionsRules } from '../models/ruleAction.interface'; import { SearchCriteriaSaverComponent } from './search-criteria-saver/search-criteria-saver.component'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment/transfer-acknowledgment.component'; import { PuaUpdateDialogComponent, PuaUpdateDialogComponentData } from './pua-update-dialog/pua-update-dialog.component'; -import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; import { ReassignmentDialogService } from './additional-actions-search/originating-agency-reassignment-dialog/reassignment-dialog.service'; import { PreservationDialogService } from './additional-actions-search/preservation-dialog/preservation-dialog.service'; import { ReassignmentMode } from '../models/reassign-request.interface'; import { TitleAndDescriptionCriteriaSearchComponent } from './title-and-description-criteria-search/title-and-description-criteria-search.component'; -import { MatMenuItem, MatMenuTrigger, MatMenu } from '@angular/material/menu'; +import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { CriteriaSearchComponent } from '../criteria-search/criteria-search.component'; import { SearchCriteriaListComponent } from './search-criteria-list/search-criteria-list.component'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { NgClass, NgTemplateOutlet, AsyncPipe, CommonModule } from '@angular/common'; +import { AsyncPipe, CommonModule, NgClass, NgTemplateOutlet } from '@angular/common'; import { ArchiveSearchRulesFacetsComponent } from './archive-search-rules-facets/archive-search-rules-facets.component'; -import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { MatTab, MatTabGroup, MatTabLabel } from '@angular/material/tabs'; import { SimpleCriteriaSearchComponent } from './simple-criteria-search/simple-criteria-search.component'; import { - MatTable, + MatCell, + MatCellDef, MatColumnDef, - MatHeaderCellDef, MatHeaderCell, - MatCellDef, - MatCell, - MatHeaderRowDef, + MatHeaderCellDef, MatHeaderRow, - MatRowDef, + MatHeaderRowDef, MatRow, + MatRowDef, + MatTable, } from '@angular/material/table'; -import { CdkScrollable } from '@angular/cdk/scrolling'; const PAGE_SIZE = 10; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -211,14 +209,12 @@ const NON_TREE_UNIT_TYPES = [ARCHIVE_UNIT_FILING_UNIT, ARCHIVE_UNIT_WITH_OBJECTS DialogHeaderComponent, MatDialogActions, MatDialogClose, - CdkScrollable, MatDialogContent, OrderByButtonComponent, AsyncPipe, PipesModule, TranslatePipe, CommonModule, - HasAnyRoleDirective, HasRoleDirective, InfiniteScrollDirective, ], diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts index 8c7e3bdad29..05cd052314f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/confirm-action/confirm-action.component.ts @@ -72,7 +72,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; -import { PipesModule, ClosePopupDialogComponent, CommonConfirmDialogComponent, DialogHeaderComponent } from 'vitamui-library'; +import { CommonConfirmDialogComponent, PipesModule } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; import { MatDialogModule } from '@angular/material/dialog'; @@ -81,15 +81,7 @@ import { MatDialogModule } from '@angular/material/dialog'; @Component({ selector: 'vitamui-confirm-action', templateUrl: './confirm-action.component.html', - imports: [ - PipesModule, - TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - CommonModule, - DialogHeaderComponent, - MatDialogModule, - ], + imports: [PipesModule, TranslatePipe, CommonConfirmDialogComponent, CommonModule, MatDialogModule], }) export class ConfirmActionComponent { // delete or changeTab diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts index 2902a5a422e..22259c7ab64 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, OnDestroy, OnInit, Output } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { SearchCriteriaHistory, SnackBarService } from 'vitamui-library'; -import { Direction, TooltipDirective, PipesModule } from 'vitamui-library'; +import { Direction, PipesModule, SearchCriteriaHistory, SnackBarService, TooltipDirective } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ConfirmActionComponent } from './confirm-action/confirm-action.component'; import { SearchCriteriaListService } from './search-criteria-list.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts index a4dd2dfe32d..d3097114d96 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.ts @@ -35,25 +35,25 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { DatePipe } from '@angular/common'; -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslatePipe } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { + ChipComponent, ConfirmDialogService, CriteriaSearchCriteria, Direction, + ElementsComponent, + InputComponent, + ORIGIN_WAITING_RECALCULATE, + PipesModule, SearchCriteriaHistory, SearchCriteriaTypeEnum, SnackBarService, - ORIGIN_WAITING_RECALCULATE, - WAITING_RECALCULATE, - ChipComponent, TooltipDirective, - InputComponent, - ElementsComponent, - PipesModule, + WAITING_RECALCULATE, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { SearchCriteriaSaverService } from './search-criteria-saver.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts index 7d971123f95..13c1f875216 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, ChangeDetectorRef, inject } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core'; +import { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { AgencyService, ArchiveUnitProfilesService, @@ -45,6 +45,9 @@ import { CriteriaDataType, CriteriaOperator, CriteriaValue, + DatepickerComponent, + EditableInputComponent, + FormFieldValueWrapperComponent, ItemNode, Option, SchemaElement, @@ -54,26 +57,10 @@ import { SearchCriteriaService, SearchCriteriaTypeEnum, SearchType, - VitamuiSelectOptions, - FormFieldValueWrapperComponent, SearchWithTypeSelectorComponent, SelectComponent, - DatepickerComponent, SelectWithTreeComponent, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, + VitamuiSelectOptions, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../../../core/management-rules-shared-data.service'; @@ -82,11 +69,10 @@ import { combineLatest } from 'rxjs'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; import { ActivatedRoute, Params } from '@angular/router'; import { ArchiveSearchHelperService } from '../../common-services/archive-search-helper.service'; -import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; -import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { NgTemplateOutlet, CommonModule } from '@angular/common'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; +import { MatProgressSpinner, MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { CommonModule, NgTemplateOutlet } from '@angular/common'; import { MatInputModule } from '@angular/material/input'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { OverlayModule } from '@angular/cdk/overlay'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatSelectModule } from '@angular/material/select'; @@ -122,21 +108,9 @@ const COMPLEX_INPUTS = ['otherCriteriaList']; NgTemplateOutlet, SelectWithTreeComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -144,7 +118,6 @@ const COMPLEX_INPUTS = ['otherCriteriaList']; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class SimpleCriteriaSearchComponent implements OnInit { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts index 2ca5d5a6ebb..b4a751cc56e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.spec.ts @@ -38,8 +38,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { CriteriaValue } from 'vitamui-library'; -import { CriteriaOperator, InjectorModule } from 'vitamui-library'; +import { CriteriaOperator, CriteriaValue, InjectorModule } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { TitleAndDescriptionCriteriaSearchComponent } from './title-and-description-criteria-search.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts index afd8901823e..cd9ec200d79 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/title-and-description-criteria-search/title-and-description-criteria-search.component.ts @@ -35,31 +35,11 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { FormBuilder, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { merge } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; -import { CriteriaValue } from 'vitamui-library'; -import { - CriteriaDataType, - CriteriaOperator, - diff, - SearchCriteriaTypeEnum, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, -} from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, CriteriaValue, diff, EditableInputComponent, SearchCriteriaTypeEnum } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; import { TranslatePipe } from '@ngx-translate/core'; @@ -79,21 +59,9 @@ const TITLE_OR_DESCRIPTION = 'TITLE_OR_DESCRIPTION'; imports: [ ReactiveFormsModule, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -101,7 +69,6 @@ const TITLE_OR_DESCRIPTION = 'TITLE_OR_DESCRIPTION'; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class TitleAndDescriptionCriteriaSearchComponent { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index 2a56dc4680b..0ce0d427a22 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -39,8 +39,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { BASE_URL, BytesPipe, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; +import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment.component'; import { DecimalPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts index 7ebd4949461..9c7dbf18c0f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { @@ -43,21 +43,20 @@ import { ExternalParameters, ExternalParametersService, GlobalEventService, + ResizeSidebarDirective, SchemaService, SidenavPage, SnackBarService, + TooltipDirective, Unit, VitamuiTitleBreadcrumbComponent, - TooltipDirective, - ResizeSidebarDirective, - ResizeVerticalDirective, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../core/management-rules-shared-data.service'; import { ArchiveService } from './archive.service'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { FilingHoldingSchemeComponent } from './filing-holding-scheme/filing-holding-scheme.component'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { ArchivePreviewComponent } from './archive-preview/archive-preview.component'; import { ArchiveSearchComponent } from './archive-search/archive-search.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -79,7 +78,6 @@ import { TranslatePipe } from '@ngx-translate/core'; TranslatePipe, CommonModule, ResizeSidebarDirective, - ResizeVerticalDirective, ], }) export class ArchiveComponent extends SidenavPage implements OnInit { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts index 2909f16eba2..5f7df9aa461 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts @@ -39,8 +39,7 @@ import { TestBed } from '@angular/core/testing'; import { ArchiveService } from './archive.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BASE_URL, Unit } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule, Unit } from 'vitamui-library'; import { ArchiveApiService } from '../core/api/archive-api.service'; import { vi } from 'vitest'; import { of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts index ae6dcb095ba..af3ba9192a8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { ResultFacet, ResultFacetList, BASE_URL } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule, ResultFacet, ResultFacetList } from 'vitamui-library'; import { ArchiveFacetsService } from './archive-facets.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts index ee08f3362bb..d18c5ab5b7e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-unit-elimination.service.ts @@ -38,8 +38,7 @@ import { inject, Injectable, TemplateRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { filter } from 'rxjs/operators'; -import { VitamTenantConfigService, SearchCriteriaEltDto, SnackBarService } from 'vitamui-library'; -import { ApplicationId } from 'vitamui-library'; +import { ApplicationId, SearchCriteriaEltDto, SnackBarService, VitamTenantConfigService } from 'vitamui-library'; import { ArchiveSearchComponent } from '../archive-search/archive-search.component'; import { ArchiveService } from '../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts index 5fc082e7c72..39f15cef010 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service.ts @@ -34,14 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Injectable, TemplateRef, inject } from '@angular/core'; +import { inject, Injectable, TemplateRef } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { SearchCriteriaEltDto } from 'vitamui-library'; -import { CriteriaDataType, CriteriaOperator, SearchCriteriaTypeEnum, UnitType } from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, SearchCriteriaEltDto, SearchCriteriaTypeEnum, UnitType } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../core/management-rules-shared-data.service'; import { ArchiveSearchComponent } from '../archive-search/archive-search.component'; import { ArchiveService } from '../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts index 6b55989c509..295b817e32f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.ts @@ -34,19 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { CriteriaSearchCriteria, CriteriaValue, SearchCriteriaValue } from 'vitamui-library'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { + CriteriaSearchCriteria, + CriteriaValue, ORIGIN_WAITING_RECALCULATE, + PipesModule, QueryParamsService, SearchCriteriaTypeEnum, + SearchCriteriaValue, + TooltipDirective, TranslateWithOptionalTypeSuffixPipe, WAITING_RECALCULATE, - TooltipDirective, - PipesModule, } from 'vitamui-library'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { NgClass } from '@angular/common'; + @Component({ selector: 'app-criteria-search', templateUrl: './criteria-search.component.html', diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts index 8c3e79bc948..8fdaf50bd3c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/classification-tree/classification-tree.component.ts @@ -37,15 +37,14 @@ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, Input, Output } from '@angular/core'; import { - MatTreeNestedDataSource, + MatNestedTreeNode, MatTree, - MatTreeNodeDef, + MatTreeNestedDataSource, MatTreeNode, - MatNestedTreeNode, + MatTreeNodeDef, MatTreeNodeOutlet, } from '@angular/material/tree'; -import { FilingHoldingSchemeNode } from 'vitamui-library'; -import { nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon, VitamuiTreeNodeComponent } from 'vitamui-library'; +import { FilingHoldingSchemeNode, nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon, VitamuiTreeNodeComponent } from 'vitamui-library'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { DecimalPipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts index 4ac1beef2bd..014513f8419 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -43,8 +43,7 @@ import { MatTreeModule } from '@angular/material/tree'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { FilingHoldingSchemeNode } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { FilingHoldingSchemeNode, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { ArchiveApiService } from '../../core/api/archive-api.service'; import { ArchiveService } from '../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts index f583a799073..0f8bd935972 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { NestedTreeControl } from '@angular/cdk/tree'; -import { Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, OnDestroy, OnInit, Output } from '@angular/core'; import { MatTreeNestedDataSource } from '@angular/material/tree'; import { ActivatedRoute } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; @@ -46,13 +46,12 @@ import { FilingHoldingSchemeHandler, FilingHoldingSchemeNode, PagedResult, + ResizeVerticalDirective, ResultFacet, SearchCriteriaDto, SearchCriteriaTypeEnum, Unit, UnitType, - ResizeSidebarDirective, - ResizeVerticalDirective, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { ArchiveService } from '../archive.service'; @@ -65,7 +64,7 @@ import { CommonModule } from '@angular/common'; selector: 'app-filing-holding-scheme', templateUrl: './filing-holding-scheme.component.html', styleUrls: ['./filing-holding-scheme.component.scss'], - imports: [ClassificationTreeComponent, LeavesTreeComponent, CommonModule, ResizeSidebarDirective, ResizeVerticalDirective], + imports: [ClassificationTreeComponent, LeavesTreeComponent, CommonModule, ResizeVerticalDirective], }) export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts index 3c9a099bd84..199a098c902 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.ts @@ -35,8 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { NestedTreeControl } from '@angular/cdk/tree'; -import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, inject } from '@angular/core'; -import { MatTreeNestedDataSource, MatTree, MatTreeNodeDef, MatNestedTreeNode, MatTreeNodeOutlet } from '@angular/material/tree'; +import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; +import { MatNestedTreeNode, MatTree, MatTreeNestedDataSource, MatTreeNodeDef, MatTreeNodeOutlet } from '@angular/material/tree'; import { Subscription } from 'rxjs'; import { ConfigurationsApiService, @@ -48,16 +48,16 @@ import { nodeToVitamuiIcon, ResultFacet, SearchCriteriaDto, + TooltipDirective, Unit, UnitType, - TooltipDirective, VitamuiTreeNodeComponent, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../core/archive-shared-data.service'; import { ArchiveService } from '../../archive.service'; import { first } from 'rxjs/operators'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { NgClass, DecimalPipe } from '@angular/common'; +import { DecimalPipe, NgClass } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts index 671ebc2ce0d..16cc9b6b6ba 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts @@ -34,15 +34,14 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpBackend, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { MissingTranslationHandler, TranslateLoader } from '@ngx-translate/core'; +import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, VitamuiMissingTranslationHandler } from 'vitamui-library'; -import { LoggerModule, ObjectQualifierType } from 'vitamui-library'; +import { BASE_URL, LoggerModule, ObjectQualifierType } from 'vitamui-library'; import { FoundObjectModalComponent } from './found-object-modal.component'; class FakeTranslateLoader implements TranslateLoader { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts index cba029173d9..357d7ebff77 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.ts @@ -35,17 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogRef } from '@angular/material/dialog'; import { NavigationExtras, Router } from '@angular/router'; import { AccessContract, AccessContractService, ApiUnitObject, + DialogHeaderComponent, ObjectQualifierType, qualifiersToVersionsWithQualifier, TenantSelectionService, VersionWithQualifierDto, - DialogHeaderComponent, } from 'vitamui-library'; import { PurgedPersistentIdentifierDto } from '../../../core/api/persistent-identifier-response-dto.interface'; import { ArchiveService } from '../../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts index d6d1ef5a7ae..f97c50a3ecf 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.ts @@ -42,9 +42,9 @@ import { ApiUnitObject, ApplicationId, BreadCrumbData, + SearchBarComponent, TenantSelectionService, VitamuiTitleBreadcrumbComponent, - SearchBarComponent, } from 'vitamui-library'; import { PurgedPersistentIdentifierDto } from '../../core/api/persistent-identifier-response-dto.interface'; import { PersistentIdentifierService } from '../persistent-identifier.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts index 76d3bd5a48a..63f0f33dac3 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpBackend, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { MissingTranslationHandler, TranslateLoader } from '@ngx-translate/core'; +import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { VitamuiMissingTranslationHandler } from 'vitamui-library'; import { ObjectPurgedPersistentOperationType, UnitPurgedPersistentOperationType, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts index d7fe38e7ce4..343a76cedd7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.ts @@ -34,8 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogRef } from '@angular/material/dialog'; import { ObjectPurgedPersistentOperationType, PurgedPersistentIdentifierDto, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts index b1ac7737e73..273374fc535 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/validators/archive-unit-validator.service.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { AbstractControl, AsyncValidatorFn } from '@angular/forms'; import { of, timer } from 'rxjs'; import { map, switchMap, take } from 'rxjs/operators'; -import { SearchCriteriaDto } from 'vitamui-library'; -import { CriteriaOperator, SearchCriteriaTypeEnum, CriteriaDataType } from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, SearchCriteriaDto, SearchCriteriaTypeEnum } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { ArchiveService } from '../archive.service'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts index 35720dda206..b8ee0288343 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { ArchiveApiService } from './archive-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts b/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts index 4c512f3f18e..3544f9f7544 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/core.module.ts @@ -36,9 +36,8 @@ */ import { CommonModule } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { NgModule, inject } from '@angular/core'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { inject, NgModule } from '@angular/core'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/archive-search/src/main.ts b/ui/ui-frontend/projects/archive-search/src/main.ts index db5c243c618..c5b486a8ed9 100644 --- a/ui/ui-frontend/projects/archive-search/src/main.ts +++ b/ui/ui-frontend/projects/archive-search/src/main.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; -import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; +import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { WINDOW_LOCATION, BytesPipe } from 'vitamui-library'; -import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/core/core.module'; diff --git a/ui/ui-frontend/projects/collect/src/app/app.component.ts b/ui/ui-frontend/projects/collect/src/app/app.component.ts index 7f5eaf9f955..383e440df06 100644 --- a/ui/ui-frontend/projects/collect/src/app/app.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/app.component.ts @@ -36,7 +36,7 @@ */ import { Component } from '@angular/core'; -import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { FooterComponent, HeaderModule, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library'; import { RouterOutlet } from '@angular/router'; @Component({ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index 8547d798790..33c78eb36d2 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -41,8 +41,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, BytesPipe, Transaction, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule, TransactionStatus } from 'vitamui-library'; +import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { AddUnitsComponent } from './add-units.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DecimalPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts index bf72333b061..8744565b123 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.ts @@ -36,44 +36,42 @@ */ import { Component, inject, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { finalize, from, Observable, of, switchMap } from 'rxjs'; import { ApplicationId, + CommonProgressBarComponent, CriteriaDataType, CriteriaOperator, + DialogHeaderComponent, Direction, + FileSelectorComponent, + FilingPlanComponent, FilingPlanMode, + NextStepComponent, PagedResult, + PipesModule, + PreviousStepComponent, SearchCriteriaEltDto, SearchCriteriaTypeEnum, + SelectComponent, SnackBarService, StartupService, + StepperComponent, Transaction, Unit, ZipFile, ZipFileStatus, - DialogHeaderComponent, - StepperComponent, - SelectComponent, - FileSelectorComponent, - NextStepComponent, - PreviousStepComponent, - CommonProgressBarComponent, - PipesModule, - FilingPlanComponent, } from 'vitamui-library'; import { ArchiveCollectService } from '../archive-collect.service'; import { SipImportTrackingService } from '../../shared/sip-import-tracking.service'; -import { FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { last, tap } from 'rxjs/operators'; import { HttpEventType } from '@angular/common/http'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { MatProgressSpinner, MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { AsyncPipe, CommonModule } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatButtonModule } from '@angular/material/button'; import { MatTreeModule } from '@angular/material/tree'; import { MatCheckboxModule } from '@angular/material/checkbox'; @@ -92,7 +90,6 @@ export enum ImportType { DialogHeaderComponent, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, MatProgressSpinner, SelectComponent, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts index f2e3028ccec..b313bfd0025 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.ts @@ -39,30 +39,29 @@ import { Component, EventEmitter, HostListener, + inject, Input, OnChanges, Output, SimpleChanges, ViewChild, - inject, } from '@angular/core'; import { MatTab, MatTabChangeEvent, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { ArchiveUnit, Unit } from 'vitamui-library'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { - CommonTooltipComponent, - TooltipDirective, - VitamuiSidenavHeaderComponent, - unitToVitamuiIcon, addErrorStatusBadgeIfArchiveUnitHasErrors, - VitamuiMenuButtonComponent, + ArchiveUnit, ClickOutsideDirective, PipesModule, + Unit, + unitToVitamuiIcon, + VitamuiMenuButtonComponent, + VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { ArchiveUnitDescriptionTabComponent } from './archive-unit-description-tab/archive-unit-description-tab.component'; import { ArchiveSharedDataService } from '../../core/archive-shared-data.service'; import { MatMenuItem } from '@angular/material/menu'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { ArchiveUnitInformationTabComponent } from './archive-unit-information-tab/archive-unit-information-tab.component'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab/archive-unit-rules-details-tab.component'; import { CollectObjectGroupDetailsTabComponent } from './collect-object-group-details-tab/collect-object-group-details-tab.component'; @@ -87,10 +86,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; PipesModule, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts index 1ebe73f3b41..308ec9d6b0f 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-description-tab/archive-unit-description-tab.component.ts @@ -34,18 +34,20 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, OnDestroy, Output, SimpleChanges, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, Output, SimpleChanges, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { merge, Observable, Subscription } from 'rxjs'; import { filter, map, startWith, switchMap, tap } from 'rxjs/operators'; -import { ArchiveUnit, EditObject, JsonPatch } from 'vitamui-library'; import { + ArchiveUnit, ArchiveUnitEditorComponent, - SnackBarService, - SpinnerOverlayService, ArchiveUnitModule, DialogHeaderComponent, + EditObject, + JsonPatch, + SnackBarService, + SpinnerOverlayService, } from 'vitamui-library'; import { ArchiveUnitService } from './archive-unit.service'; import { NgClass } from '@angular/common'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts index df5106cebd5..055701fa114 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.ts @@ -34,19 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, computed, EventEmitter, input, InputSignal, OnChanges, Output, Signal, SimpleChanges, inject } from '@angular/core'; +import { Component, computed, EventEmitter, inject, input, InputSignal, OnChanges, Output, Signal, SimpleChanges } from '@angular/core'; import { Observable } from 'rxjs'; import { - TenantSelectionService, - Unit, - getErrorsOnArchiveUnit, - getErrorOnTechnicalObjectsGroup, - getErrorOnObjectsGroup, - ValidationError, DataComponent, + getErrorOnObjectsGroup, + getErrorOnTechnicalObjectsGroup, + getErrorsOnArchiveUnit, InformationBlocComponent, InformationDetailComponent, PipesModule, + TenantSelectionService, + Unit, + ValidationError, } from 'vitamui-library'; import { ArchiveCollectService } from '../../archive-collect.service'; import { AsyncPipe, UpperCasePipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 18de55ec928..377ac497cb8 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -38,8 +38,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; -import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts index 1440baa6d71..379c1470248 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.ts @@ -34,11 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; +import { Component, inject, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; -import { SearchCriteriaEltDto, Unit } from 'vitamui-library'; -import { CriteriaDataType, CriteriaOperator, SearchCriteriaTypeEnum } from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, SearchCriteriaEltDto, SearchCriteriaTypeEnum, Unit } from 'vitamui-library'; import { ArchiveCollectService } from '../../archive-collect.service'; import { ArchiveUnitRulesInformationsTabComponent } from './archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts index d0d2b5b7626..3c3cda45bd2 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.ts @@ -34,10 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { InheritedPropertyDto, RuleActionDetails, Unit, UnitRuleDto, Logger } from 'vitamui-library'; -import { PipesModule } from 'vitamui-library'; +import { Component, inject, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { InheritedPropertyDto, Logger, PipesModule, RuleActionDetails, Unit, UnitRuleDto } from 'vitamui-library'; import { NgClass } from '@angular/common'; @Component({ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts index f0018e65c18..71e30aa3a18 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { vi } from 'vitest'; -const createSpyObj = (name: string, methods: string[]): any => Object.fromEntries(methods.map((m) => [m, vi.fn()])); import { Clipboard } from '@angular/cdk/clipboard'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; @@ -63,6 +62,8 @@ import { ArchiveCollectService } from '../../archive-collect.service'; import { CollectObjectGroupDetailsTabComponent } from './collect-object-group-details-tab.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +const createSpyObj = (name: string, methods: string[]): any => Object.fromEntries(methods.map((m) => [m, vi.fn()])); + describe('CollectObjectGroupDetailsTabComponent', () => { let component: CollectObjectGroupDetailsTabComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts index 81b326274b4..e7e072effb2 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.ts @@ -35,24 +35,24 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Clipboard } from '@angular/cdk/clipboard'; -import { Component, computed, input, InputSignal, OnChanges, Signal, SimpleChanges, inject } from '@angular/core'; +import { Component, computed, inject, input, InputSignal, OnChanges, Signal, SimpleChanges } from '@angular/core'; import { ApiUnitObject, + ArchiveUnitModule, DescriptionLevel, FileInfoDto, FormatIdentificationDto, - qualifiersToVersionsWithQualifier, - TenantSelectionService, - Unit, - VersionWithQualifierDto, - ValidationError, - getErrorOnTechnicalObjectsGroup, getErrorOnObjectsGroup, + getErrorOnTechnicalObjectsGroup, InformationBlocComponent, InformationDetailComponent, - ArchiveUnitModule, - TooltipDirective, PipesModule, + qualifiersToVersionsWithQualifier, + TenantSelectionService, + TooltipDirective, + Unit, + ValidationError, + VersionWithQualifierDto, } from 'vitamui-library'; import { ArchiveCollectService } from '../../archive-collect.service'; import { NgClass, UpperCasePipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts index 4690432952c..405f33d0e39 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts @@ -36,9 +36,9 @@ */ import { HttpErrorResponse } from '@angular/common/http'; import { AfterViewInit, Component, inject, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import { MatDialog, MatDialogConfig, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogConfig, MatDialogContent } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, finalize, merge, Observable, of, Subject, Subscription, zip } from 'rxjs'; import { debounceTime, filter, map, mergeMap, share, switchMap, take, tap } from 'rxjs/operators'; import { isEmpty } from 'underscore'; @@ -51,6 +51,7 @@ import { APPRAISAL_RULE, ArchiveSearchResultFacets, ArchiveUnit, + ArchiveUnitModule, BreadCrumbData, ConfirmDialogComponent, ConfirmDialogData, @@ -58,20 +59,28 @@ import { CriteriaOperator, CriteriaSearchCriteria, CriteriaValue, + DialogHeaderComponent, Direction, DiscussionEntity, + DiscussionIconComponent, + DiscussionPanelComponent, DISSEMINATION_RULE, ExternalParameters, ExternalParametersService, FilingHoldingSchemeNode, GlobalEventService, + InfiniteScrollDirective, MANAGEMENT_RULE_SHARED_DATA_SERVICE, + ManagementRuleSearchComponent, NODES, + OrderByButtonComponent, ORIGIN_WAITING_RECALCULATE, ORPHANS_NODE_ID, PagedResult, + PipesModule, QueryParamsService, ReclassificationDialogComponent, + ResizeSidebarDirective, REUSE_RULE, Rule, RuleService, @@ -89,29 +98,19 @@ import { SnackBarService, StartupService, STORAGE_RULE, - VitamTenantConfigService, TermsFacet, toManagementRuleType, + TooltipDirective, Transaction, TransactionStatus, Unit, UnitType, VALID_COMPUTED_INHERITED_RULES_FACET, - WAITING_RECALCULATE, - VitamuiTitleBreadcrumbComponent, - DiscussionIconComponent, - TooltipDirective, - DiscussionPanelComponent, + VitamTenantConfigService, VitamuiMenuButtonComponent, - ManagementRuleSearchComponent, VitamuiSupHeaderComponent, - ArchiveUnitModule, - DialogHeaderComponent, - OrderByButtonComponent, - PipesModule, - InfiniteScrollDirective, - ResizeSidebarDirective, - ResizeVerticalDirective, + VitamuiTitleBreadcrumbComponent, + WAITING_RECALCULATE, } from 'vitamui-library'; import { ArchiveCollectService } from './archive-collect.service'; import { SearchCriteriaSaverComponent } from './archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component'; @@ -122,34 +121,33 @@ import { UpdateUnitsMetadataComponent } from './update-units-metadata/update-uni import { AddUnitsComponent } from './add-units/add-units.component'; import { TransactionsService } from '../transactions/transactions.service'; import { SipImportTrackingService } from '../shared/sip-import-tracking.service'; -import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; import { TransactionValidationMode } from '../models/transaction-validation-mode.enum'; import { BatchStatus } from 'projects/vitamui-library/src/app/modules/models/collect/batch-status'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { FilingHoldingSchemeComponent } from './archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component'; -import { NgClass, NgTemplateOutlet, AsyncPipe, CommonModule } from '@angular/common'; +import { AsyncPipe, CommonModule, NgClass, NgTemplateOutlet } from '@angular/common'; import { ArchivePreviewComponent } from './archive-preview/archive-preview.component'; import { TitleAndDescriptionCriteriaSearchCollectComponent } from './archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component'; -import { MatMenuItem, MatMenuTrigger, MatMenu } from '@angular/material/menu'; +import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { CriteriaSearchComponent } from './archive-search-criteria/components/criteria-search/criteria-search.component'; import { SearchCriteriaListComponent } from './archive-search-criteria/components/search-criteria-list/search-criteria-list.component'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { ArchiveSearchRulesFacetsComponent } from './archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component'; -import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { MatTab, MatTabGroup, MatTabLabel } from '@angular/material/tabs'; import { SimpleCriteriaSearchComponent } from './archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component'; import { - MatTable, + MatCell, + MatCellDef, MatColumnDef, - MatHeaderCellDef, MatHeaderCell, - MatCellDef, - MatCell, - MatHeaderRowDef, + MatHeaderCellDef, MatHeaderRow, - MatRowDef, + MatHeaderRowDef, MatRow, + MatRowDef, + MatTable, } from '@angular/material/table'; -import { CdkScrollable } from '@angular/cdk/scrolling'; const PAGE_SIZE = 10; const ELIMINATION_TECHNICAL_ID = 'ELIMINATION_TECHNICAL_ID'; @@ -204,7 +202,6 @@ const FILTER_DEBOUNCE_TIME_MS = 400; MatHeaderRow, MatRowDef, MatRow, - CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, @@ -216,7 +213,6 @@ const FILTER_DEBOUNCE_TIME_MS = 400; CommonModule, InfiniteScrollDirective, ResizeSidebarDirective, - ResizeVerticalDirective, ], }) export class ArchiveSearchCollectComponent extends SidenavPage implements OnInit, OnDestroy, AfterViewInit { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts index 897488686ce..faec2d4dbd7 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/archive-search-rules-facets.component.ts @@ -37,7 +37,7 @@ import { Component, Input } from '@angular/core'; import { RuleFacets } from 'vitamui-library'; -import { MatTabGroup, MatTab, MatTabLabel } from '@angular/material/tabs'; +import { MatTab, MatTabGroup, MatTabLabel } from '@angular/material/tabs'; import { SearchStorageRulesFacetsComponent } from './search-storage-rules-facets/search-storage-rules-facets.component'; import { SearchAppraisalRulesFacetsComponent } from './search-appraisal-rules-facets/search-appraisal-rules-facets.component'; import { SearchAccessRulesFacetsComponent } from './search-access-rules-facets/search-access-rules-facets.component'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts index 0035960867a..80b83477fd5 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-access-rules-facets/search-access-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts index f40fe1409d1..69049592d2e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-appraisal-rules-facets/search-appraisal-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts index bf2c2e70c2e..0828f89d88a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-dissemination-rules-facets/search-dissemination-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts index 2bc65a1e462..4b3dfd6ae2c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-reuse-rules-facets/search-reuse-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts index 47fe74a3f0b..fe22980dfd6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/archive-search-rules-facets/search-storage-rules-facets/search-storage-rules-facets.component.ts @@ -36,10 +36,9 @@ */ import { DatePipe } from '@angular/common'; -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { FacetDetails, RuleFacets, VitamTenantConfigService } from 'vitamui-library'; -import { Colors, VitamuiFacetComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { Colors, FacetDetails, RuleFacets, VitamTenantConfigService, VitamuiFacetComponent } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../../models/archive-search-consts-enum'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts index 69245944ddd..a3bbd230235 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/criteria-search/criteria-search.component.ts @@ -35,19 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { CriteriaSearchCriteria, CriteriaValue, SearchCriteriaValue } from 'vitamui-library'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { + CriteriaSearchCriteria, + CriteriaValue, ORIGIN_WAITING_RECALCULATE, + PipesModule, QueryParamsService, SearchCriteriaTypeEnum, + SearchCriteriaValue, + TooltipDirective, TranslateWithOptionalTypeSuffixPipe, WAITING_RECALCULATE, - TooltipDirective, - PipesModule, } from 'vitamui-library'; -import { NgClass, DatePipe } from '@angular/common'; +import { DatePipe, NgClass } from '@angular/common'; @Component({ selector: 'app-criteria-search', diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts index b6e00ae9fae..29a1b06c214 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/classification-tree/classification-tree.component.ts @@ -37,15 +37,14 @@ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, Input, Output } from '@angular/core'; import { - MatTreeNestedDataSource, + MatNestedTreeNode, MatTree, - MatTreeNodeDef, + MatTreeNestedDataSource, MatTreeNode, - MatNestedTreeNode, + MatTreeNodeDef, MatTreeNodeOutlet, } from '@angular/material/tree'; -import { FilingHoldingSchemeNode } from 'vitamui-library'; -import { nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon, VitamuiTreeNodeComponent } from 'vitamui-library'; +import { FilingHoldingSchemeNode, nodeHasChildren, nodeHasMatch, nodeToVitamuiIcon, VitamuiTreeNodeComponent } from 'vitamui-library'; import { Pair } from '../../../models/utils'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { DecimalPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts index 284f4ddeee9..80e8c9541e5 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -44,8 +44,7 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/collect/src/environments/environment.prod'; import { of } from 'rxjs'; -import { FilingHoldingSchemeNode, StartupService } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { FilingHoldingSchemeNode, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; import { ArchiveCollectService } from '../../../archive-collect.service'; import { FilingHoldingSchemeComponent } from './filing-holding-scheme.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts index 813bb1ba4e9..01702b46f25 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { NestedTreeControl } from '@angular/cdk/tree'; -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { MatTreeNestedDataSource } from '@angular/material/tree'; import { TranslateService } from '@ngx-translate/core'; import { combineLatest, Subscription } from 'rxjs'; @@ -46,13 +46,12 @@ import { FilingHoldingSchemeHandler, FilingHoldingSchemeNode, PagedResult, + ResizeVerticalDirective, ResultFacet, SearchCriteriaEltDto, SearchCriteriaTypeEnum, Unit, UnitType, - ResizeSidebarDirective, - ResizeVerticalDirective, } from 'vitamui-library'; import { isEmpty } from 'underscore'; import { ArchiveCollectService } from '../../../archive-collect.service'; @@ -68,7 +67,7 @@ import { CommonModule } from '@angular/common'; selector: 'app-filing-holding-scheme', templateUrl: './filing-holding-scheme.component.html', styleUrls: ['./filing-holding-scheme.component.scss'], - imports: [ClassificationTreeComponent, LeavesTreeComponent, CommonModule, ResizeSidebarDirective, ResizeVerticalDirective], + imports: [ClassificationTreeComponent, LeavesTreeComponent, CommonModule, ResizeVerticalDirective], }) export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { private translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts index b9ff22a053e..9e6f85a037b 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts @@ -37,12 +37,12 @@ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; import { - MatTreeNestedDataSource, + MatNestedTreeNode, MatTree, + MatTreeNestedDataSource, + MatTreeNode, MatTreeNodeDef, - MatNestedTreeNode, MatTreeNodeOutlet, - MatTreeNode, } from '@angular/material/tree'; import { Subscription } from 'rxjs'; import { @@ -54,9 +54,9 @@ import { nodeToVitamuiIcon, ResultFacet, SearchCriteriaDto, + TooltipDirective, Unit, UnitType, - TooltipDirective, VitamuiTreeNodeComponent, } from 'vitamui-library'; import { ArchiveCollectService } from '../../../../archive-collect.service'; @@ -64,7 +64,7 @@ import { Pair } from '../../../models/utils'; import { ArchiveSharedDataService } from '../../../../../core/archive-shared-data.service'; import { first } from 'rxjs/operators'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { NgClass, DecimalPipe } from '@angular/common'; +import { DecimalPipe, NgClass } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts index 26c9d332b1d..1bb1c6e9b75 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/confirm-action/confirm-action.component.ts @@ -72,24 +72,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; -import { DatePipe, CommonModule } from '@angular/common'; +import { CommonModule, DatePipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; -import { ClosePopupDialogComponent, CommonConfirmDialogComponent, DialogHeaderComponent } from 'vitamui-library'; +import { CommonConfirmDialogComponent } from 'vitamui-library'; import { MatDialogModule } from '@angular/material/dialog'; // FIXME: should be factorized in vitamui-library ConfirmActionComponent @Component({ selector: 'vitamui-confirm-action', templateUrl: './confirm-action.component.html', - imports: [ - DatePipe, - TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - CommonModule, - DialogHeaderComponent, - MatDialogModule, - ], + imports: [DatePipe, TranslatePipe, CommonConfirmDialogComponent, CommonModule, MatDialogModule], }) export class ConfirmActionComponent { // delete or changeTab diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts index d803bc4de6e..2525a77ee25 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts @@ -35,13 +35,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { SearchCriteriaHistory, SnackBarService } from 'vitamui-library'; -import { Direction, TooltipDirective, PipesModule } from 'vitamui-library'; +import { Direction, PipesModule, SearchCriteriaHistory, SnackBarService, TooltipDirective } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { SearchCriteriaSaverService } from '../../services/search-criteria-saver.service'; import { ConfirmActionComponent } from './confirm-action/confirm-action.component'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts index e5ba66fe26d..bed5f556532 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.ts @@ -36,25 +36,25 @@ */ import { DatePipe } from '@angular/common'; -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslatePipe } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { + ChipComponent, ConfirmDialogService, CriteriaSearchCriteria, Direction, + ElementsComponent, + InputComponent, + ORIGIN_WAITING_RECALCULATE, + PipesModule, SearchCriteriaHistory, SearchCriteriaTypeEnum, SnackBarService, - ORIGIN_WAITING_RECALCULATE, - WAITING_RECALCULATE, - ChipComponent, TooltipDirective, - InputComponent, - ElementsComponent, - PipesModule, + WAITING_RECALCULATE, } from 'vitamui-library'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { SearchCriteriaSaverService } from '../../services/search-criteria-saver.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts index da67f0cea0c..49a1b7cb30d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.ts @@ -35,10 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { AbstractControl, FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, inject, OnInit } from '@angular/core'; +import { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { debounceTime, filter, map, share } from 'rxjs/operators'; import { @@ -49,6 +49,8 @@ import { CriteriaDataType, CriteriaOperator, CriteriaValue, + DatepickerComponent, + EditableInputComponent, ItemNode, Option, SchemaElement, @@ -58,33 +60,18 @@ import { SearchCriteriaService, SearchCriteriaTypeEnum, SearchProvider, - VitamuiSelectOptions, - TooltipDirective, SelectComponent, - DatepickerComponent, SelectWithTreeComponent, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, + TooltipDirective, + VitamuiSelectOptions, } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { ManagementRulesSharedDataService } from '../../services/management-rules-shared-data.service'; import { ActivatedRoute, Params } from '@angular/router'; import { ArchiveSearchHelperService } from '../../services/archive-search-helper.service'; -import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; -import { NgTemplateOutlet, AsyncPipe, CommonModule } from '@angular/common'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; +import { AsyncPipe, CommonModule, NgTemplateOutlet } from '@angular/common'; import { MatInputModule } from '@angular/material/input'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { OverlayModule } from '@angular/cdk/overlay'; @@ -125,20 +112,8 @@ const keysList = [ALL_ARCHIVE_UNIT_TYPES, ERRORS]; SelectWithTreeComponent, AsyncPipe, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -146,7 +121,6 @@ const keysList = [ALL_ARCHIVE_UNIT_TYPES, ERRORS]; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class SimpleCriteriaSearchComponent implements OnInit { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index 0a95fdbecf6..fddb8998709 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -42,8 +42,7 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule } from 'vitamui-library'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TitleAndDescriptionCriteriaSearchCollectComponent } from './title-and-description-criteria-search-collect.component'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts index 9fb5945f8b1..4a06273b04c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.ts @@ -39,27 +39,7 @@ import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angul import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { merge } from 'rxjs'; import { debounceTime, filter, map } from 'rxjs/operators'; -import { CriteriaValue } from 'vitamui-library'; -import { - CriteriaDataType, - CriteriaOperator, - diff, - SearchCriteriaTypeEnum, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, -} from 'vitamui-library'; +import { CriteriaDataType, CriteriaOperator, CriteriaValue, diff, EditableInputComponent, SearchCriteriaTypeEnum } from 'vitamui-library'; import { ArchiveSearchConstsEnum } from '../../models/archive-search-consts-enum'; import { ArchiveSharedDataService } from '../../../../core/archive-shared-data.service'; import { TranslatePipe } from '@ngx-translate/core'; @@ -80,20 +60,8 @@ const TITLE_OR_DESCRIPTION = 'TITLE_OR_DESCRIPTION'; FormsModule, ReactiveFormsModule, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -101,7 +69,6 @@ const TITLE_OR_DESCRIPTION = 'TITLE_OR_DESCRIPTION'; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class TitleAndDescriptionCriteriaSearchCollectComponent { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index 92335171228..5b305d5e3b6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -40,8 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, BytesPipe, Transaction, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule, TransactionStatus } from 'vitamui-library'; +import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { UpdateUnitsMetadataComponent } from './update-units-metadata.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DecimalPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts index 39457e465e3..c5fdf6fdbe9 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts @@ -34,23 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnDestroy, TemplateRef, ViewChild } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription, throwError } from 'rxjs'; import { + DialogHeaderComponent, + FileSelectorComponent, Logger, SnackBarService, - Transaction, - VitamErrorDetails, - DialogHeaderComponent, StepperComponent, TooltipDirective, - FileSelectorComponent, + Transaction, + VitamErrorDetails, } from 'vitamui-library'; import { ArchiveCollectService } from '../archive-collect.service'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; @@ -62,7 +61,6 @@ import { TranslatePipe } from '@ngx-translate/core'; DialogHeaderComponent, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, TooltipDirective, MatProgressSpinner, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts index 3347089104a..b7367808796 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts @@ -37,8 +37,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../../environments/environment'; import { ProjectsApiService } from './project-api.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts index bc2629527bf..968249b5c83 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/core.module.ts @@ -37,9 +37,8 @@ import { CommonModule } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { NgModule, inject } from '@angular/core'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { inject, NgModule } from '@angular/core'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts index 496b7cb6c4f..c02dd14ea57 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewChecked, ChangeDetectorRef, Component, OnInit, TemplateRef, ViewChild, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { AfterViewChecked, ChangeDetectorRef, Component, inject, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { FormArray, FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { finalize, forkJoin, Observable, of, throwError } from 'rxjs'; import { last, map, switchMap, tap } from 'rxjs/operators'; import { ProjectsService } from '../projects.service'; @@ -46,24 +46,40 @@ import { ArchiveCollectService } from '../../archive-search-collect/archive-coll import { SipImportTrackingService } from '../../shared/sip-import-tracking.service'; import { HttpEventType, HttpStatusCode } from '@angular/common/http'; import { + AccordionComponent, + CommonProgressBarComponent, + DatepickerComponent, + DialogContentWithStateComponent, + DialogHeaderComponent, ExternalReferentialService, fetchTitle, + FileSelectorComponent, + FilingPlanComponent, FilingPlanMode, FilingPlanService, FlowType, + InputComponent, ItemNode, Logger, MetadataUnitUp, + NextStepComponent, oneIncludedNodeRequired, Option, + PipesModule, + PreviousStepComponent, Project, ProjectStatus, readFileContent, SchemaElement, SchemaService, + SelectComponent, + SelectWithTreeComponent, + SlideToggleComponent, SnackBarService, + StepperComponent, TENANT_SEPARATOR, TenantSelectionService, + TooltipDirective, Transaction, TransactionStatus, Unit, @@ -72,26 +88,9 @@ import { Workflow, ZipFile, ZipFileStatus, - DialogHeaderComponent, - StepperComponent, - NextStepComponent, - SlideToggleComponent, - SelectComponent, - PreviousStepComponent, - InputComponent, - FileSelectorComponent, - AccordionComponent, - TooltipDirective, - SelectWithTreeComponent, - DatepickerComponent, - CommonProgressBarComponent, - DialogContentWithStateComponent, - PipesModule, - FilingPlanComponent, } from 'vitamui-library'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { AsyncPipe, CommonModule } from '@angular/common'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatButtonModule } from '@angular/material/button'; @@ -121,7 +120,6 @@ export const LOCAL_ARCHIVING_SYSTEM_ID = 'local'; ReactiveFormsModule, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, MatButtonToggleGroup, MatButtonToggle, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts index 60026c40d78..f6a3d0e51ca 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts @@ -34,20 +34,20 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Router } from '@angular/router'; import { Subject, Subscription } from 'rxjs'; import { DEFAULT_PAGE_SIZE, Direction, getProjectIcon, + InfiniteScrollDirective, InfiniteScrollTable, + OrderByButtonComponent, PageRequest, + PipesModule, Project, - OrderByButtonComponent, VitamuiMenuButtonComponent, - PipesModule, - InfiniteScrollDirective, } from 'vitamui-library'; import { ProjectsService } from '../projects.service'; import { MatMenuItem } from '@angular/material/menu'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts index 122bb46613c..159908156d9 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnDestroy, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; @@ -43,13 +43,13 @@ import { Direction, PageRequest, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { CreateProjectComponent } from './create-project/create-project.component'; import { ProjectListComponent } from './project-list/project-list.component'; import { ProjectsService } from './projects.service'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { NgClass } from '@angular/common'; import { ProjectPreviewComponent } from './project-preview/project-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index 2269452c42a..c7d77ad9e01 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -46,8 +46,7 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, StartupService, Transaction, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule, TransactionStatus } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, StartupService, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { environment } from '../../../../../../archive-search/src/environments/environment'; import { TransactionResolver } from '../transaction-resolver.service'; import { TransactionsService } from '../transactions.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts index 538df0bf4a0..75bb11e8894 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.ts @@ -34,22 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { BehaviorSubject, filter, finalize, of, switchMap } from 'rxjs'; import { ConfirmDialogComponent, ConfirmDialogData, Direction, + InfiniteScrollDirective, InfiniteScrollTable, + OrderByButtonComponent, SnackBarService, StartupService, Transaction, TransactionStatus, - VitamuiSupHeaderComponent, - OrderByButtonComponent, VitamuiMenuButtonComponent, - InfiniteScrollDirective, + VitamuiSupHeaderComponent, } from 'vitamui-library'; import { TransactionsService } from '../transactions.service'; import { ArchiveCollectService } from '../../archive-search-collect/archive-collect.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts index 08edd9fbdf3..362cdf781a7 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; diff --git a/ui/ui-frontend/projects/collect/src/main.ts b/ui/ui-frontend/projects/collect/src/main.ts index 6d43392c304..09b2920db98 100644 --- a/ui/ui-frontend/projects/collect/src/main.ts +++ b/ui/ui-frontend/projects/collect/src/main.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; -import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; +import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { WINDOW_LOCATION, BytesPipe } from 'vitamui-library'; -import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/collect/core/core.module'; diff --git a/ui/ui-frontend/projects/design-system/src/app/app.component.ts b/ui/ui-frontend/projects/design-system/src/app/app.component.ts index 4c253da62ed..0516e8f517a 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.component.ts @@ -35,16 +35,15 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { Route, Router, Routes, RouterLinkActive, RouterLink, RouterOutlet } from '@angular/router'; -import { VitamuiSelectOptions } from 'vitamui-library'; -import { SelectComponent, SelectLanguageComponent } from 'vitamui-library'; -import { FormBuilder, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Route, Router, RouterLink, RouterLinkActive, RouterOutlet, Routes } from '@angular/router'; +import { SelectComponent, SelectLanguageComponent, VitamuiSelectOptions } from 'vitamui-library'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { RouteData } from './app-routing.module'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { MatList } from '@angular/material/list'; import { MatAccordion, MatExpansionPanel, MatExpansionPanelHeader } from '@angular/material/expansion'; -import { NgTemplateOutlet, CommonModule } from '@angular/common'; +import { CommonModule, NgTemplateOutlet } from '@angular/common'; import { MatSelectModule } from '@angular/material/select'; import { MatMenuModule } from '@angular/material/menu'; import { MatButtonModule } from '@angular/material/button'; diff --git a/ui/ui-frontend/projects/design-system/src/app/app.module.ts b/ui/ui-frontend/projects/design-system/src/app/app.module.ts index 5cea59d0c05..5d6af64dcd1 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.module.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.module.ts @@ -36,38 +36,12 @@ */ import { registerLocaleData } from '@angular/common'; import { default as localeFr } from '@angular/common/locales/fr'; -import { inject, isDevMode, LOCALE_ID, NgModule } from '@angular/core'; -import { MatListModule } from '@angular/material/list'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { BrowserModule, Title } from '@angular/platform-browser'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { of } from 'rxjs'; -import { environment } from '../environments/environment'; -import { AppRoutingModule } from './app-routing.module'; -import { AppComponent } from './app.component'; - -import { ServiceWorkerModule } from '@angular/service-worker'; -import { MatExpansionModule } from '@angular/material/expansion'; -import { ReactiveFormsModule } from '@angular/forms'; -import { - AppConfiguration, - ApplicationApiService, - AuthService, - BASE_URL, - BaseUserInfoApiService, - ENVIRONMENT, - LoggerModule, - provideI18n, - ThemeService, - VitamUICommonModule, - VitamUILibraryModule, -} from 'vitamui-library'; -import { provideNativeDateAdapter } from '@angular/material/core'; -import { TranslatePipe } from '@ngx-translate/core'; +import { inject, NgModule } from '@angular/core'; +import { AppConfiguration, ApplicationApiService, AuthService, ThemeService } from 'vitamui-library'; registerLocaleData(localeFr, 'fr'); -@NgModule(/* TODO(standalone-migration): clean up removed NgModule class manually. +@NgModule(/* TODO(standalone-migration): clean up removed NgModule class manually. { declarations: [AppComponent], imports: [ diff --git a/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts index cbf5c29a09c..cbf04592b24 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/atoms/design-system-information-detail/design-system-information-detail.component.ts @@ -35,8 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; -import { ValidationError } from 'vitamui-library'; -import { InformationDetailComponent } from 'vitamui-library'; +import { InformationDetailComponent, ValidationError } from 'vitamui-library'; @Component({ imports: [InformationDetailComponent], diff --git a/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts index 01f3a6e40f1..a1e5547d849 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/atoms/tooltip/tooltip.component.ts @@ -37,7 +37,7 @@ import { AfterViewInit, Component, QueryList, ViewChildren } from '@angular/core'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { TooltipDirective, InputComponent } from 'vitamui-library'; +import { InputComponent, TooltipDirective } from 'vitamui-library'; import { MatTooltipModule } from '@angular/material/tooltip'; @Component({ diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts index 74cbe7e9569..faeeda53dee 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/datepicker/design-system-datepicker.component.ts @@ -35,8 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { PickerType } from 'vitamui-library'; -import { DatepickerComponent, SelectComponent } from 'vitamui-library'; +import { DatepickerComponent, PickerType, SelectComponent } from 'vitamui-library'; import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { DatePipe, TitleCasePipe } from '@angular/common'; import { MatFormFieldModule } from '@angular/material/form-field'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts index 700243a3029..acbd61d84f5 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/old-input/design-system-old-inputs.component.ts @@ -38,8 +38,7 @@ import { Component, inject, OnInit } from '@angular/core'; import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatSelectModule } from '@angular/material/select'; -import { CountryOption, CountryService, Option } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { CountryOption, CountryService, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { EditableFieldModule } from '../../../../../../../identity/src/app/shared/editable-field/editable-field.module'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts index 100a50dcee2..c8b13f8a367 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/inputs/select-with-tree/design-system-select-with-tree.component.ts @@ -34,10 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, ElementRef, OnInit, QueryList, ViewChildren, inject } from '@angular/core'; +import { AfterViewInit, Component, ElementRef, inject, OnInit, QueryList, ViewChildren } from '@angular/core'; import { AbstractControl, FormControl, FormsModule, ReactiveFormsModule, ValidationErrors, Validators } from '@angular/forms'; -import { ItemNode, MockSchemaService, SchemaElement, SchemaService } from 'vitamui-library'; -import { SelectWithTreeComponent, VitamUICommonModule } from 'vitamui-library'; +import { ItemNode, MockSchemaService, SchemaElement, SchemaService, SelectWithTreeComponent, VitamUICommonModule } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { AsyncPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts index 398de674791..ed39d023ffe 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/organisms/discussion/design-system-discussion.component.ts @@ -38,7 +38,6 @@ import { Component, inject } from '@angular/core'; import { OverlayModule } from '@angular/cdk/overlay'; import { AuthService, - TooltipDirective, DiscussionComponent, DiscussionDto, DiscussionIconComponent, @@ -46,6 +45,7 @@ import { DiscussionPanelComponent, DiscussionService, MessageComponent, + TooltipDirective, } from 'vitamui-library'; import { AsyncPipe } from '@angular/common'; import { Observable } from 'rxjs'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts index d040ff5ddaa..5996cbc35b7 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/organisms/snackbar/snackbar.component.ts @@ -34,9 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { SnackBarService } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { Component, inject, OnInit } from '@angular/core'; +import { SnackBarService, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { FormArray, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; const INFINITE_DURATION = 0; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts index 164eee17fad..6fda1c65a5c 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/tokens/typography/typography.component.ts @@ -36,8 +36,8 @@ */ import { Component } from '@angular/core'; import { TranslatePipe } from '@ngx-translate/core'; -import { TooltipDirective, EllipsisDirective } from 'vitamui-library'; -import { NgClass, NgTemplateOutlet, CommonModule } from '@angular/common'; +import { EllipsisDirective, TooltipDirective } from 'vitamui-library'; +import { CommonModule, NgClass, NgTemplateOutlet } from '@angular/common'; @Component({ templateUrl: './typography.component.html', diff --git a/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts index 34858ec0f66..ae70362dcde 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/translation/translation.component.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Component, inject, OnInit } from '@angular/core'; +import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { InputComponent } from 'vitamui-library'; import { I18nPluralPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts index ac30ddfe46f..3a6d7fd68a7 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/upload/upload.component.ts @@ -36,8 +36,7 @@ */ import { Component } from '@angular/core'; -import { FileValidationErrors } from 'vitamui-library'; -import { readFileContent, VitamUICommonModule } from 'vitamui-library'; +import { FileValidationErrors, readFileContent, VitamUICommonModule } from 'vitamui-library'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @Component({ diff --git a/ui/ui-frontend/projects/design-system/src/main.ts b/ui/ui-frontend/projects/design-system/src/main.ts index 0051de8f764..a3aa2419195 100644 --- a/ui/ui-frontend/projects/design-system/src/main.ts +++ b/ui/ui-frontend/projects/design-system/src/main.ts @@ -35,10 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { enableProdMode, LOCALE_ID } from '@angular/core'; -import { Title, bootstrapApplication } from '@angular/platform-browser'; +import { bootstrapApplication, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { provideI18n, ENVIRONMENT, BASE_URL, BaseUserInfoApiService } from 'vitamui-library'; +import { BASE_URL, BaseUserInfoApiService, ENVIRONMENT, provideI18n } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { of } from 'rxjs'; import { AppComponent } from './app/app.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/app.component.ts b/ui/ui-frontend/projects/identity/src/app/app.component.ts index 1080d3b522e..04d6d570d72 100644 --- a/ui/ui-frontend/projects/identity/src/app/app.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/app.component.ts @@ -36,8 +36,7 @@ */ import { Component, inject } from '@angular/core'; import { Title } from '@angular/platform-browser'; -import { StartupService } from 'vitamui-library'; -import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { FooterComponent, HeaderModule, StartupService, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library'; import { RouterOutlet } from '@angular/router'; @Component({ diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts index 8217f5913dc..1152ae3c22b 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { CustomerApiService } from './customer-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/core/core.module.ts b/ui/ui-frontend/projects/identity/src/app/core/core.module.ts index c72a53b8d6f..c6ae114a23c 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/core.module.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { NgModule, inject } from '@angular/core'; +import { inject, NgModule } from '@angular/core'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts index 8233bd19593..eb847a2cf0c 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Customer, ENVIRONMENT } from 'vitamui-library'; -import { LoggerModule, Operators, OtpState, SnackBarService } from 'vitamui-library'; +import { BASE_URL, CriteriaSearchQuery, Customer, ENVIRONMENT, LoggerModule, Operators, OtpState, SnackBarService } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts index 3d00d39787f..7dfefadadee 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.ts @@ -36,11 +36,10 @@ */ import { Observable, Subject, zip } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Customer, Logo, ThemeService, SnackBarService } from 'vitamui-library'; -import { Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Customer, Logo, Operators, SnackBarService, ThemeService } from 'vitamui-library'; import { HttpResponse } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; import { AttachmentType } from '../customer/attachment.enum'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts index 4e43a99c9a0..aefdd7960f4 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-alerting/customer-alerting.component.ts @@ -35,14 +35,13 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-customer-alerting', templateUrl: './customer-alerting.component.html', styleUrls: ['./customer-alerting.component.scss'], - imports: [CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, TranslatePipe], + imports: [MatDialogContent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class CustomerAlertingComponent {} diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts index 1c9d8d4a442..77a3ca1f786 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/customer-colors-input.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit, inject } from '@angular/core'; -import { FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { Color, Option, ThemeColorType } from 'vitamui-library'; -import { ThemeService, SelectComponent } from 'vitamui-library'; +import { Component, inject, Input, OnInit } from '@angular/core'; +import { FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Color, Option, SelectComponent, ThemeColorType, ThemeService } from 'vitamui-library'; import { Subscription } from 'rxjs'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { InputColorComponent } from './input-color/input-color.component'; @Component({ diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts index 232d6cba489..5683a3455a5 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-colors-input/input-color/input-color.component.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnInit, ViewChild } from '@angular/core'; -import { AbstractControl, FormControl, ValidationErrors, ValidatorFn, ReactiveFormsModule } from '@angular/forms'; +import { AbstractControl, FormControl, ReactiveFormsModule, ValidationErrors, ValidatorFn } from '@angular/forms'; import { ColorPickerDirective } from 'ngx-color-picker'; -import { FormControlWarn } from 'vitamui-library'; -import { hexToRgb, rgbToHsl, InputComponent, PipesModule } from 'vitamui-library'; +import { FormControlWarn, hexToRgb, InputComponent, PipesModule, rgbToHsl } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index 57b978d91aa..8a0aa5d4d1a 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -47,8 +47,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService, CountryService, StartupService, WINDOW_LOCATION } from 'vitamui-library'; -import { LoggerModule, OtpState } from 'vitamui-library'; +import { BASE_URL, ConfirmDialogService, CountryService, LoggerModule, OtpState, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { CustomerService } from '../../core/customer.service'; import { OwnerFormValidators } from '../owner-form/owner-form.validators'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts index fd2d9f50399..94c48f225de 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.ts @@ -35,9 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { ComponentType } from '@angular/cdk/portal'; -import { Component, OnDestroy, OnInit, TemplateRef, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit, TemplateRef } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { finalize, merge, Observable, Subscription } from 'rxjs'; import { filter, tap } from 'rxjs/operators'; import { @@ -45,18 +45,18 @@ import { CountryOption, CountryService, Customer, + DialogHeaderComponent, + InputComponent, Logo, + NextStepComponent, Option, OtpState, - StartupService, - VitamuiSelectOptions, - DialogHeaderComponent, - StepperComponent, - InputComponent, + PreviousStepComponent, SelectComponent, SlideToggleComponent, - NextStepComponent, - PreviousStepComponent, + StartupService, + StepperComponent, + VitamuiSelectOptions, } from 'vitamui-library'; import { CustomerService } from '../../core/customer.service'; import { TenantFormValidators } from '../tenant-create/tenant-form.validators'; @@ -64,9 +64,8 @@ import { CustomerAlertingComponent } from './customer-alerting/customer-alerting import { ALPHA_NUMERIC_REGEX, CUSTOMER_CODE_MAX_LENGTH, CustomerCreateValidators } from './customer-create.validators'; import { TenantService } from '../tenant.service'; import { CdkStep, CdkStepperNext } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { NgTemplateOutlet } from '@angular/common'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { DomainsInputComponent } from '../../shared/domains-input/domains-input.component'; import { GraphicIdentityComponent } from '../customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component'; import { HomepageMessageComponent } from '../customer-preview/homepage-message-tab/homepage-message/homepage-message.component'; @@ -82,7 +81,6 @@ import { TranslatePipe } from '@ngx-translate/core'; ReactiveFormsModule, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, InputComponent, SelectComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts index 4060b5aefd5..3128a2026ae 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts @@ -44,8 +44,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of, Subject } from 'rxjs'; -import { Customer, Owner, Tenant } from 'vitamui-library'; -import { OtpState } from 'vitamui-library'; +import { Customer, OtpState, Owner, Tenant } from 'vitamui-library'; import { InfiniteScrollStubDirective, VitamUICommonTestModule } from 'vitamui-library/testing'; import { CustomerService } from '../../core/customer.service'; import { CustomerDataService } from '../customer.data.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts index 15248a9ef28..d78b8ada49a 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.ts @@ -34,24 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, OnDestroy, OnInit, Output } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { + CollapseDirective, Customer, DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, Owner, PageRequest, Tenant, - CollapseContainerDirective, - CollapseDirective, - CollapseTriggerForDirective, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; import { CustomerService } from '../../core/customer.service'; import { CustomerDataService } from '../customer.data.service'; @@ -71,9 +69,7 @@ import { CommonModule } from '@angular/common'; OwnerListComponent, MatProgressSpinner, TranslatePipe, - CollapseContainerDirective, CollapseDirective, - CollapseTriggerForDirective, CommonModule, EllipsisDirective, InfiniteScrollDirective, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts index ae1e0f78239..2b2a391246e 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts @@ -37,8 +37,7 @@ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, Customer, ENVIRONMENT } from 'vitamui-library'; -import { Direction, LoggerModule, OtpState, PageRequest } from 'vitamui-library'; +import { BASE_URL, Customer, Direction, ENVIRONMENT, LoggerModule, OtpState, PageRequest } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { CustomerListService } from './customer-list.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts index 3bd679292c4..ff0f20c0d1a 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; -import { Customer, DEFAULT_PAGE_SIZE, Owner, PaginatedResponse, SearchService } from 'vitamui-library'; -import { Direction, PageRequest } from 'vitamui-library'; +import { Customer, DEFAULT_PAGE_SIZE, Direction, Owner, PageRequest, PaginatedResponse, SearchService } from 'vitamui-library'; import { CustomerApiService } from '../../core/api/customer-api.service'; @Injectable({ diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts index 92b705ccb08..6eb43d63dc8 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/owner-list/owner-list.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; -import { Customer, Owner, Tenant } from 'vitamui-library'; -import { EllipsisDirective, TooltipDirective } from 'vitamui-library'; +import { Customer, EllipsisDirective, Owner, Tenant, TooltipDirective } from 'vitamui-library'; import { CustomerDataService } from '../../customer.data.service'; import { OwnerCreateComponent } from '../../owner-create/owner-create.component'; import { OwnerService } from '../../owner.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts index 5318c6a6f09..0b694617074 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts @@ -35,15 +35,15 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, Input, NO_ERRORS_SCHEMA, ViewChild, NgModule } from '@angular/core'; +import { Component, Input, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MatMenuModule } from '@angular/material/menu'; import { MatTabsModule } from '@angular/material/tabs'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Subject } from 'rxjs'; -import { ENVIRONMENT, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import type { Customer } from 'vitamui-library'; +import { ENVIRONMENT, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { CustomerService } from '../../core/customer.service'; import { environment } from './../../../environments/environment'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts index d266035b07c..b490924877b 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.ts @@ -34,13 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Subscription } from 'rxjs'; import type { Customer } from 'vitamui-library'; -import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { CustomerService } from '../../core/customer.service'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; import { SsoTabComponent } from './sso-tab/sso-tab.component'; import { GraphicIdentityTabComponent } from './graphic-identity-tab/graphic-identity-tab.component'; @@ -64,10 +64,8 @@ import { CommonModule } from '@angular/common'; OperationHistoryTabComponent, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts index bd30831e67f..82e8781c192 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-tab.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { Customer, Theme, ThemeColorType, ThemeService } from 'vitamui-library'; -import { PipesModule } from 'vitamui-library'; +import { Customer, PipesModule, Theme, ThemeColorType, ThemeService } from 'vitamui-library'; import { CustomerService } from '../../../core/customer.service'; import { GraphicIdentityUpdateComponent } from './graphic-identity-update/graphic-identity-update.component'; import { LogosSafeResourceUrl } from './logos-safe-resource-url.interface'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts index fc05ec85a79..89e1d089867 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts @@ -39,8 +39,7 @@ import { Component, forwardRef, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { BASE_URL, Customer, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule, OtpState, SnackBarService } from 'vitamui-library'; +import { BASE_URL, Customer, ENVIRONMENT, InjectorModule, LoggerModule, OtpState, SnackBarService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../../../environments/environment'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts index d8687b3cf84..6e1cd09e2b8 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogRef } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { Customer, Logo } from 'vitamui-library'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts index a43de42d836..c199e5743cf 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity-form/graphic-identity-form.component.ts @@ -34,10 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; import { FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { AttachmentType, Logo, ThemeService } from 'vitamui-library'; -import { VitamuiDragDropFileComponent } from 'vitamui-library'; +import { AttachmentType, Logo, ThemeService, VitamuiDragDropFileComponent } from 'vitamui-library'; import { CustomerColorsInputComponent } from '../../../../customer-create/customer-colors-input/customer-colors-input.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts index adeeaaa4fa2..6666df310c3 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity/graphic-identity.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, ValidatorFn, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, ValidatorFn, Validators } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; import { Subject } from 'rxjs'; -import { Customer, Logo, Theme, ThemeService } from 'vitamui-library'; -import { ThemeColorType, SlideToggleComponent } from 'vitamui-library'; +import { Customer, Logo, SlideToggleComponent, Theme, ThemeColorType, ThemeService } from 'vitamui-library'; import type { LogosSafeResourceUrl } from './../logos-safe-resource-url.interface'; import { GraphicIdentityFormComponent } from './graphic-identity-form/graphic-identity-form.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts index 83fdc634ea0..4d7f9d0b3ef 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-tab.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { Customer, StartupService } from 'vitamui-library'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts index fc90372e7bd..1acaf6e8998 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message-update/homepage-message-update.component.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, inject } from '@angular/core'; +import { Component, inject, OnDestroy } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogRef } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ConfirmDialogService, Customer } from 'vitamui-library'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts index 159516efa76..9fc2aadc134 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message-translation/homepage-message-translation.ts @@ -37,8 +37,7 @@ import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; -import { Option } from 'vitamui-library'; -import { SelectComponent, InputComponent } from 'vitamui-library'; +import { InputComponent, Option, SelectComponent } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts index a9b0261aee9..563bc2361d3 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/homepage-message-tab/homepage-message/homepage-message.component.ts @@ -34,14 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MatDialogRef, MatDialogContent } from '@angular/material/dialog'; +import { AfterViewInit, Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { take, takeUntil } from 'rxjs/operators'; -import { Customer, Option, LanguageService, StartupService } from 'vitamui-library'; -import { DialogHeaderComponent, InputComponent } from 'vitamui-library'; -import { CdkScrollable } from '@angular/cdk/scrolling'; +import { Customer, DialogHeaderComponent, InputComponent, LanguageService, Option, StartupService } from 'vitamui-library'; import { HomepageMessageTranslationComponent } from './homepage-message-translation/homepage-message-translation'; import { TranslatePipe } from '@ngx-translate/core'; @@ -51,7 +49,6 @@ import { TranslatePipe } from '@ngx-translate/core'; styleUrls: ['./homepage-message.component.scss'], imports: [ DialogHeaderComponent, - CdkScrollable, MatDialogContent, ReactiveFormsModule, InputComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts index 2eb2d104515..8f16e03bd8a 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/information-tab/information-tab.component.ts @@ -34,32 +34,26 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { merge, of, Subscription } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { CountryOption, Customer, OtpState, CountryService, Option, StartupService } from 'vitamui-library'; import { - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, + CountryOption, + CountryService, + Customer, + diff, EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, - diff, - VitamUIFieldErrorComponent, FormFieldValueWrapperComponent, + Option, + OtpState, SelectComponent, SlideToggleComponent, + StartupService, + VitamUIFieldErrorComponent, } from 'vitamui-library'; import { CustomerService } from '../../../core/customer.service'; @@ -89,21 +83,11 @@ const UPDATE_DEBOUNCE_TIME = 200; EditableDomainInputComponent, SlideToggleComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -111,7 +95,6 @@ const UPDATE_DEBOUNCE_TIME = 200; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class InformationTabComponent implements OnInit, OnDestroy { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts index c7e2e0e99dc..9a72003fda4 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts @@ -43,8 +43,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelect, MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of, throwError as observableThrowError } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { AuthnRequestBindingEnum, newFile } from 'vitamui-library'; +import { AuthnRequestBindingEnum, ConfirmDialogService, newFile } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { IdentityProviderService } from '../identity-provider.service'; import { IdentityProviderCreateComponent } from './identity-provider-create.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts index 74387000e70..f48d15af790 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.ts @@ -34,29 +34,28 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { AuthnRequestBindingEnum, ConfirmDialogService, Customer, - IdentityProvider, DialogHeaderComponent, - StepperComponent, - SlideToggleComponent, + IdentityProvider, InputComponent, - PatternComponent, NextStepComponent, + PatternComponent, PreviousStepComponent, SelectComponent, + SlideToggleComponent, + StepperComponent, } from 'vitamui-library'; import { IdentityProviderService } from '../identity-provider.service'; import JWS_ALGORITHMS, { ProtocoleType } from '../sso-tab-const'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { CustomParamsComponent } from '../../../../shared/custom-params/custom-params.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -69,7 +68,6 @@ import { TranslatePipe } from '@ngx-translate/core'; ReactiveFormsModule, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, SlideToggleComponent, MatButtonToggleGroup, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts index d5aaf6a8bf2..38b19a5c588 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-details/identity-provider-details.component.ts @@ -34,34 +34,25 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { merge } from 'rxjs'; import { debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty, isEqual, isObject, mapObject, omit } from 'underscore'; -import { IdentityProvider, SnackBarService } from 'vitamui-library'; import { - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, + AuthnRequestBindingEnum, EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, - AuthnRequestBindingEnum, + FormFieldValueWrapperComponent, + IdentityProvider, newFile, + SelectComponent, SlideToggleComponent, + SnackBarService, VitamUIFieldErrorComponent, - FormFieldValueWrapperComponent, - SelectComponent, } from 'vitamui-library'; import { IdentityProviderService } from '../identity-provider.service'; import JWS_ALGORITHMS, { ProtocoleType } from '../sso-tab-const'; @@ -94,21 +85,12 @@ const UPDATE_DEBOUNCE_TIME = 200; FormFieldValueWrapperComponent, SelectComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -116,7 +98,6 @@ const UPDATE_DEBOUNCE_TIME = 200; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class IdentityProviderDetailsComponent { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts index 4d6517101c2..bea283967c8 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.ts @@ -36,11 +36,10 @@ */ import { Observable, Subject } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { Criterion, CriteriaSearchQuery, IdentityProvider, SnackBarService } from 'vitamui-library'; -import { Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, IdentityProvider, Operators, SnackBarService } from 'vitamui-library'; import { HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { ProviderApiService } from './provider-api.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts index e739301bab4..4c1367f446a 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/sso-tab.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts index 505fb025932..c56792b1a22 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-resolver.service.spec.ts @@ -38,8 +38,7 @@ import { inject, TestBed } from '@angular/core/testing'; import { ActivatedRouteSnapshot, Router } from '@angular/router'; import { of } from 'rxjs'; -import { Customer } from 'vitamui-library'; -import { OtpState } from 'vitamui-library'; +import { Customer, OtpState } from 'vitamui-library'; import { CustomerService } from '../core/customer.service'; import { CustomerResolver } from './customer-resolver.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts index 3caa58801a4..dcf2ef30d0e 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts @@ -37,8 +37,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { EMPTY, of } from 'rxjs'; -import { ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { MatDialog } from '@angular/material/dialog'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts index 4fc34008c05..6bf3152f208 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; @@ -44,13 +44,13 @@ import { Owner, SidenavPage, Tenant, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { CustomerService } from '../core/customer.service'; import { CustomerCreateComponent } from './customer-create/customer-create.component'; import { CustomerListComponent } from './customer-list/customer-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { CustomerPreviewComponent } from './customer-preview/customer-preview.component'; import { OwnerPreviewComponent } from './owner-preview/owner-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts index 98a618f0b84..cdf74c84df9 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.ts @@ -34,27 +34,26 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { concatMap, finalize, Observable, Subscription } from 'rxjs'; import { ConfirmDialogService, Customer, - Owner, - Tenant, DialogHeaderComponent, - StepperComponent, InputComponent, - SelectComponent, + Owner, PreviousStepComponent, + SelectComponent, + StepperComponent, + Tenant, } from 'vitamui-library'; import { OwnerService } from '../owner.service'; import { TenantFormValidators } from '../tenant-create/tenant-form.validators'; import { TenantService } from '../tenant.service'; import { map, tap } from 'rxjs/operators'; import { CdkStep, CdkStepperNext } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { OwnerFormComponent } from '../owner-form/owner-form.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -67,7 +66,6 @@ import { TranslatePipe } from '@ngx-translate/core'; StepperComponent, CdkStep, ReactiveFormsModule, - CdkScrollable, MatDialogContent, OwnerFormComponent, MatDialogActions, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts index 3dd8784bcf2..8dea5d25e29 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-form/owner-form.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, forwardRef, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, forwardRef, inject, Input, OnDestroy, OnInit } from '@angular/core'; +import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms'; import { merge } from 'rxjs'; import { distinctUntilChanged, map } from 'rxjs/operators'; -import { CountryOption, Customer, Owner, CountryService, Option, StartupService } from 'vitamui-library'; -import { InputComponent, SelectComponent } from 'vitamui-library'; +import { CountryOption, CountryService, Customer, InputComponent, Option, Owner, SelectComponent, StartupService } from 'vitamui-library'; import { ALPHA_NUMERIC_REGEX, OWNER_CITY_MAX_LENGTH, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts index 1125a2a382b..b629f8ad24c 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/information-tab/information-tab.component.ts @@ -34,31 +34,23 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input, OnChanges, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { merge, of } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { CountryOption, Owner, Tenant, CountryService, Option, StartupService } from 'vitamui-library'; import { - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, + CountryOption, + CountryService, diff, - VitamUIFieldErrorComponent, + EditableInputComponent, FormFieldValueWrapperComponent, + Option, + Owner, SelectComponent, + StartupService, + Tenant, + VitamUIFieldErrorComponent, } from 'vitamui-library'; import { ALPHA_NUMERIC_REGEX, OWNER_CODE_MAX_LENGTH, OwnerFormValidators } from '../../owner-form/owner-form.validators'; @@ -89,21 +81,9 @@ const UPDATE_DEBOUNCE_TIME = 200; SelectComponent, MatDivider, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -111,7 +91,6 @@ const UPDATE_DEBOUNCE_TIME = 200; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class InformationTabComponent implements OnChanges, OnInit { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts index faa14347668..3dd911175b1 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts @@ -35,8 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { AuthService, HistoryEvent, LogbookService } from 'vitamui-library'; -import { HistoryEventsComponent, CollapseComponent } from 'vitamui-library'; +import { AuthService, LogbookService, HistoryEventsComponent, CollapseComponent } from 'vitamui-library'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 316fb998770..58f182a05d6 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -40,11 +40,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatMenuModule } from '@angular/material/menu'; import { MatTabsModule } from '@angular/material/tabs'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateService } from '@ngx-translate/core'; -import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ENVIRONMENT, SnackBarService, WINDOW_LOCATION } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { EMPTY } from 'rxjs'; +import { BASE_URL, ENVIRONMENT, LoggerModule, SnackBarService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../environments/environment'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts index bea8a512c7f..0be82c51c49 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import type { Owner, Tenant } from 'vitamui-library'; -import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { MatTabGroup, MatTab } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; import { OwnerOperationHistoryTabComponent } from './owner-operation-history-tab/owner-operation-history-tab.component'; @@ -57,10 +57,8 @@ import { CommonModule } from '@angular/common'; OwnerOperationHistoryTabComponent, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index 536830613e1..8953e7afdba 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -39,8 +39,7 @@ import { inject, TestBed } from '@angular/core/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Type } from '@angular/core'; -import { BASE_URL, Owner } from 'vitamui-library'; -import { SnackBarService } from 'vitamui-library'; +import { BASE_URL, Owner, SnackBarService } from 'vitamui-library'; import { OwnerService } from './owner.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts index 7721ab1fe71..27930f954d3 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.ts @@ -36,10 +36,9 @@ */ import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Owner, SnackBarService } from 'vitamui-library'; -import { Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Operators, Owner, SnackBarService } from 'vitamui-library'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { OwnerApiService } from './owner-api.service'; @Injectable({ diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts index 7af9c844422..7e11a2c02fe 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.ts @@ -34,33 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { ConfirmDialogService, Owner, Tenant } from 'vitamui-library'; -import { DialogHeaderComponent, InputComponent, SelectComponent } from 'vitamui-library'; +import { ConfirmDialogService, DialogHeaderComponent, InputComponent, Owner, SelectComponent, Tenant } from 'vitamui-library'; -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { finalize, Subscription } from 'rxjs'; import { TenantService } from '../tenant.service'; import { TenantFormValidators } from './tenant-form.validators'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-tenant-create', templateUrl: './tenant-create.component.html', styleUrls: ['./tenant-create.component.scss'], - imports: [ - DialogHeaderComponent, - ReactiveFormsModule, - CdkScrollable, - MatDialogContent, - InputComponent, - SelectComponent, - MatDialogActions, - TranslatePipe, - ], + imports: [DialogHeaderComponent, ReactiveFormsModule, MatDialogContent, InputComponent, SelectComponent, MatDialogActions, TranslatePipe], }) export class TenantCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts index ac92db40bd9..d6f25f34f88 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Owner, Tenant } from 'vitamui-library'; -import { Operators, SnackBarService } from 'vitamui-library'; +import { BASE_URL, CriteriaSearchQuery, Operators, Owner, SnackBarService, Tenant } from 'vitamui-library'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts index 250053ed2b0..bf0e2a493e3 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.ts @@ -36,11 +36,10 @@ */ import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Tenant, SnackBarService } from 'vitamui-library'; -import { Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Operators, SnackBarService, Tenant } from 'vitamui-library'; import { HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { TenantApiService } from './tenant-api.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts index 9ae3ef43adf..16d4b4cb952 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts @@ -44,13 +44,12 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { CollapseComponent } from 'vitamui-library'; +import { CollapseComponent, ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileValidators } from '../external-param-profile.validators'; import { ExternalParamProfileCreateComponent } from './external-param-profile-create.component'; -import { DecimalPipe, CommonModule } from '@angular/common'; +import { CommonModule, DecimalPipe } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ExternalParamProfileCreateComponent', () => { diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts index f5ba067b970..4082e044b64 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.ts @@ -34,30 +34,29 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Observable, Subscription } from 'rxjs'; import { ConfirmDialogService, - ExternalParamProfile, - Option, DialogHeaderComponent, - StepperComponent, - SlideToggleComponent, + ExternalParamProfile, InputComponent, - SelectComponent, NextStepComponent, - TooltipDirective, + Option, PreviousStepComponent, + SelectComponent, + SlideToggleComponent, + StepperComponent, + TooltipDirective, } from 'vitamui-library'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileValidators } from '../external-param-profile.validators'; import { map } from 'rxjs/operators'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { DecimalPipe, AsyncPipe } from '@angular/common'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { AsyncPipe, DecimalPipe } from '@angular/common'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; @Component({ selector: 'app-external-param-profile-create', @@ -68,7 +67,6 @@ import { CdkScrollable } from '@angular/cdk/scrolling'; ReactiveFormsModule, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, SlideToggleComponent, InputComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index 77ca0e589ae..262d2c9b080 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -42,8 +42,7 @@ import { MatTabsModule } from '@angular/material/tabs'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of, Subject } from 'rxjs'; -import { AuthService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { TestHostComponent } from '../../shared/domains-input/domains-input.component.spec'; import { ExternalParamProfileService } from '../external-param-profile.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts index 8af770306ef..f179c6c9fd8 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Subscription } from 'rxjs'; -import { ExternalParamProfile } from 'vitamui-library'; -import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { ExternalParamProfile, OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { SharedService } from '../shared.service'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; import { ThresholdsTabComponent } from './thresholds-tab/thresholds-tab.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -60,10 +59,8 @@ import { ReactiveFormsModule } from '@angular/forms'; OperationHistoryTabComponent, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts index 36194d44958..798193e3e44 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/information-tab/information-tab.component.ts @@ -34,34 +34,21 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { of, skip, Subscription } from 'rxjs'; import { catchError, distinctUntilChanged, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEqual } from 'underscore'; -import { ExternalParamProfile } from 'vitamui-library'; import { - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, + ExternalParamProfile, + SelectComponent, SlideToggleComponent, VitamUIFieldErrorComponent, - SelectComponent, } from 'vitamui-library'; import { ExternalParamProfileService } from '../../external-param-profile.service'; import { ExternalParamProfileValidators } from '../../external-param-profile.validators'; -import { NgStyle, CommonModule } from '@angular/common'; +import { CommonModule, NgStyle } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; import { MatDialogModule } from '@angular/material/dialog'; import { MatInputModule } from '@angular/material/input'; @@ -82,21 +69,9 @@ import { MatFormFieldModule } from '@angular/material/form-field'; VitamUIFieldErrorComponent, SelectComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -104,7 +79,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class InformationTabComponent implements OnDestroy, OnInit, OnChanges { diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts index 2e12c2610c5..6d05ab8fb34 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/thresholds-tab/thresholds-tab.component.ts @@ -34,14 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; +import { Component, inject, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; import { extend, isEmpty } from 'underscore'; -import { ExternalParamProfile, Option } from 'vitamui-library'; -import { diff, SlideToggleComponent, SelectComponent, TooltipDirective } from 'vitamui-library'; +import { diff, ExternalParamProfile, Option, SelectComponent, SlideToggleComponent, TooltipDirective } from 'vitamui-library'; import { ExternalParamProfileService } from '../../external-param-profile.service'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { DecimalPipe } from '@angular/common'; @Component({ diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts index 8237178d6f3..cfe14d0dc67 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts @@ -38,7 +38,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; -import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of, Subject } from 'rxjs'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts index f1bdd265651..7baed545c48 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Subject, Subscription } from 'rxjs'; import { debounceTime, startWith } from 'rxjs/operators'; import { @@ -43,16 +43,16 @@ import { DEFAULT_PAGE_SIZE, Direction, ExternalParamProfile, + InfiniteScrollDirective, InfiniteScrollTable, PageRequest, - Profile, PipesModule, - InfiniteScrollDirective, + Profile, } from 'vitamui-library'; import { ProfileService } from '../../profile/profile.service'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { SharedService } from '../shared.service'; -import { NgClass, DecimalPipe, CommonModule } from '@angular/common'; +import { CommonModule, DecimalPipe, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts index 30abd66d07f..94a42e3aebc 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL } from 'vitamui-library'; -import { LoggerModule, SnackBarService } from 'vitamui-library'; +import { BASE_URL, LoggerModule, SnackBarService } from 'vitamui-library'; import { ExternalParamProfileService } from './external-param-profile.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts index 2663b52fb04..b877290c8d2 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts @@ -34,19 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { ExternalParamProfile, GlobalEventService, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ExternalParamProfileCreateComponent } from './external-param-profile-create/external-param-profile-create.component'; import { ExternalParamProfileListComponent } from './external-param-profile-list/external-param-profile-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ExternalParamProfileDetailComponent } from './external-param-profile-detail/external-param-profile-detail.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts index c4553149926..e62e721d761 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.module.ts @@ -36,7 +36,7 @@ */ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatMenuModule } from '@angular/material/menu'; import { MatProgressBarModule } from '@angular/material/progress-bar'; @@ -45,12 +45,12 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; import { - VitamUICommonModule, - VitamUILibraryModule, + LevelInputComponent, RoleComponent, RoleToggleComponent, SlideToggleComponent, - LevelInputComponent, + VitamUICommonModule, + VitamUILibraryModule, } from 'vitamui-library'; import { ExternalParamProfileCreateComponent } from './external-param-profile-create/external-param-profile-create.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts index d3a6e17f5de..7f012794de9 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts @@ -71,13 +71,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { EMPTY, of } from 'rxjs'; -import { AuthService, ConfirmDialogService, Group, ProfileService } from 'vitamui-library'; -import { LevelInputComponent } from 'vitamui-library'; +import { AuthService, ConfirmDialogService, Group, LevelInputComponent, ProfileService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { Component, forwardRef, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts index 348d0b4a1af..0b3fbf9e534 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.ts @@ -34,28 +34,27 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { AuthService, buildValidators, ConfirmDialogService, - MiscValidators, DialogHeaderComponent, - StepperComponent, - SlideToggleComponent, InputComponent, + LevelInputComponent, + MiscValidators, NextStepComponent, PreviousStepComponent, - LevelInputComponent, + SlideToggleComponent, + StepperComponent, } from 'vitamui-library'; import { GroupService } from '../group.service'; import { GroupValidators } from '../group.validators'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { ProfilesFormComponent } from '../../shared/profiles-form/profiles-form.component'; import { UnitsFormComponent } from '../units-form/units-form.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -70,7 +69,6 @@ import { CommonModule } from '@angular/common'; ReactiveFormsModule, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, SlideToggleComponent, InputComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts index f5a0dc4e445..636e667c75d 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-criteria-builder.util.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { CriteriaSearchQuery, Criterion } from 'vitamui-library'; -import { buildCriteriaFromFilters, Operators } from 'vitamui-library'; +import { buildCriteriaFromFilters, CriteriaSearchQuery, Criterion, Operators } from 'vitamui-library'; const GROUP_FILTER_CONVERTER: Readonly<{ [key: string]: (values: any[]) => Array }> = { status: (statusList: string[]): Criterion[] => { diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts index 211f2f30012..f329d8b2e33 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts @@ -43,8 +43,7 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of, Subject } from 'rxjs'; -import { Group } from 'vitamui-library'; -import { OrderByButtonComponent } from 'vitamui-library'; +import { Group, OrderByButtonComponent } from 'vitamui-library'; import { InfiniteScrollStubDirective, VitamUICommonTestModule } from 'vitamui-library/testing'; import { GroupService } from '../group.service'; import { GroupListComponent } from './group-list.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts index 0422924f5cd..f3ac4689840 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, LOCALE_ID, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, LOCALE_ID, OnDestroy, OnInit, Output } from '@angular/core'; import { merge, Subject, Subscription } from 'rxjs'; import { @@ -42,21 +42,21 @@ import { CriteriaSearchQuery, DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, Group, + InfiniteScrollDirective, InfiniteScrollTable, + OrderByButtonComponent, PageRequest, - TableFilterDirective, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - OrderByButtonComponent, TableFilterSearchComponent, - PipesModule, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; import { GroupService } from '../group.service'; import { buildCriteriaFromGroupFilters } from './group-criteria-builder.util'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts index 75a49047121..55fd9d8917f 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts @@ -34,20 +34,18 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; import { Subscription } from 'rxjs'; import type { Group } from 'vitamui-library'; import { AuthService, - CommonTooltipComponent, - TooltipDirective, - VitamuiSidenavHeaderComponent, isLevelAllowed, OperationHistoryTabComponent, + VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { GroupService } from '../group.service'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; import { ProfilesTabComponent } from './profiles-tab/profiles-tab.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -67,10 +65,8 @@ import { CommonModule } from '@angular/common'; OperationHistoryTabComponent, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts index ad8fd330938..84953e09671 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/information-tab.component.ts @@ -34,31 +34,21 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { merge, of, Subscription } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Group, AuthService } from 'vitamui-library'; import { - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, + AuthService, + buildValidators, + diff, EditableInputComponent, EditableLevelInputComponent, EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, - buildValidators, - diff, + Group, SlideToggleComponent, TooltipDirective, VitamUIFieldErrorComponent, @@ -88,21 +78,11 @@ const DEBOUNCE_TIME = 200; TooltipDirective, VitamUIFieldErrorComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, EditableLevelInputComponent, EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -110,7 +90,6 @@ const DEBOUNCE_TIME = 200; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class InformationTabComponent implements OnDestroy, OnChanges { diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts index bb94d4412b1..3845a5ecc96 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.ts @@ -37,15 +37,13 @@ import { Subscription } from 'rxjs'; import { take } from 'rxjs/operators'; -import { ConfirmDialogService, Group } from 'vitamui-library'; -import { DialogHeaderComponent } from 'vitamui-library'; +import { ConfirmDialogService, DialogHeaderComponent, Group } from 'vitamui-library'; -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { GroupService } from '../../../group.service'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { UnitsFormComponent } from '../../../units-form/units-form.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -53,15 +51,7 @@ import { TranslatePipe } from '@ngx-translate/core'; selector: 'app-units-edit', templateUrl: './units-edit.component.html', styleUrls: ['./units-edit.component.css'], - imports: [ - DialogHeaderComponent, - CdkScrollable, - MatDialogContent, - ReactiveFormsModule, - UnitsFormComponent, - MatDialogActions, - TranslatePipe, - ], + imports: [DialogHeaderComponent, MatDialogContent, ReactiveFormsModule, UnitsFormComponent, MatDialogActions, TranslatePipe], }) export class UnitsEditComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts index 971f037bdaa..b180742bb54 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.ts @@ -34,14 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService, Group } from 'vitamui-library'; -import { DialogHeaderComponent } from 'vitamui-library'; +import { ConfirmDialogService, DialogHeaderComponent, Group } from 'vitamui-library'; import { GroupService } from '../../../group.service'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { ProfilesFormComponent } from '../../../../shared/profiles-form/profiles-form.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -49,15 +47,7 @@ import { TranslatePipe } from '@ngx-translate/core'; selector: 'app-profiles-edit', templateUrl: './profiles-edit.component.html', styleUrls: ['./profiles-edit.component.scss'], - imports: [ - DialogHeaderComponent, - ReactiveFormsModule, - CdkScrollable, - MatDialogContent, - ProfilesFormComponent, - MatDialogActions, - TranslatePipe, - ], + imports: [DialogHeaderComponent, ReactiveFormsModule, MatDialogContent, ProfilesFormComponent, MatDialogActions, TranslatePipe], }) export class ProfilesEditComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts index a971bfe6367..ceeb33e2402 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-tab.component.ts @@ -34,11 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { Group, Profile } from 'vitamui-library'; -import { TooltipDirective } from 'vitamui-library'; +import { Group, Profile, TooltipDirective } from 'vitamui-library'; import { GroupService } from '../../group.service'; import { ProfilesEditComponent } from './profiles-edit/profiles-edit.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts index 18280d52dd9..6260a0cf77e 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts @@ -38,8 +38,7 @@ import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { EMPTY, of } from 'rxjs'; -import { ENVIRONMENT, Group } from 'vitamui-library'; -import { InjectorModule, LoggerModule, SearchBarComponent, SnackBarService } from 'vitamui-library'; +import { ENVIRONMENT, Group, InjectorModule, LoggerModule, SearchBarComponent, SnackBarService } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { MatDialog } from '@angular/material/dialog'; @@ -69,7 +68,7 @@ let page: Page; @Component({ selector: 'app-group-list', template: '', - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule, SearchBarComponent], + imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], }) class GroupListStubComponent { // eslint-disable-next-line @angular-eslint/no-input-rename @@ -82,7 +81,7 @@ class GroupListStubComponent { @Component({ selector: 'app-group-preview', template: '', - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule, SearchBarComponent], + imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], }) class GroupPreviewStubComponent { @Input() diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group.component.ts index 01bf8db5555..435f6c4d699 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.component.ts @@ -71,7 +71,7 @@ import { GroupService } from './group.service'; * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ViewChild, inject } from '@angular/core'; +import { Component, inject, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; @@ -80,14 +80,14 @@ import { Group, SidenavPage, SnackBarService, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { GroupCreateComponent } from './group-create/group-create.component'; import { GroupListComponent } from './group-list/group-list.component'; import { DownloadSnackBarService } from 'projects/referential/src/app/core/service/download-snack-bar.service'; import { finalize } from 'rxjs/operators'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { GroupPreviewComponent } from './group-preview/group-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts index edf6600ed21..1fd1a71a000 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Group } from 'vitamui-library'; -import { Direction, Operators, PageRequest, SnackBarService } from 'vitamui-library'; +import { BASE_URL, CriteriaSearchQuery, Direction, Group, Operators, PageRequest, SnackBarService } from 'vitamui-library'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.ts index 114f9880c67..4dc80b18887 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.ts @@ -35,11 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { CriteriaSearchQuery, Criterion, Group, SearchService, SnackBarService } from 'vitamui-library'; -import { Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Criterion, Group, Operators, SearchService, SnackBarService } from 'vitamui-library'; import { GroupApiService } from '../core/api/group-api.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts b/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts index a913b619aaf..44b52f5e5ca 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/units-form/units-form.component.ts @@ -34,17 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, forwardRef, Input, OnInit, inject } from '@angular/core'; +import { Component, forwardRef, inject, Input, OnInit } from '@angular/core'; import { AbstractControl, ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, - ValidationErrors, ReactiveFormsModule, + ValidationErrors, } from '@angular/forms'; import { GroupValidators } from '../group.validators'; -import { InputComponent, EllipsisDirective } from 'vitamui-library'; +import { EllipsisDirective, InputComponent } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts index 57acaf3665b..0f57d03738c 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts @@ -36,13 +36,12 @@ */ import { Component, forwardRef, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { AuthService, ConfirmDialogService } from 'vitamui-library'; -import { LevelInputComponent } from 'vitamui-library'; +import { AuthService, ConfirmDialogService, LevelInputComponent } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { HierarchyService } from '../hierarchy.service'; import { HierarchyCreateComponent } from './hierarchy-create.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts index 7826f725e69..f527d3d1051 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.ts @@ -34,23 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; -import { Observable, Subscription, forkJoin } from 'rxjs'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; +import { forkJoin, Observable, Subscription } from 'rxjs'; import { AuthService, + buildValidators, ConfirmDialogService, CriteriaSearchQuery, + DialogHeaderComponent, + LevelInputComponent, Operators, Profile, - buildValidators, - DialogHeaderComponent, SlideToggleComponent, - LevelInputComponent, } from 'vitamui-library'; import { HierarchyService } from '../hierarchy.service'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { ProfilesFormComponent } from '../../shared/profiles-form/profiles-form.component'; import { TranslatePipe } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; @@ -62,7 +61,6 @@ import { CommonModule } from '@angular/common'; imports: [ DialogHeaderComponent, ReactiveFormsModule, - CdkScrollable, MatDialogContent, SlideToggleComponent, ProfilesFormComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts index e4037139ca3..317f92e8a08 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts @@ -34,20 +34,18 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Subscription } from 'rxjs'; import type { Profile } from 'vitamui-library'; import { AuthService, - CommonTooltipComponent, - TooltipDirective, - VitamuiSidenavHeaderComponent, isLevelAllowed, OperationHistoryTabComponent, + VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { HierarchyService } from '../hierarchy.service'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; import { TranslatePipe } from '@ngx-translate/core'; import { ReactiveFormsModule } from '@angular/forms'; @@ -65,10 +63,8 @@ import { CommonModule } from '@angular/common'; OperationHistoryTabComponent, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts index 651de9bc48a..83b08897e7a 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/information-tab/information-tab.component.ts @@ -34,30 +34,20 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input, OnChanges, OnDestroy, SimpleChanges } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { merge, of, Subscription } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Profile, AuthService } from 'vitamui-library'; import { - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, + AuthService, + buildValidators, + diff, EditableInputComponent, EditableLevelInputComponent, EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, - buildValidators, - diff, + Profile, SlideToggleComponent, TooltipDirective, VitamUIFieldErrorComponent, @@ -86,21 +76,11 @@ const DEBOUNCE_TIME = 400; TooltipDirective, VitamUIFieldErrorComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, EditableLevelInputComponent, EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -108,7 +88,6 @@ const DEBOUNCE_TIME = 400; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class InformationTabComponent implements OnDestroy, OnChanges { diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts index bafb31bcf0e..202f8fe8e34 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts @@ -42,21 +42,21 @@ import { CriteriaSearchQuery, Criterion, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, Operators, PageRequest, - Profile, PipesModule, - EllipsisDirective, - InfiniteScrollDirective, + Profile, } from 'vitamui-library'; -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { DEFAULT_PAGE_SIZE } from '../../core/customer.service'; import { HierarchyService } from '../hierarchy.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts index 23ce00a1f7a..73f68554202 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts @@ -34,14 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { GlobalEventService, Profile, SidenavPage } from 'vitamui-library'; -import { VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent } from 'vitamui-library'; +import { GlobalEventService, Profile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { HierarchyCreateComponent } from './hierarchy-create/hierarchy-create.component'; import { HierarchyListComponent } from './hierarchy-list/hierarchy-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { HierarchyDetailComponent } from './hierarchy-detail/hierarchy-detail.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts index 896e9590d4e..c85134e7e58 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL } from 'vitamui-library'; -import { SnackBarService } from 'vitamui-library'; +import { BASE_URL, SnackBarService } from 'vitamui-library'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts index 92824975142..9ecce7f46e7 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-create/profile-create.component.ts @@ -41,24 +41,23 @@ import { AuthUser, buildValidators, ConfirmDialogService, - Profile, - Role, DialogHeaderComponent, - SlideToggleComponent, InputComponent, LevelInputComponent, + Profile, + Role, RoleComponent, RoleToggleComponent, + SlideToggleComponent, } from 'vitamui-library'; -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { CustomerService } from '../../core/customer.service'; import { ProfileService } from '../profile.service'; import { ProfileValidators } from '../profile.validators'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { TranslatePipe } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; @@ -69,7 +68,6 @@ import { CommonModule } from '@angular/common'; imports: [ DialogHeaderComponent, ReactiveFormsModule, - CdkScrollable, MatDialogContent, SlideToggleComponent, InputComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts index 98ff26f97af..31ed2bdadf4 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/information-tab/information-tab.component.ts @@ -34,8 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { of, Subscription } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; @@ -44,28 +44,16 @@ import { AuthService, buildValidators, diff, - Role, - SlideToggleComponent, - TooltipDirective, - VitamUIFieldErrorComponent, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, + Profile, + Role, RoleComponent, RoleToggleComponent, - SubLevelPipe, + SlideToggleComponent, + TooltipDirective, + VitamUIFieldErrorComponent, } from 'vitamui-library'; -import { Profile } from 'vitamui-library'; import { ProfileService } from '../../profile.service'; import { ProfileValidators } from '../../profile.validators'; @@ -89,21 +77,10 @@ import { CommonModule } from '@angular/common'; TooltipDirective, VitamUIFieldErrorComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -113,7 +90,6 @@ import { CommonModule } from '@angular/common'; OverlayModule, RoleComponent, RoleToggleComponent, - SubLevelPipe, ], }) export class InformationTabComponent implements OnDestroy, OnInit, OnChanges { diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts index 8d3354f1f71..ebdb04074fd 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts @@ -34,19 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Subscription } from 'rxjs'; import type { Profile } from 'vitamui-library'; import { AuthService, isLevelAllowed, OperationHistoryTabComponent, - CommonTooltipComponent, - TooltipDirective, VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { ProfileService } from '../profile.service'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; import { TranslatePipe } from '@ngx-translate/core'; import { ReactiveFormsModule } from '@angular/forms'; @@ -64,10 +62,8 @@ import { CommonModule } from '@angular/common'; OperationHistoryTabComponent, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts index 4a922b58029..42ef4ca95a0 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { merge, Subject, Subscription } from 'rxjs'; import { debounceTime, startWith } from 'rxjs/operators'; import { @@ -44,16 +44,16 @@ import { Criterion, DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, Operators, PageRequest, - Profile, PipesModule, - EllipsisDirective, - InfiniteScrollDirective, + Profile, } from 'vitamui-library'; import { ProfileService } from '../profile.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts index c702962b4ef..0ef33006f10 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts @@ -34,16 +34,15 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { GlobalEventService, Profile, SidenavPage } from 'vitamui-library'; -import { VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent } from 'vitamui-library'; +import { GlobalEventService, Profile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; -import { Component, ViewChild, inject } from '@angular/core'; +import { Component, inject, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { ProfileCreateComponent } from './profile-create/profile-create.component'; import { ProfileListComponent } from './profile-list/profile-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ProfileDetailComponent } from './profile-detail/profile-detail.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts index 57045b4bd45..a881947823a 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.module.ts @@ -36,13 +36,13 @@ */ import { CommonModule } from '@angular/common'; import { NgModule } from '@angular/core'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatMenuModule } from '@angular/material/menu'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { VitamUICommonModule, LevelInputComponent } from 'vitamui-library'; +import { LevelInputComponent, VitamUICommonModule } from 'vitamui-library'; import { ProfileRoutingModule } from './profile-routing.module'; import { ProfileComponent } from './profile.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts index 0d675c5cddf..94c0e3236ec 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts @@ -38,8 +38,7 @@ import { HttpTestingController, provideHttpClientTesting } from '@angular/common import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; -import { BASE_URL, Profile } from 'vitamui-library'; -import { SnackBarService } from 'vitamui-library'; +import { BASE_URL, Profile, SnackBarService } from 'vitamui-library'; import { ProfileService } from './profile.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts index 64403f239d4..ca3fbf628bf 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/custom-params/custom-params.component.ts @@ -37,10 +37,10 @@ import { ENTER } from '@angular/cdk/keycodes'; import { AfterContentInit, Component, ContentChildren, forwardRef, Input, QueryList } from '@angular/core'; import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import { VitamUIFieldErrorComponent } from 'vitamui-library'; -import { InputComponent } from 'vitamui-library'; +import { InputComponent, VitamUIFieldErrorComponent } from 'vitamui-library'; import { KeyValuePipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; + export const LIST_INPUT_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, diff --git a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts index 33881976da8..9179779d857 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; +import { Component, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts index edcc616b271..244a7afdd0e 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.ts @@ -36,7 +36,7 @@ */ import { ENTER } from '@angular/cdk/keycodes'; import { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core'; -import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule } from '@angular/forms'; +import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts index 088bd4615ac..a0d931bb237 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-custom-params/editable-custom-params.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, EventEmitter, forwardRef, Input, Output, inject } from '@angular/core'; +import { Component, ElementRef, EventEmitter, forwardRef, inject, Input, Output } from '@angular/core'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from 'vitamui-library'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { CustomParamsComponent } from '../../custom-params/custom-params.component'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { KeyValuePipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts index 2809d329fc4..3255498300f 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-domain-input/editable-domain-input.component.ts @@ -34,15 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, EventEmitter, forwardRef, Input, Output, inject } from '@angular/core'; +import { Component, ElementRef, EventEmitter, forwardRef, inject, Input, Output } from '@angular/core'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from 'vitamui-library'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { NgStyle } from '@angular/common'; import { DomainsInputComponent } from '../../domains-input/domains-input.component'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; + export const EDITABLE_DOMAIN_INPUT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts index 0bac057c454..b529fcce676 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-field.module.ts @@ -41,7 +41,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { OverlayModule } from '@angular/cdk/overlay'; -import { VitamUICommonModule, VitamUILibraryModule, LevelInputComponent } from 'vitamui-library'; +import { LevelInputComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { CustomParamsComponent } from '../custom-params/custom-params.component'; import { DomainsInputComponent } from '../domains-input/domains-input.component'; import { EditableCustomParamsComponent } from './editable-custom-params/editable-custom-params.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts index 2b79c6dd4ad..709387d1042 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-keystore/editable-keystore.component.ts @@ -34,15 +34,15 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { EditableFieldComponent, IdentityProvider } from 'vitamui-library'; -import { newFile } from 'vitamui-library'; +import { EditableFieldComponent, IdentityProvider, newFile } from 'vitamui-library'; -import { Component, ElementRef, Input, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, inject, Input, ViewChild } from '@angular/core'; import { IdentityProviderService } from '../../../customer/customer-preview/sso-tab/identity-provider.service'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { ReactiveFormsModule } from '@angular/forms'; import { TranslatePipe } from '@ngx-translate/core'; + /*eslint no-use-before-define: "error"*/ @Component({ selector: 'app-editable-keystore', diff --git a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts index 750644dfded..084ce094402 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/editable-field/editable-patterns/editable-patterns.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, forwardRef, inject, Input, ViewChild } from '@angular/core'; import { DOCUMENT } from '@angular/common'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import { EditableFieldComponent } from 'vitamui-library'; -import { PatternComponent } from 'vitamui-library'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { EditableFieldComponent, PatternComponent } from 'vitamui-library'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; export const EDITABLE_PATTERNS_INPUT_VALUE_ACCESSOR: any = { diff --git a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts index ad31303013e..5a15d00c9dd 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/profiles-form/profiles-form.component.ts @@ -34,22 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, forwardRef, Input, OnInit, SimpleChanges, ViewChild, OnChanges, inject } from '@angular/core'; -import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, ElementRef, forwardRef, inject, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; +import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms'; import { shareReplay } from 'rxjs/operators'; import { ApplicationApiService, + EllipsisDirective, IdentifierName, Option, Profile, ProfileService, SelectComponent, - EllipsisDirective, } from 'vitamui-library'; import { OptionTree } from './option-tree.interface'; import { zip } from 'rxjs'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; export const PROFILES_FORM_VALUE_ACCESSOR: any = { diff --git a/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts b/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts index d7db8eee913..043dd53f174 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/shared.module.ts @@ -36,7 +36,7 @@ */ import { NgModule } from '@angular/core'; -import { VitamUICommonModule, LevelInputComponent, CollapseComponent } from 'vitamui-library'; +import { CollapseComponent, LevelInputComponent, VitamUICommonModule } from 'vitamui-library'; import { DomainsInputComponent } from './domains-input/domains-input.component'; import { EditableCustomParamsComponent } from './editable-field/editable-custom-params/editable-custom-params.component'; import { EditableDomainInputComponent } from './editable-field/editable-domain-input/editable-domain-input.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts index eef59cec2e9..61da85ab597 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AuthService, BASE_URL, CriteriaSearchQuery, ENVIRONMENT } from 'vitamui-library'; -import { LoggerModule, Operators } from 'vitamui-library'; +import { AuthService, BASE_URL, CriteriaSearchQuery, ENVIRONMENT, LoggerModule, Operators } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts index 5084c0662c5..7ebdd88dcb7 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.ts @@ -36,11 +36,10 @@ */ import { Observable, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; -import { CriteriaSearchQuery, Customer, MenuOption } from 'vitamui-library'; -import { Operators } from 'vitamui-library'; +import { CriteriaSearchQuery, Customer, MenuOption, Operators } from 'vitamui-library'; import { HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { CustomerApiService } from '../core/api/customer-api.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts index 22b7c077d5f..66c01e959e5 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts @@ -44,23 +44,23 @@ import { Criterion, DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, Group, + InfiniteScrollDirective, InfiniteScrollTable, Operators, PageRequest, Profile, SubrogationModalService, SubrogationUser, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; -import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { SubrogationService } from '../../subrogation.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts index 08ae28c530d..8ecc57b5223 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { Subject } from 'rxjs'; @@ -46,8 +46,8 @@ import { GlobalEventService, MenuOption, SubrogationModalService, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { CustomerSelectService } from '../customer-select.service'; import { MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts index 4aafb522c4e..a0863d5f6b0 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.component.ts @@ -36,12 +36,11 @@ */ import { User } from 'vitamui-library'; -import { Component, forwardRef, OnInit, inject } from '@angular/core'; +import { Component, forwardRef, inject, OnInit } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { GroupSelection } from '../group-selection.interface'; import { UserService } from '../user.service'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { GroupListComponent } from './group-list/group-list.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -57,7 +56,7 @@ export const GROUP_ATTRIBUTION_VALUE_ACCESSOR: any = { templateUrl: './group-attribution.component.html', styleUrls: ['./group-attribution.component.scss'], providers: [GROUP_ATTRIBUTION_VALUE_ACCESSOR], - imports: [CdkScrollable, MatDialogContent, GroupListComponent, MatDialogActions, TranslatePipe], + imports: [MatDialogContent, GroupListComponent, MatDialogActions, TranslatePipe], }) export class GroupAttributionComponent implements OnInit { private userService = inject(UserService); diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts index 28fd5e54625..376c147f944 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-attribution.module.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { NgModule } from '@angular/core'; -import { VitamUICommonModule, CollapseContainerDirective, CollapseDirective, CollapseTriggerForDirective } from 'vitamui-library'; +import { CollapseContainerDirective, CollapseDirective, CollapseTriggerForDirective, VitamUICommonModule } from 'vitamui-library'; import { SharedModule } from '../../shared/shared.module'; import { GroupAttributionComponent } from './group-attribution.component'; import { GroupDetailComponent } from './group-detail/group-detail.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts index 6c9d91a527b..a7b727c7c52 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-detail/group-detail.component.ts @@ -34,11 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit, inject } from '@angular/core'; -import { Group, Profile } from 'vitamui-library'; -import { TooltipDirective, EllipsisDirective } from 'vitamui-library'; +import { Component, inject, Input, OnInit } from '@angular/core'; +import { EllipsisDirective, Group, Profile, TooltipDirective } from 'vitamui-library'; import { GroupService } from '../../../group/group.service'; -import { TitleCasePipe, CommonModule } from '@angular/common'; +import { CommonModule, TitleCasePipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts index f0603a97da4..8be1f86dbbe 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/group-attribution/group-list/group-list.component.ts @@ -34,34 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; import { MAT_DIALOG_DATA } from '@angular/material/dialog'; -import { - Profile, - SearchBarComponent, - CollapseContainerDirective, - CollapseDirective, - CollapseTriggerForDirective, - EllipsisDirective, -} from 'vitamui-library'; +import { CollapseDirective, EllipsisDirective, Profile, SearchBarComponent } from 'vitamui-library'; import { GroupSelection } from './../../group-selection.interface'; import { GroupDetailComponent } from '../group-detail/group-detail.component'; import { TranslatePipe } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-group-list', templateUrl: './group-list.component.html', styleUrls: ['./group-list.component.scss'], - imports: [ - SearchBarComponent, - GroupDetailComponent, - TranslatePipe, - CollapseContainerDirective, - CollapseDirective, - CollapseTriggerForDirective, - CommonModule, - EllipsisDirective, - ], + imports: [SearchBarComponent, GroupDetailComponent, TranslatePipe, CollapseDirective, CommonModule, EllipsisDirective], }) export class GroupListComponent implements OnInit { data = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts index c1122bd3744..4e217b207d9 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-create/user-create.component.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, ValidationErrors, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, ValidationErrors, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Observable, Subscription } from 'rxjs'; import { AdminUserProfile, @@ -45,20 +45,20 @@ import { CountryOption, CountryService, Customer, + DialogHeaderComponent, Group, + InputComponent, isRootLevel, Logger, + NextStepComponent, Option, OtpState, + PreviousStepComponent, + SelectComponent, + SlideToggleComponent, StartupService, - UserInfo, - DialogHeaderComponent, StepperComponent, - SlideToggleComponent, - InputComponent, - SelectComponent, - NextStepComponent, - PreviousStepComponent, + UserInfo, } from 'vitamui-library'; import { GroupSelection } from './../group-selection.interface'; import { UserInfoService } from './../user-info.service'; @@ -67,8 +67,7 @@ import { distinctUntilChanged, map, tap } from 'rxjs/operators'; import { UserService } from '../user.service'; import { UserCreateValidators } from './user-create.validators'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { GroupListComponent } from '../group-attribution/group-list/group-list.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -83,7 +82,6 @@ const emailFirstPartValidator: RegExp = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+$/; ReactiveFormsModule, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, SlideToggleComponent, InputComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts index e839213a062..14fd96ed4f1 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-criteria-builder.util.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Criterion, CriteriaSearchQuery } from 'vitamui-library'; -import { buildCriteriaFromFilters, Operators, QueryOperator } from 'vitamui-library'; +import { buildCriteriaFromFilters, CriteriaSearchQuery, Criterion, Operators, QueryOperator } from 'vitamui-library'; const USER_FILTER_CONVERTER: Readonly<{ [key: string]: (values: any[]) => Array }> = { status: (statusList: string[]): CriteriaSearchQuery[] => { diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts index c6f27c5fa7c..f05274cf8cc 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts @@ -37,33 +37,35 @@ import { merge, Subject, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { + AdminUserProfile, ApplicationId, AuthService, buildCriteriaFromSearch, CriteriaSearchQuery, DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + Group, + HasAnyRoleDirective, + InfiniteScrollDirective, InfiniteScrollTable, + OrderByButtonComponent, PageRequest, + PipesModule, Role, SnackBarService, - TableFilterDirective, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - OrderByButtonComponent, TableFilterSearchComponent, - PipesModule, - EllipsisDirective, - HasAnyRoleDirective, - HasRoleDirective, - InfiniteScrollDirective, + User, } from 'vitamui-library'; -import { AdminUserProfile, Group, User } from 'vitamui-library'; import { Component, ElementRef, EventEmitter, + inject, Input, LOCALE_ID, OnDestroy, @@ -71,14 +73,13 @@ import { Output, TemplateRef, ViewChild, - inject, } from '@angular/core'; import { CustomerService } from '../../core/customer.service'; import { UserService } from '../user.service'; import { buildCriteriaFromUserFilters } from './user-criteria-builder.util'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { UpperCasePipe, DatePipe, CommonModule } from '@angular/common'; +import { CommonModule, DatePipe, UpperCasePipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; const FILTER_DEBOUNCE_TIME_MS = 400; @@ -101,7 +102,6 @@ const FILTER_DEBOUNCE_TIME_MS = 400; CommonModule, EllipsisDirective, HasAnyRoleDirective, - HasRoleDirective, InfiniteScrollDirective, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts index 3cf9c05b2f5..5cdbe44affe 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-group-tab/user-group-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnDestroy, inject } from '@angular/core'; +import { Component, inject, Input, OnChanges, OnDestroy } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { Subject } from 'rxjs'; -import { AuthService, AdminUserProfile, Group, Profile, User } from 'vitamui-library'; -import { isRootLevel, TooltipDirective } from 'vitamui-library'; +import { AdminUserProfile, AuthService, Group, isRootLevel, Profile, TooltipDirective, User } from 'vitamui-library'; import { GroupService } from '../../../group/group.service'; import { GroupAttributionComponent } from '../../group-attribution/group-attribution.component'; import { GroupSelection } from '../../group-selection.interface'; diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts index 36feee2dafe..f9ce569bba8 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-information-tab/user-information-tab.component.ts @@ -34,35 +34,30 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, inject, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { merge, of } from 'rxjs'; import { catchError, debounceTime, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { AdminUserProfile, CountryOption, Customer, User, UserInfo, CountryService, Option, StartupService } from 'vitamui-library'; import { - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, + AdminUserProfile, + CountryOption, + CountryService, + Customer, + diff, EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, - diff, - OtpState, - VitamUIFieldErrorComponent, FormFieldValueWrapperComponent, + Option, + OtpState, + PipesModule, SelectComponent, SlideToggleComponent, + StartupService, TooltipDirective, - PipesModule, + User, + UserInfo, + VitamUIFieldErrorComponent, } from 'vitamui-library'; import { UserInfoService } from '../../user-info.service'; @@ -93,21 +88,10 @@ const UPDATE_DEBOUNCE_TIME = 200; TooltipDirective, PipesModule, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, FormsModule, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -115,7 +99,6 @@ const UPDATE_DEBOUNCE_TIME = 200; MatProgressSpinnerModule, MatSelectModule, OverlayModule, - SubLevelPipe, ], }) export class UserInfoTabComponent implements OnChanges, OnInit { diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts index a575748de62..ef13d0c33bd 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-preview/user-preview.component.ts @@ -34,21 +34,23 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { + AdminUserProfile, AuthService, + Customer, + Group, isLevelAllowed, + MultiOperationHistoryTabComponent, StartupService, + User, + UserInfo, VitamuiMenuButtonComponent, - MultiOperationHistoryTabComponent, - CommonTooltipComponent, - TooltipDirective, VitamuiSidenavHeaderComponent, } from 'vitamui-library'; -import { AdminUserProfile, Customer, Group, User, UserInfo } from 'vitamui-library'; import { UserInfoService } from './../user-info.service'; import { UserApiService } from '../../core/api/user-api.service'; @@ -56,10 +58,9 @@ import { GroupService } from '../../group/group.service'; import { GroupSelection } from '../group-selection.interface'; import { UserService } from '../user.service'; import { MatMenuItem } from '@angular/material/menu'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { UserInfoTabComponent } from './user-information-tab/user-information-tab.component'; import { UserGroupTabComponent } from './user-group-tab/user-group-tab.component'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { TranslatePipe } from '@ngx-translate/core'; import { ReactiveFormsModule } from '@angular/forms'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @@ -77,16 +78,13 @@ import { CommonModule } from '@angular/common'; UserInfoTabComponent, UserGroupTabComponent, MultiOperationHistoryTabComponent, - CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/user/user.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user.component.ts index 47e6140edee..0c63db19316 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { DownloadSnackBarService } from 'projects/referential/src/app/core/service/download-snack-bar.service'; @@ -50,17 +50,17 @@ import { Group, PageRequest, SidenavPage, - User, SnackBarService, - VitamuiTitleBreadcrumbComponent, + User, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { CustomerService } from '../core/customer.service'; import { GroupService } from '../group/group.service'; import { UserCreateComponent } from './user-create/user-create.component'; import { UserListComponent } from './user-list/user-list.component'; import { UserService } from './user.service'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { UserPreviewComponent } from './user-preview/user-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/main.ts b/ui/ui-frontend/projects/identity/src/main.ts index ae6d664d7cc..59dd3994c1f 100644 --- a/ui/ui-frontend/projects/identity/src/main.ts +++ b/ui/ui-frontend/projects/identity/src/main.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; -import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; +import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { WINDOW_LOCATION } from 'vitamui-library'; -import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { AuthenticationModule, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/core/core.module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/ui/ui-frontend/projects/ingest/src/app/app.component.ts b/ui/ui-frontend/projects/ingest/src/app/app.component.ts index 6c8d436f952..49cef51126f 100644 --- a/ui/ui-frontend/projects/ingest/src/app/app.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/app.component.ts @@ -36,8 +36,7 @@ */ import { Component, inject } from '@angular/core'; import { Title } from '@angular/platform-browser'; -import { StartupService } from 'vitamui-library'; -import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { FooterComponent, HeaderModule, StartupService, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library'; import { RouterOutlet } from '@angular/router'; @Component({ diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts index 49a3946e1c7..76879423c30 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts @@ -37,8 +37,7 @@ import { TestBed } from '@angular/core/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { IngestApiService } from './ingest-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts index 54389c431d9..1ea37689cd5 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.ts @@ -35,11 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpClient, HttpEvent, HttpHeaders, HttpParams, HttpRequest } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { BASE_URL, PageRequest, PaginatedHttpClient, PaginatedResponse } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { BASE_URL, PageRequest, PaginatedHttpClient, PaginatedResponse, VitamuiHttpHeaders } from 'vitamui-library'; import { IngestType } from '../common/ingest-type.enum'; @Injectable({ diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts index 329f715ee24..068155e3797 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts @@ -39,8 +39,7 @@ import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, BytesPipe, ConfirmDialogService, StartupService } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, BytesPipe, ConfirmDialogService, LoggerModule, StartupService } from 'vitamui-library'; import { UploadComponent } from './upload.component'; import { UploadService } from './upload.service'; diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts index 19acaa480d3..a1a7e1d1c5b 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.ts @@ -35,16 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnInit, ViewChild } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; -import { SnackBarService, StartupService } from 'vitamui-library'; -import { DialogHeaderComponent, FileSelectorComponent } from 'vitamui-library'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; +import { DialogHeaderComponent, FileSelectorComponent, SnackBarService, StartupService } from 'vitamui-library'; import { IngestType } from './ingest-type.enum'; import { UploadService } from './upload.service'; import { MatSnackBarRef } from '@angular/material/snack-bar'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { CdkScrollable } from '@angular/cdk/scrolling'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; const FILE_MAX_SIZE = 10737418240; @@ -52,15 +50,7 @@ const FILE_MAX_SIZE = 10737418240; selector: 'app-upload', templateUrl: './upload.component.html', styleUrls: ['./upload.component.scss'], - imports: [ - DialogHeaderComponent, - CdkScrollable, - MatDialogContent, - FileSelectorComponent, - ReactiveFormsModule, - MatDialogActions, - TranslatePipe, - ], + imports: [DialogHeaderComponent, MatDialogContent, FileSelectorComponent, ReactiveFormsModule, MatDialogActions, TranslatePipe], }) export class UploadComponent implements OnInit { data = inject(MAT_DIALOG_DATA); diff --git a/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts b/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts index 15b08025f73..51e345b6fbb 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/core.module.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { NgModule, inject } from '@angular/core'; +import { inject, NgModule } from '@angular/core'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; @NgModule({ diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts index c59290a9081..1d2fa784e07 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts @@ -67,7 +67,6 @@ import { HoldingFillingSchemeComponent } from './holding-filling-scheme.componen BrowserAnimationsModule, RouterTestingModule, NoopAnimationsModule, - SearchBarComponent, MatDialogModule, ], }) diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts index 9a2152e050f..832f364a7a5 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts @@ -34,14 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { GlobalEventService, SidenavPage } from 'vitamui-library'; -import { VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent } from 'vitamui-library'; +import { GlobalEventService, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { IngestType } from '../core/common/ingest-type.enum'; import { UploadComponent } from '../core/common/upload.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { UploadTrackingComponent } from '../shared/upload-tracking/upload-tracking.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts index 3ff0654889c..9f9e2156cad 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts @@ -34,14 +34,20 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { Subject, merge } from 'rxjs'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { merge, Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { InfiniteScrollTable, DEFAULT_PAGE_SIZE } from 'vitamui-library'; -import { Direction, PageRequest, OrderByButtonComponent, PipesModule, InfiniteScrollDirective } from 'vitamui-library'; -import { IngestStatus } from '../../models/logbook-event.interface'; +import { + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollDirective, + InfiniteScrollTable, + OrderByButtonComponent, + PageRequest, + PipesModule, +} from 'vitamui-library'; import type { LogbookOperation } from '../../models/logbook-event.interface'; -import { ingestStatus, ingestStatusVisualColor } from '../../models/logbook-event.interface'; +import { IngestStatus, ingestStatus, ingestStatusVisualColor } from '../../models/logbook-event.interface'; import { IngestService } from '../ingest.service'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts index 03119792ce0..8ef5495aba7 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.ts @@ -35,15 +35,15 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { NestedTreeControl } from '@angular/cdk/tree'; -import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; +import { Component, inject, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; import { - MatTreeNestedDataSource, + MatNestedTreeNode, MatTree, - MatTreeNodeDef, + MatTreeNestedDataSource, MatTreeNode, - MatTreeNodeToggle, - MatNestedTreeNode, + MatTreeNodeDef, MatTreeNodeOutlet, + MatTreeNodeToggle, } from '@angular/material/tree'; import type { LogbookOperation } from '../../../models/logbook-event.interface'; import type { Event } from '../event'; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts index 93a61407018..93eda6e1ad9 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/event-display/event-display.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit, forwardRef } from '@angular/core'; +import { Component, forwardRef, Input, OnInit } from '@angular/core'; import { Event } from '../../../event'; import { EventTypeLabelComponent } from 'vitamui-library'; import { NgClass } from '@angular/common'; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts index c0fb145b017..9a1d2304fd7 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-event-detail/ingest-event-detail.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; +import { Component, inject, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; import type { LogbookOperation } from '../../../../models/logbook-event.interface'; import type { Event } from '../../event'; import { EventDisplayHelperService } from '../../event-display-helper.service'; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts index c7add204495..20acb143eed 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-information-tab/ingest-information-tab.component.ts @@ -34,18 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, inject } from '@angular/core'; -import { ApplicationService } from 'vitamui-library'; -import { ApplicationId, DataComponent, PipesModule } from 'vitamui-library'; -import { IngestStatus } from '../../../models/logbook-event.interface'; +import { Component, inject, Input, OnChanges } from '@angular/core'; +import { ApplicationId, ApplicationService, DataComponent, PipesModule } from 'vitamui-library'; import type { AgIdExtDeflateJson, EvDetDataDeflateJson, IngestReferentialNames, LogbookOperation, } from '../../../models/logbook-event.interface'; -import { ingestHasEvents, ingestLastEvent, ingestStatus } from '../../../models/logbook-event.interface'; -import { Observable, ReplaySubject, of } from 'rxjs'; +import { ingestHasEvents, ingestLastEvent, IngestStatus, ingestStatus } from '../../../models/logbook-event.interface'; +import { Observable, of, ReplaySubject } from 'rxjs'; import { catchError, map, startWith, switchMap } from 'rxjs/operators'; import { IngestReferentialService } from '../../../core/service/ingest-referential.service'; import { IngestEventDetailComponent } from './ingest-event-detail/ingest-event-detail.component'; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts index 55270d5a4f1..4b341ae9d7b 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.ts @@ -34,22 +34,14 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { first } from 'rxjs/operators'; -import { LogbookService } from 'vitamui-library'; -import { - VitamuiMenuButtonComponent, - TooltipDirective, - PipesModule, - CommonTooltipComponent, - VitamuiSidenavHeaderComponent, -} from 'vitamui-library'; -import { IngestStatus } from '../../models/logbook-event.interface'; +import { LogbookService, PipesModule, TooltipDirective, VitamuiMenuButtonComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import type { LogbookOperation } from '../../models/logbook-event.interface'; -import { ingestStatus, ingestStatusVisualColor } from '../../models/logbook-event.interface'; +import { IngestStatus, ingestStatus, ingestStatusVisualColor } from '../../models/logbook-event.interface'; import { IngestService } from '../ingest.service'; import { MatMenuItem } from '@angular/material/menu'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { IngestInformationTabComponent } from './ingest-information-tab/ingest-information-tab.component'; import { IngestErrorsDetailsTabComponent } from './ingest-errors-details-tab/ingest-errors-details-tab.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -72,7 +64,6 @@ import { CommonModule } from '@angular/common'; PipesModule, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, VitamuiSidenavHeaderComponent, diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts index 911596d1187..34ebbdee681 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts @@ -40,15 +40,15 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { AdminUserProfile, + DatepickerComponent, Direction, GlobalEventService, SearchBarComponent, SidenavPage, - VitamuiTitleBreadcrumbComponent, - VitamuiBannerComponent, TooltipDirective, + VitamuiBannerComponent, VitamuiMenuButtonComponent, - DatepickerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { IngestList } from '../core/common/ingest-list'; import { IngestType } from '../core/common/ingest-type.enum'; @@ -56,7 +56,7 @@ import { UploadComponent } from '../core/common/upload.component'; import { UploadService } from '../core/common/upload.service'; import { LogbookOperation } from '../models/logbook-event.interface'; import { IngestListComponent } from './ingest-list/ingest-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { IngestPreviewComponent } from './ingest-preview/ingest-preview.component'; import { NgStyle } from '@angular/common'; import { MatMenuItem } from '@angular/material/menu'; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts index a7dbdb0e886..4e62c848a84 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.service.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { SearchService, SnackBarService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; import { IngestApiService } from '../core/api/ingest-api.service'; import { LogbookOperation } from '../models/logbook-event.interface'; diff --git a/ui/ui-frontend/projects/ingest/src/main.ts b/ui/ui-frontend/projects/ingest/src/main.ts index 3e18e6b0541..a6d1823d849 100644 --- a/ui/ui-frontend/projects/ingest/src/main.ts +++ b/ui/ui-frontend/projects/ingest/src/main.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; -import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; +import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { WINDOW_LOCATION, BytesPipe } from 'vitamui-library'; -import { provideI18n, AuthenticationModule, VitamUICommonModule } from 'vitamui-library'; +import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/core/core.module'; diff --git a/ui/ui-frontend/projects/pastis/src/app/app.component.ts b/ui/ui-frontend/projects/pastis/src/app/app.component.ts index 42dd11bea4e..5b5ccf18fa8 100644 --- a/ui/ui-frontend/projects/pastis/src/app/app.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/app.component.ts @@ -36,7 +36,7 @@ */ import { Component } from '@angular/core'; import { environment } from '../environments/environment'; -import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { FooterComponent, HeaderModule, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library'; import { MatToolbar } from '@angular/material/toolbar'; import { RouterOutlet } from '@angular/router'; diff --git a/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts b/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts index 5f6cc9dd347..913f60adae1 100644 --- a/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/core/core.module.ts @@ -36,7 +36,7 @@ */ import { CommonModule } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { NgModule, inject } from '@angular/core'; +import { inject, NgModule } from '@angular/core'; import { throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; @NgModule({ diff --git a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts index a4a424b6fa8..e7fe49ab588 100644 --- a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts @@ -72,7 +72,7 @@ The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ import { CdkTextareaAutosize } from '@angular/cdk/text-field'; -import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { finalize, map, Subscription, switchMap } from 'rxjs'; import { FileService } from '../core/services/file.service'; @@ -89,7 +89,7 @@ import { ProfileVersion } from '../models/profile-version.enum'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { MatButton } from '@angular/material/button'; import { MatIcon } from '@angular/material/icon'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { FileTreeMetadataComponent } from '../profile/edit-profile/file-tree-metadata/file-tree-metadata.component'; @Component({ diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts index eace3a1fc8e..a167292b8df 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.ts @@ -34,15 +34,14 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, computed, effect, Injector, OnDestroy, OnInit, signal, inject } from '@angular/core'; +import { Component, computed, effect, inject, Injector, OnDestroy, OnInit, signal } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatDialogRef, MatDialogModule } from '@angular/material/dialog'; +import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { MatRadioModule } from '@angular/material/radio'; -import { ApplicationService, Option } from 'vitamui-library'; -import { MiscValidators, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ApplicationService, MiscValidators, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { ProfileType } from '../../models/profile-type.enum'; import { ProfileVersionOptions } from '../../models/profile-version.enum'; -import { TranslateService } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { ProfileService } from '../../core/services/profile.service'; import { Subscription } from 'rxjs'; @@ -51,7 +50,6 @@ import { Notice } from '../../models/notice.model'; import { PastisGenericPopupComponent } from '../../shared/pastis-generic-popup/pastis-generic-popup.component'; import { IdentifierExistsValidator } from '../../validators/IdentifierExistsValidator'; -import { TranslatePipe } from '@ngx-translate/core'; @Component({ imports: [ diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts index f88d9564bd5..77b958838e4 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/create-profile/create-profile.component.ts @@ -71,16 +71,15 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { ProfileType } from '../../models/profile-type.enum'; import { ProfileVersion, ProfileVersionOptions } from '../../models/profile-version.enum'; import { PastisDialogData } from '../../shared/pastis-dialog/classes/pastis-dialog-data'; -import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { DialogHeaderComponent, TooltipDirective } from 'vitamui-library'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { PastisGenericPopupComponent } from '../../shared/pastis-generic-popup/pastis-generic-popup.component'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; import { TranslatePipe } from '@ngx-translate/core'; export interface CreateProfileFormResult { @@ -95,7 +94,6 @@ export interface CreateProfileFormResult { styleUrls: ['./create-profile.component.scss'], imports: [ DialogHeaderComponent, - CdkScrollable, MatDialogContent, FormsModule, ReactiveFormsModule, diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts index 544d206a2c7..3f118ee9974 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.ts @@ -71,8 +71,8 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; -import { MatTabChangeEvent, MatTabGroup, MatTab, MatTabContent } from '@angular/material/tabs'; +import { AfterViewInit, Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { MatTab, MatTabChangeEvent, MatTabContent, MatTabGroup } from '@angular/material/tabs'; import { BehaviorSubject, Subscription } from 'rxjs'; import { environment } from '../../../environments/environment'; import { FileService } from '../../core/services/file.service'; @@ -82,8 +82,7 @@ import { FileNode } from '../../models/file-node'; import { ProfileType } from '../../models/profile-type.enum'; import { FileTreeComponent } from './file-tree/file-tree.component'; import { FileTreeService } from './file-tree/file-tree.service'; -import { Logger } from 'vitamui-library'; -import { ChipComponent } from 'vitamui-library'; +import { ChipComponent, Logger } from 'vitamui-library'; import { filter } from 'rxjs/operators'; import { BreadcrumbService } from '../../core/services/breadcrumb.service'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts index c3b6443e2d3..81ceadb2a11 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/attributes/attributes.component.ts @@ -71,21 +71,21 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { MatCheckboxChange, MatCheckbox } from '@angular/material/checkbox'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogModule } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { MatCheckbox, MatCheckboxChange } from '@angular/material/checkbox'; +import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { - MatTableDataSource, - MatTable, + MatCell, + MatCellDef, MatColumnDef, - MatHeaderCellDef, MatHeaderCell, - MatCellDef, - MatCell, - MatHeaderRowDef, + MatHeaderCellDef, MatHeaderRow, - MatRowDef, + MatHeaderRowDef, MatRow, + MatRowDef, + MatTable, + MatTableDataSource, } from '@angular/material/table'; import { FileService } from 'projects/pastis/src/app/core/services/file.service'; import { PopupService } from 'projects/pastis/src/app/core/services/popup.service'; @@ -98,25 +98,9 @@ import { CardinalityConstants, DataTypeConstants, FileNode, TypeConstants, Value import { SedaData } from '../../../../models/seda-data'; import { FileTreeMetadataService } from '../file-tree-metadata.service'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { NgStyle, NgClass, CommonModule } from '@angular/common'; -import { - TooltipDirective, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, -} from 'vitamui-library'; -import { MatSelect, MatOption, MatSelectModule } from '@angular/material/select'; +import { CommonModule, NgClass, NgStyle } from '@angular/common'; +import { EditableTextareaComponent, TooltipDirective } from 'vitamui-library'; +import { MatOption, MatSelect, MatSelectModule } from '@angular/material/select'; import { TranslatePipe } from '@ngx-translate/core'; import { MatInputModule } from '@angular/material/input'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @@ -148,20 +132,8 @@ import { MatFormFieldModule } from '@angular/material/form-field'; MatRowDef, MatRow, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -170,7 +142,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; MatSelectModule, OverlayModule, ReactiveFormsModule, - SubLevelPipe, ], }) export class AttributesPopupComponent implements OnInit, OnDestroy { diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts index 9c056cb7199..b1094f34c9f 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts @@ -40,8 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterModule } from '@angular/router'; -import { BASE_URL, ProfileService, WINDOW_LOCATION } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule, ProfileService, WINDOW_LOCATION } from 'vitamui-library'; import { PastisApiService } from '../../../core/api/api.pastis.service'; import { PastisConfiguration } from '../../../core/classes/pastis-configuration'; import { FileService } from '../../../core/services/file.service'; diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts index c3b30282047..e1f5bf6ce09 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.ts @@ -35,49 +35,37 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { CdkTextareaAutosize } from '@angular/cdk/text-field'; -import { Component, EventEmitter, OnDestroy, OnInit, Output, ViewChild, ViewEncapsulation, inject } from '@angular/core'; +import { Component, EventEmitter, inject, OnDestroy, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core'; import { - MatTableDataSource, - MatTable, + MatCell, + MatCellDef, MatColumnDef, - MatHeaderCellDef, MatHeaderCell, - MatCellDef, - MatCell, - MatHeaderRowDef, + MatHeaderCellDef, MatHeaderRow, - MatRowDef, + MatHeaderRowDef, MatRow, + MatRowDef, + MatTable, + MatTableDataSource, } from '@angular/material/table'; import { Router } from '@angular/router'; -import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { LangChangeEvent, TranslatePipe, TranslateService } from '@ngx-translate/core'; import { environment } from 'projects/pastis/src/environments/environment'; import { mergeMap, Subscription } from 'rxjs'; import { + ChipComponent, DatePatternConstants, + EditableInputComponent, + EditableTextareaComponent, + InputComponent, Logger, Option, + SelectComponent, SnackBarService, StartupService, - ChipComponent, TooltipDirective, VitamuiBannerComponent, - SelectComponent, - InputComponent, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, - EditableInputComponent, - EditableLevelInputComponent, - EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, - SubLevelPipe, } from 'vitamui-library'; import { FileService } from '../../../core/services/file.service'; import { ProfileService } from '../../../core/services/profile.service'; @@ -112,16 +100,16 @@ import { AllowAdditionalPropertiesComponent } from '../../../user-actions/allow- import { UserActionSaveProfileComponent } from '../../../user-actions/save-profile/save-profile.component'; import { UserActionsDownloadDocComponent } from '../../../user-actions/download-doc/download-doc.component'; import { PastisPopupMetadataLanguageComponent } from '../../../shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatIcon } from '@angular/material/icon'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatSelect, MatOption, MatSelectModule } from '@angular/material/select'; +import { MatOption, MatSelect, MatSelectModule } from '@angular/material/select'; import { MatIconButton } from '@angular/material/button'; -import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; +import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { MatDivider } from '@angular/material/list'; import { MatCheckbox } from '@angular/material/checkbox'; -import { MatDialogTitle, MatDialogModule } from '@angular/material/dialog'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatDialogModule, MatDialogTitle } from '@angular/material/dialog'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; import { MatInputModule } from '@angular/material/input'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { OverlayModule } from '@angular/cdk/overlay'; @@ -202,20 +190,9 @@ function constantToTranslate() { SelectComponent, InputComponent, TranslatePipe, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, - EditableButtonToggleComponent, - EditableEmailInputComponent, - EditableFieldComponent, - EditableFileComponent, EditableInputComponent, - EditableLevelInputComponent, EditableTextareaComponent, - EditableToggleGroupComponent, - EllipsisDirective, - LevelInputComponent, MatButtonToggleModule, MatDialogModule, MatFormFieldModule, @@ -224,7 +201,6 @@ function constantToTranslate() { MatSelectModule, OverlayModule, ReactiveFormsModule, - SubLevelPipe, ], }) export class FileTreeMetadataComponent implements OnInit, OnDestroy { diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts index 0b50f596787..cbc93e3e2c1 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.component.ts @@ -71,8 +71,8 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { ChangeDetectorRef, Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { BehaviorSubject, Subscription } from 'rxjs'; import { environment } from '../../../../environments/environment'; import { FileService } from '../../../core/services/file.service'; @@ -88,19 +88,18 @@ import { DuplicateMetadataComponent } from '../../../user-actions/duplicate-meta import { UserActionRemoveMetadataComponent } from '../../../user-actions/remove-metadata/remove-metadata.component'; import { FileTreeMetadataService } from '../file-tree-metadata/file-tree-metadata.service'; import { FileTreeService } from './file-tree.service'; -import { Logger, SnackBarService } from 'vitamui-library'; -import { TooltipDirective } from 'vitamui-library'; +import { Logger, SnackBarService, TooltipDirective } from 'vitamui-library'; import { - MatTreeNestedDataSource, + MatNestedTreeNode, MatTree, + MatTreeNestedDataSource, MatTreeNodeDef, - MatNestedTreeNode, - MatTreeNodeToggle, MatTreeNodeOutlet, + MatTreeNodeToggle, } from '@angular/material/tree'; import { NestedTreeControl } from '@angular/cdk/tree'; import { filter, map, tap } from 'rxjs/operators'; -import { MatListItem, MatDivider } from '@angular/material/list'; +import { MatDivider, MatListItem } from '@angular/material/list'; import { NgClass, NgStyle } from '@angular/common'; import { MatIcon } from '@angular/material/icon'; import { MatIconButton } from '@angular/material/button'; diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts index c12c1124012..f284954c764 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree/file-tree.module.ts @@ -82,8 +82,6 @@ import { MatTableModule } from '@angular/material/table'; import { MAT_RIPPLE_GLOBAL_OPTIONS } from '@angular/material/core'; import { - VitamUICommonModule, - VitamUILibraryModule, ClosePopupDialogComponent, CommonConfirmDialogComponent, DialogHeaderComponent, @@ -98,6 +96,8 @@ import { EllipsisDirective, LevelInputComponent, SubLevelPipe, + VitamUICommonModule, + VitamUILibraryModule, } from 'vitamui-library'; import { CoreModule } from '../../../core/core.module'; import { AttributesPopupComponent } from '../file-tree-metadata/attributes/attributes.component'; diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts index af5d831fa5a..dded6dcdefa 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts @@ -71,27 +71,25 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog, MatDialogConfig, MatDialogModule } from '@angular/material/dialog'; import { MatTableDataSource } from '@angular/material/table'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { filter, of, Subscription, switchMap } from 'rxjs'; import { + CommonConfirmDialogComponent, Direction, GlobalEventService, + InfiniteScrollDirective, + OrderByButtonComponent, + PipesModule, SidenavPage, SnackBarService, StartupService, - VitamuiTitleBreadcrumbComponent, - VitamuiBannerComponent, - OrderByButtonComponent, TooltipDirective, - PipesModule, - ClosePopupDialogComponent, - CommonConfirmDialogComponent, - DialogHeaderComponent, - InfiniteScrollDirective, + VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; @@ -110,10 +108,10 @@ import { ArchivalProfileUnit } from '../../models/archival-profile-unit'; import { NoticeService } from '../../core/services/notice.service'; import { map } from 'rxjs/operators'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ProfilePreviewComponent } from '../profile-preview/profile-preview.component'; import { PastisPopupOptionComponent } from '../../shared/pastis-popup-option/pastis-popup-option.component'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatMenuItem } from '@angular/material/menu'; import { FilterByStringNamePipe } from './pipes/filterByStringName.pipe'; import { FilterByTypePipe } from './pipes/filterByType.pipe'; @@ -143,10 +141,8 @@ const POPUP_UPLOAD_PATH = 'PROFILE.POP_UP_UPLOAD_FILE'; TranslatePipe, FilterByStringNamePipe, FilterByTypePipe, - ClosePopupDialogComponent, CommonConfirmDialogComponent, CommonModule, - DialogHeaderComponent, InfiniteScrollDirective, MatDialogModule, ], diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts index d3ced558786..e3b0447fb1a 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-information-tab/profile-information-tab/profile-information-tab.component.ts @@ -34,14 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError } from 'rxjs/operators'; import { ProfileService } from '../../../../core/services/profile.service'; import { ProfileType } from '../../../../models/profile-type.enum'; -import { SnackBarService } from 'vitamui-library'; -import { MiscValidators, SlideToggleComponent, InputComponent } from 'vitamui-library'; +import { InputComponent, MiscValidators, SlideToggleComponent, SnackBarService } from 'vitamui-library'; import type { Profile } from '../../../../models/profile'; import type { ArchivalProfileUnit } from '../../../../models/archival-profile-unit'; import type { ProfileDescription } from '../../../../models/profile-description.model'; diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts index 830083c4b87..4e25cd72b3c 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/profile-preview/profile-preview.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, forwardRef, HostListener, inject, Input, Output, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { ActivatedRoute, Router } from '@angular/router'; import { Observable } from 'rxjs'; -import { ConfirmActionComponent, SnackBarService } from 'vitamui-library'; -import { VitamuiMenuButtonComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { ConfirmActionComponent, SnackBarService, VitamuiMenuButtonComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { ProfileService } from '../../core/services/profile.service'; @@ -50,12 +49,11 @@ import { ProfileResponse } from '../../models/profile-response'; import { ProfileType } from '../../models/profile-type.enum'; import { ProfileInformationTabComponent } from './profile-information-tab/profile-information-tab/profile-information-tab.component'; import { MatMenuItem } from '@angular/material/menu'; -import { NgTemplateOutlet, CommonModule } from '@angular/common'; -import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { CommonModule, NgTemplateOutlet } from '@angular/common'; +import { MatProgressSpinner, MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; import { ReactiveFormsModule } from '@angular/forms'; -import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector @@ -73,10 +71,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; forwardRef(() => ProfilePreviewComponent), TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts b/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts index 00a137b9ce8..315a3eb36ba 100644 --- a/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/seda-visualizer/seda-visualizer.component.ts @@ -71,7 +71,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, inject, OnInit, ViewChild } from '@angular/core'; import * as d3 from 'd3'; import { map, tap } from 'rxjs/operators'; import { PastisApiService } from '../core/api/api.pastis.service'; diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts index ff86a7edcfd..29602e899cf 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-breadcrumb/pastis-breadcrumb.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { TenantSelectionService } from 'vitamui-library'; import { PastisConfiguration } from '../../../core/classes/pastis-configuration'; import { BreadcrumbDataMetadata } from '../../../models/breadcrumb'; diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts index 7cab285ac2f..38511b7524c 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-breadcrumb-components/pastis-title-breadcrumb/pastis-title-breadcrumb.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Location } from '@angular/common'; -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { PastisBreadcrumbComponent } from '../pastis-breadcrumb/pastis-breadcrumb.component'; //TODO: delete ? diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts index 7b6cba1bf13..72dbef8c1af 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component.ts @@ -71,15 +71,14 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { ComponentPortal, CdkPortalOutlet } from '@angular/cdk/portal'; -import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { CdkPortalOutlet, ComponentPortal } from '@angular/cdk/portal'; +import { Component, inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogClose, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { TranslateService } from '@ngx-translate/core'; import { PopupService } from '../../../core/services/popup.service'; import { SedaService } from '../../../core/services/seda.service'; import { PastisDialogData } from '../classes/pastis-dialog-data'; import { DialogHeaderComponent } from 'vitamui-library'; -import { CdkScrollable } from '@angular/cdk/scrolling'; const PASTIS_DIALOG_CONFIRM_TRANSLATE_PATH = 'PASTIS_DIALOG_CONFIRM'; @@ -88,7 +87,7 @@ const PASTIS_DIALOG_CONFIRM_TRANSLATE_PATH = 'PASTIS_DIALOG_CONFIRM'; selector: 'pastis-pastis-dialog-confirm', templateUrl: './pastis-dialog-confirm.component.html', styleUrls: ['./pastis-dialog-confirm.component.scss'], - imports: [DialogHeaderComponent, CdkScrollable, MatDialogContent, CdkPortalOutlet, MatDialogActions, MatDialogClose], + imports: [DialogHeaderComponent, MatDialogContent, CdkPortalOutlet, MatDialogActions, MatDialogClose], }) export class PastisDialogConfirmComponent implements OnInit { dialogConfirmRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts index 95684cd9e53..66c11e28d44 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-metadata-language/pastis-popup-metadata-language.component.ts @@ -72,7 +72,7 @@ The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { PastisPopupMetadataLanguageService } from './pastis-popup-metadata-language.service'; import { NgClass } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts index e2248077923..9ec10aad65e 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { LangChangeEvent, TranslatePipe, TranslateService } from '@ngx-translate/core'; import { environment } from 'projects/pastis/src/environments/environment'; import { Subscription } from 'rxjs'; import { NoticeService } from '../../core/services/notice.service'; diff --git a/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts b/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts index c825387e37f..3e38008caf4 100644 --- a/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts +++ b/ui/ui-frontend/projects/pastis/src/app/standalone/standalone-startup.service.ts @@ -34,10 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, of, Subject } from 'rxjs'; -import { AppConfiguration, AuthService, AuthUser, Logger, WINDOW_LOCATION } from 'vitamui-library'; -import { ApplicationId } from 'vitamui-library'; +import { AppConfiguration, ApplicationId, AuthService, AuthUser, Logger, WINDOW_LOCATION } from 'vitamui-library'; import { StandaloneThemeService } from './standalone-theme.service'; const WARNING_DURATION = 2000; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts index 0686f295e3c..968de6ec026 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-metadata/add-metadata.component.ts @@ -71,7 +71,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, Pipe, PipeTransform, TemplateRef, inject, forwardRef } from '@angular/core'; +import { Component, forwardRef, inject, OnDestroy, OnInit, Pipe, PipeTransform, TemplateRef } from '@angular/core'; import { MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { FileService } from '../../core/services/file.service'; @@ -83,7 +83,7 @@ import { ProfileType } from '../../models/profile-type.enum'; import { SedaCardinalityConstants, SedaData, SedaElementConstants } from '../../models/seda-data'; import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component'; import { PastisPopupMetadataLanguageService } from '../../shared/pastis-popup-metadata-language/pastis-popup-metadata-language.service'; -import { VitamuiBannerComponent, TooltipDirective } from 'vitamui-library'; +import { TooltipDirective, VitamuiBannerComponent } from 'vitamui-library'; import { MatDivider, MatList, MatSelectionList } from '@angular/material/list'; import { NgStyle } from '@angular/common'; import { FormsModule } from '@angular/forms'; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts index 4e5788a9fe1..e2cb7d13874 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/add-pua-control/add-pua-control.component.ts @@ -71,9 +71,9 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { MatDialogRef } from '@angular/material/dialog'; -import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { LangChangeEvent, TranslatePipe, TranslateService } from '@ngx-translate/core'; import { environment } from 'projects/pastis/src/environments/environment'; import { PopupService } from '../../core/services/popup.service'; import { PastisDialogData } from '../../shared/pastis-dialog/classes/pastis-dialog-data'; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts index b1faf191139..5bd764315ee 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/duplicate-metadata/duplicate-metadata.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { MatDialogRef } from '@angular/material/dialog'; import { PopupService } from '../../core/services/popup.service'; import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component'; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts index 713d93875d3..5438d4dd287 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/remove-metadata/remove-metadata.component.ts @@ -71,7 +71,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { MatDialogRef } from '@angular/material/dialog'; import { PopupService } from '../../core/services/popup.service'; import { PastisDialogConfirmComponent } from '../../shared/pastis-dialog/pastis-dialog-confirm/pastis-dialog-confirm.component'; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts index 1e3595b844c..594f24b7441 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, signal, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit, signal } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { MatDialogRef, MatDialogModule } from '@angular/material/dialog'; -import { TranslateService } from '@ngx-translate/core'; +import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { ProfileType } from '../../models/profile-type.enum'; -import { ApplicationService, Option } from 'vitamui-library'; -import { MiscValidators, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ApplicationService, MiscValidators, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { Notice } from '../../models/notice.model'; import { ProfileService } from '../../core/services/profile.service'; import { Subscription } from 'rxjs'; @@ -51,7 +50,6 @@ import { PastisGenericPopupComponent } from '../../shared/pastis-generic-popup/p import { Router } from '@angular/router'; import { FileService } from '../../core/services/file.service'; import { IdentifierExistsValidator } from '../../validators/IdentifierExistsValidator'; -import { TranslatePipe } from '@ngx-translate/core'; @Component({ imports: [ diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts index 2a348ab91b8..188279d6d31 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts @@ -76,8 +76,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, StartupService } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule, StartupService } from 'vitamui-library'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { ProfileService } from '../../core/services/profile.service'; import { FileTreeMetadataService } from '../../profile/edit-profile/file-tree-metadata/file-tree-metadata.service'; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts index 2c4f28ead24..06f2776b4c2 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.ts @@ -71,13 +71,12 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, OnDestroy, OnInit, Output } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { Router } from '@angular/router'; import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; import { EMPTY, filter, mergeMap, Observable, of, Subscription } from 'rxjs'; -import { SnackBarService, StartupService } from 'vitamui-library'; -import { ApplicationId } from 'vitamui-library'; +import { ApplicationId, SnackBarService, StartupService } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { FileService } from '../../core/services/file.service'; import { NoticeService } from '../../core/services/notice.service'; diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts index 5e6c9a09bde..4a6a3621c87 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/select-notice/select-notice.component.ts @@ -34,17 +34,15 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; -import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Component, inject, OnInit } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; +import { LangChangeEvent, TranslatePipe, TranslateService } from '@ngx-translate/core'; import { ProfileService } from '../../core/services/profile.service'; import { ProfileDescription } from '../../models/profile-description.model'; import { ProfileType } from '../../models/profile-type.enum'; import { PastisDialogDataCreate } from '../save-profile/save-profile.component'; -import { Option } from 'vitamui-library'; -import { DialogHeaderComponent, SelectComponent } from 'vitamui-library'; +import { DialogHeaderComponent, Option, SelectComponent } from 'vitamui-library'; import { FormsModule } from '@angular/forms'; -import { CdkScrollable } from '@angular/cdk/scrolling'; const POPUP_CREATION_CHOICE_PATH = 'PROFILE.POP_UP_CREATION_NOTICE.CHOICE'; @@ -58,7 +56,7 @@ function constantToTranslate() { selector: 'select-notice', templateUrl: './select-notice.component.html', styleUrls: ['./select-notice.component.scss'], - imports: [DialogHeaderComponent, FormsModule, CdkScrollable, MatDialogContent, SelectComponent, MatDialogActions, TranslatePipe], + imports: [DialogHeaderComponent, FormsModule, MatDialogContent, SelectComponent, MatDialogActions, TranslatePipe], }) export class SelectNoticeComponent implements OnInit { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/pastis/src/main.ts b/ui/ui-frontend/projects/pastis/src/main.ts index 9017b9df914..909a576fe1f 100644 --- a/ui/ui-frontend/projects/pastis/src/main.ts +++ b/ui/ui-frontend/projects/pastis/src/main.ts @@ -34,22 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID, provideAppInitializer, inject, importProvidersFrom } from '@angular/core'; -import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, inject, LOCALE_ID, provideAppInitializer } from '@angular/core'; +import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { PastisConfigurationFactory } from './app/app.module'; import { environment } from './environments/environment'; import { - provideI18n, - WINDOW_LOCATION, + AuthenticationModule, BASE_URL, ENVIRONMENT, - AuthenticationModule, - ThemeService, - StartupService, InjectorModule, LoggerModule, + provideI18n, + StartupService, + ThemeService, VitamUICommonModule, + WINDOW_LOCATION, } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { PastisConfiguration } from './app/core/classes/pastis-configuration'; diff --git a/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts b/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts index c4ac5d45f39..97ea58c8caf 100644 --- a/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts +++ b/ui/ui-frontend/projects/portal/src/app/app-routing.module.ts @@ -36,8 +36,7 @@ */ import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; -import { AccountComponent, AnalyticsResolver, AppGuard, AuthGuard } from 'vitamui-library'; -import { ApplicationId } from 'vitamui-library'; +import { AccountComponent, AnalyticsResolver, AppGuard, ApplicationId, AuthGuard } from 'vitamui-library'; import { PortalComponent } from './portal/portal.component'; const routes: Routes = [ diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index d50517c3705..3046a9fd168 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -40,8 +40,7 @@ import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { ActivatedRoute, Router } from '@angular/router'; import { EMPTY, Observable, of } from 'rxjs'; -import { AuthService, BASE_URL, ENVIRONMENT, StartupService } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AuthService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../environments/environment.prod'; diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.ts b/ui/ui-frontend/projects/portal/src/app/app.component.ts index c46c98cbf45..9c1ff90d0f5 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.ts @@ -34,9 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { Logger, StartupService } from 'vitamui-library'; -import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { Component, inject, OnInit } from '@angular/core'; +import { FooterComponent, HeaderModule, Logger, StartupService, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library'; import { RouterOutlet } from '@angular/router'; @Component({ diff --git a/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts b/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts index 53c10a0b86c..b25ad86ec8b 100644 --- a/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts +++ b/ui/ui-frontend/projects/portal/src/app/components/content-list/content-list.component.ts @@ -36,8 +36,7 @@ */ import { Component, Input, ViewChild } from '@angular/core'; import { MatTabGroup, MatTabsModule } from '@angular/material/tabs'; -import { Category } from 'vitamui-library'; -import { VitamUICommonModule } from 'vitamui-library'; +import { Category, VitamUICommonModule } from 'vitamui-library'; import { ContentTypeEnum } from './content.enum'; import { Content } from './content.interface'; import { CommonModule } from '@angular/common'; diff --git a/ui/ui-frontend/projects/portal/src/main.ts b/ui/ui-frontend/projects/portal/src/main.ts index ffcaeb236fa..33134272685 100644 --- a/ui/ui-frontend/projects/portal/src/main.ts +++ b/ui/ui-frontend/projects/portal/src/main.ts @@ -34,20 +34,20 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID, TransferState, importProvidersFrom } from '@angular/core'; -import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, LOCALE_ID, TransferState } from '@angular/core'; +import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { ApplicationSvgLoaderFactory } from './app/app.module'; import { environment } from './environments/environment'; import { - provideI18n, + AuthenticationModule, BASE_URL, ENVIRONMENT, - WINDOW_LOCATION, - AuthenticationModule, - VitamUICommonModule, InjectorModule, LoggerModule, + provideI18n, + VitamUICommonModule, + WINDOW_LOCATION, } from 'vitamui-library'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { PortalModule } from './app/portal/portal.module'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts index 4f924923f13..43096624d46 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts @@ -34,25 +34,25 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { finalize, merge, Subject } from 'rxjs'; import { debounceTime, takeUntil } from 'rxjs/operators'; import { AccessContract, + AccessContractService, DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, - PageRequest, - AccessContractService, - TableFilterDirective, OrderByButtonComponent, + PageRequest, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - PipesModule, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts index 1834727483c..dcfbd23d88d 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.spec.ts @@ -41,8 +41,7 @@ import { of } from 'rxjs'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractAuthorizationsTabComponent } from './access-contract-authorizations-tab.component'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; -import { AccessContract, AgencyService } from 'vitamui-library'; -import { Status } from 'vitamui-library'; +import { AccessContract, AgencyService, Status } from 'vitamui-library'; describe('AccessContractUsageAndServicesTabComponent', () => { let component: AccessContractAuthorizationsTabComponent; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts index 033ee3d03b4..9fffbfaed59 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-tab.component.ts @@ -34,10 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; import { FormGroup } from '@angular/forms'; -import { AccessContract, AccessContractDisplay, Option, VitamuiSelectOptions, AccessRightType, AgencyService } from 'vitamui-library'; -import { accessRightTypeOf } from 'vitamui-library'; +import { + AccessContract, + AccessContractDisplay, + AccessRightType, + accessRightTypeOf, + AgencyService, + Option, + VitamuiSelectOptions, +} from 'vitamui-library'; import { MatDialog } from '@angular/material/dialog'; import { AccessContractAuthorizationsUpdateComponent } from './access-contract-authorizations-update/access-contract-authorizations-update.component'; import { RULE_TYPES } from '../../../rule/rules.constants'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts index 3ca642de045..bdd6c79e731 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts @@ -38,8 +38,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { AccessContractService, AgencyService } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AccessContractService, AgencyService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractAuthorizationsUpdateComponent } from './access-contract-authorizations-update.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts index 9d4ef0e3bf0..fe51494f8d7 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.ts @@ -34,27 +34,26 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, ValidationErrors, ValidatorFn, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, ValidationErrors, ValidatorFn } from '@angular/forms'; import { AccessContract, - AccessRightType, - Option, - VitamuiSelectOptions, AccessContractDisplay, AccessContractService, + AccessRightType, AgencyService, DialogHeaderComponent, + NextStepComponent, + Option, + PreviousStepComponent, SelectComponent, SlideToggleComponent, TooltipDirective, - NextStepComponent, - PreviousStepComponent, + VitamuiSelectOptions, } from 'vitamui-library'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { RULE_TYPES } from '../../../../rule/rules.constants'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ @@ -64,7 +63,6 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ DialogHeaderComponent, ReactiveFormsModule, - CdkScrollable, MatDialogContent, MatRadioGroup, MatRadioButton, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts index c7c893ca1c2..6fe74e154c8 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-information-tab/access-contract-information-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { AccessContract, Option, AccessContractService } from 'vitamui-library'; -import { diff, SlideToggleComponent, InputComponent, PipesModule } from 'vitamui-library'; +import { AccessContract, AccessContractService, diff, InputComponent, Option, PipesModule, SlideToggleComponent } from 'vitamui-library'; import { RULE_TYPES } from '../../../rule/rules.constants'; import { AccessContractCreateValidators } from '../../access-contract-create/access-contract-create.validators'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts index f1179a76e01..b875e161817 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.ts @@ -35,10 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders } from '@angular/common/http'; -import { Component, Input, inject } from '@angular/core'; +import { Component, inject, Input } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { AccessContract, ExternalParametersService, SearchUnitApiService, SnackBarService } from 'vitamui-library'; -import { ExternalParameters, VitamuiHttpHeaders } from 'vitamui-library'; +import { + AccessContract, + ExternalParameters, + ExternalParametersService, + SearchUnitApiService, + SnackBarService, + VitamuiHttpHeaders, +} from 'vitamui-library'; import { AccessContractNodeUpdateComponent } from './access-contract-nodes-update/access-contract-node-update.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts index f96bca213ca..644961fcdfe 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.ts @@ -34,19 +34,18 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { AccessContract, - FilingPlanMode, AccessContractService, DialogHeaderComponent, + FilingPlanComponent, + FilingPlanMode, SlideToggleComponent, TooltipDirective, - FilingPlanComponent, } from 'vitamui-library'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { TranslatePipe } from '@ngx-translate/core'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatButtonModule } from '@angular/material/button'; @@ -61,7 +60,6 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; imports: [ DialogHeaderComponent, ReactiveFormsModule, - CdkScrollable, MatDialogContent, SlideToggleComponent, TooltipDirective, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts index 0ccee35a808..070106c3ea3 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-preview.component.ts @@ -34,12 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, forwardRef, HostListener, inject, Input, Output, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { AccessContract, AccessContractService, ConfirmActionComponent } from 'vitamui-library'; -import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; +import { + AccessContract, + AccessContractService, + ConfirmActionComponent, + OperationHistoryTabComponent, + VitamuiSidenavHeaderComponent, +} from 'vitamui-library'; import { AccessContractInformationTabComponent } from './access-contract-information-tab/access-contract-information-tab.component'; import { AccessContractAuthorizationsTabComponent } from './access-contract-authorizations-tab/access-contract-authorizations-tab.component'; import { AccessContractWriteAccessTabComponent } from './access-contract-write-access-tab/access-contract-write-access-tab.component'; @@ -65,10 +70,8 @@ import { CommonModule } from '@angular/common'; forwardRef(() => AccessContractPreviewComponent), TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts index 8e904c40368..af07cde09c1 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-write-access-tab/access-contract-write-access-tab.component.ts @@ -34,14 +34,21 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, inject, Input, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { AccessContract, Option, AccessContractService } from 'vitamui-library'; -import { diff, SlideToggleComponent, TooltipDirective, SelectComponent } from 'vitamui-library'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { + AccessContract, + AccessContractService, + diff, + Option, + SelectComponent, + SlideToggleComponent, + TooltipDirective, +} from 'vitamui-library'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index 4bb644b0e61..d89532ce37e 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -39,8 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { AccessContractService, ApplicationService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AccessContractService, ApplicationService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts index d3e86d7bc9e..d9d09707706 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts @@ -38,7 +38,7 @@ import { HttpResponse } from '@angular/common/http'; import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { AccessContract, AccessContractService, @@ -48,9 +48,9 @@ import { GlobalEventService, SidenavPage, SnackBarService, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, VitamuiMenuButtonComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; @@ -60,7 +60,7 @@ import { DownloadSnackBarService } from '../core/service/download-snack-bar.serv import { AccessContractCreateComponent } from './access-contract-create/access-contract-create.component'; import { AccessContractListComponent } from './access-contract-list/access-contract-list.component'; import { finalize, shareReplay } from 'rxjs/operators'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { AccessContractPreviewComponent } from './access-contract-preview/access-contract-preview.component'; import { MatMenuItem } from '@angular/material/menu'; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts index d0d6e7058a8..0dc3666e037 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-advanced-search/accession-register-advanced-search.component.ts @@ -34,13 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewChecked, ChangeDetectorRef, Component, EventEmitter, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { AfterViewChecked, ChangeDetectorRef, Component, EventEmitter, inject, OnDestroy, OnInit, Output } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Observable, Subscription } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { OjectUtils, VitamuiMultiInputsModule, SelectComponent } from 'vitamui-library'; +import { OjectUtils, SelectComponent, VitamuiMultiInputsModule } from 'vitamui-library'; import { AccessionRegistersService } from '../accession-register.service'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; import { AsyncPipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts index dff2b7dec77..2c62674984d 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-facets/accession-register-facets.component.ts @@ -34,10 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core'; import { Observable } from 'rxjs'; -import { FacetDetails } from 'vitamui-library'; -import { VitamUICommonModule, LogbookOperationFacetComponent } from 'vitamui-library'; +import { FacetDetails, LogbookOperationFacetComponent, VitamUICommonModule } from 'vitamui-library'; import { AccessionRegistersService } from '../accession-register.service'; import { AsyncPipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts index 64c77f7f077..c266e871f1c 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts @@ -39,8 +39,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { BehaviorSubject, Observable, of } from 'rxjs'; -import { SearchService } from 'vitamui-library'; -import { Direction, InfiniteScrollTable, PageRequest } from 'vitamui-library'; +import { Direction, InfiniteScrollTable, PageRequest, SearchService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessionRegistersService } from '../accession-register.service'; import { AccessionRegisterListComponent } from './accession-register-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts index 954022f30ce..24b263d00cd 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.ts @@ -34,26 +34,26 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, LOCALE_ID, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, LOCALE_ID, OnDestroy, OnInit, Output } from '@angular/core'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { withLatestFrom } from 'rxjs/operators'; import { AccessionRegisterDetail, DEFAULT_PAGE_SIZE, Direction, + InfiniteScrollDirective, InfiniteScrollTable, OjectUtils, - PageRequest, OrderByButtonComponent, + PageRequest, + PipesModule, TableFilterDirective, TableFilterSearchComponent, TooltipDirective, - PipesModule, - InfiniteScrollDirective, } from 'vitamui-library'; import { AccessionRegisterSearchDto } from '../../models/accession-register-export-csv.interface'; import { AccessionRegistersService } from '../accession-register.service'; -import { NgClass, AsyncPipe, CommonModule } from '@angular/common'; +import { AsyncPipe, CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts index d4092f375af..4e2cf34a6de 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-detail/accession-register-detail.component.ts @@ -36,7 +36,7 @@ */ import { Component, Input, OnInit } from '@angular/core'; import type { AccessionRegisterDetail } from 'vitamui-library'; -import { DataComponent, TooltipDirective } from 'vitamui-library'; +import { DataComponent } from 'vitamui-library'; import { DatePipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; @@ -44,7 +44,7 @@ import { TranslatePipe } from '@ngx-translate/core'; selector: 'app-accession-register-detail', templateUrl: './accession-register-detail.component.html', styleUrls: ['./accession-register-detail.component.scss'], - imports: [DataComponent, DatePipe, TranslatePipe, TooltipDirective], + imports: [DataComponent, DatePipe, TranslatePipe], }) export class AccessionRegisterDetailComponent implements OnInit { @Input() diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts index 85773e3150e..ffc4c5124c4 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.spec.ts @@ -42,8 +42,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RegisterValueEventModel } from 'vitamui-library'; -import { InjectorModule, LoggerModule, RegisterValueEventType } from 'vitamui-library'; +import { InjectorModule, LoggerModule, RegisterValueEventModel, RegisterValueEventType } from 'vitamui-library'; import { AccessionRegisterOperationsListComponent } from './accession-register-operations-list.component'; export class AccessionRegisterFixtures { diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts index 2164905b6fb..fb6750c0fee 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-operations-list/accession-register-operations-list.component.ts @@ -34,16 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Component, inject, Input, OnChanges, SimpleChanges } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Direction, + OrderByButtonComponent, RegisterValueEventModel, RegisterValueEventType, - TableFilterDirective, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - OrderByButtonComponent, } from 'vitamui-library'; import { DatePipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts index c6fd09ab1ac..1aabaade505 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, EventEmitter, Input, Output } from '@angular/core'; -import { AccessionRegisterDetail } from 'vitamui-library'; -import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { AccessionRegisterDetail, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { AccessionRegisterDetailComponent } from './accession-register-detail/accession-register-detail.component'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { AccessionRegisterOperationsListComponent } from './accession-register-operations-list/accession-register-operations-list.component'; import { TranslatePipe } from '@ngx-translate/core'; import { ReactiveFormsModule } from '@angular/forms'; @@ -56,10 +55,8 @@ import { CommonModule } from '@angular/common'; AccessionRegisterOperationsListComponent, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts index 1be77e736ba..81dd67612e3 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -43,12 +43,12 @@ import { ExternalParameters, ExternalParametersService, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { AccessionRegistersService } from './accession-register.service'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; -import { NgClass, AsyncPipe } from '@angular/common'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; +import { AsyncPipe, NgClass } from '@angular/common'; import { AccessionRegisterPreviewComponent } from './accession-register-preview/accession-register-preview.component'; import { AccessionRegisterAdvancedSearchComponent } from './accession-register-advanced-search/accession-register-advanced-search.component'; import { AccessionRegisterFacetsComponent } from './accession-register-facets/accession-register-facets.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts index 52b648881c6..4307c031d1a 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.module.ts @@ -36,7 +36,7 @@ */ import { CommonModule } from '@angular/common'; import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MatCardModule } from '@angular/material/card'; import { MatCheckboxModule } from '@angular/material/checkbox'; @@ -51,7 +51,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; import { RouterModule } from '@angular/router'; -import { VitamUICommonModule, VitamUILibraryModule, RoleComponent, RoleToggleComponent, SlideToggleComponent } from 'vitamui-library'; +import { RoleComponent, RoleToggleComponent, SlideToggleComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { GroupAttributionModule } from '../../../../identity/src/app/user/group-attribution/group-attribution.module'; import { AccessionRegisterAdvancedSearchComponent } from './accession-register-advanced-search/accession-register-advanced-search.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts index 39ac123ba22..45013d20227 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts @@ -41,8 +41,7 @@ import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { AccessContractService } from 'vitamui-library'; -import { DslQueryType, InjectorModule, LoggerModule, SnackBarService, VitamUILibraryModule } from 'vitamui-library'; +import { AccessContractService, DslQueryType, InjectorModule, LoggerModule, SnackBarService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AdminDslComponent } from './admin-dsl.component'; import { AdminDslService } from './admin-dsl.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts index a644abce94b..b44889c23ab 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.ts @@ -36,22 +36,22 @@ */ import { Clipboard } from '@angular/cdk/clipboard'; import { Component, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { + AccessContractService, AppRootComponent, DslQueryType, + InputComponent, Option, + SelectComponent, SnackBarService, - AccessContractService, VitamuiTitleBreadcrumbComponent, - SelectComponent, - InputComponent, } from 'vitamui-library'; import { AdminDslService } from './admin-dsl.service'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; @Component({ selector: 'app-admin-dsl', diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts index 2dccbbaeef8..1a304cc006c 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.service.ts @@ -35,11 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpErrorResponse, HttpHeaders } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { of } from 'rxjs'; import { catchError } from 'rxjs/operators'; -import { SearchUnitApiService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { SearchUnitApiService, VitamuiHttpHeaders } from 'vitamui-library'; @Injectable({ providedIn: 'root', diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts index 45ce97ce421..bc00fbef5f3 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts @@ -46,8 +46,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { AgencyService } from 'vitamui-library'; +import { AgencyService, ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AgencyCreateComponent } from './agency-create.component'; import { AgencyCreateValidators } from './agency-create.validators'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts index 08acc139cf9..193edae4ff7 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.ts @@ -34,13 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; -import { Agency, ConfirmDialogService, AgencyService } from 'vitamui-library'; -import { DialogHeaderComponent, InputComponent } from 'vitamui-library'; +import { Component, inject, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; +import { Agency, AgencyService, ConfirmDialogService, DialogHeaderComponent, InputComponent } from 'vitamui-library'; import { AgencyCreateValidators } from './agency-create.validators'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; @@ -50,7 +48,6 @@ import { TranslatePipe } from '@ngx-translate/core'; styleUrls: ['./agency-create.component.scss'], imports: [ DialogHeaderComponent, - CdkScrollable, MatDialogContent, ReactiveFormsModule, InputComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index 04a38e7a4c9..a72af86d863 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -42,8 +42,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute } from '@angular/router'; import { TranslateLoader } from '@ngx-translate/core'; import { EMPTY, of } from 'rxjs'; -import { AgencyService, AuthService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { AgencyService, AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AgencyListComponent } from './agency-list.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts index 39971d79a01..b8e178832dd 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts @@ -39,8 +39,9 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { merge, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map, takeUntil, tap } from 'rxjs/operators'; -import { AdminUserProfile, Agency } from 'vitamui-library'; import { + AdminUserProfile, + Agency, AgencyService, ApplicationId, DEFAULT_PAGE_SIZE, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts index d2dc9210bf5..395069155a4 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.ts @@ -34,14 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { finalize, Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { isEmpty } from 'underscore'; -import { Agency, SecurityService, AgencyService } from 'vitamui-library'; -import { ApplicationId, Role, diff, VitamUICommonModule } from 'vitamui-library'; +import { Agency, AgencyService, ApplicationId, diff, Role, SecurityService, VitamUICommonModule } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; import { AsyncPipe } from '@angular/common'; import { AgencyCreateValidators } from '../../agency-create/agency-create.validators'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts index 7e8e7e3e4cb..36cc741e428 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-preview.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, HostListener, inject, Input, Output, ViewChild } from '@angular/core'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader, MatTabsModule } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { AgencyService, ConfirmActionComponent, Agency } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { Agency, AgencyService, ConfirmActionComponent, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { AgencyInformationTabComponent } from './agency-information-tab/agency-information-tab.component'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index 39869571e63..156230db653 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -40,8 +40,7 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { AgencyService, BASE_URL, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AgencyService, BASE_URL, InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts index d6d3c6c3bc5..c398eefdae8 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts @@ -68,7 +68,6 @@ import { map } from 'rxjs/operators'; templateUrl: './agency.component.html', styleUrls: ['./agency.component.scss'], imports: [ - AgencyCreateComponent, AgencyListComponent, AgencyPreviewComponent, MatMenuItem, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts index c23b4b826fb..3fbb9d08b17 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.schema.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { ProfiledSchemaElement } from 'vitamui-library'; -import { Collection } from 'vitamui-library'; +import { Collection, ProfiledSchemaElement } from 'vitamui-library'; export const schema: ProfiledSchemaElement[] = [ { diff --git a/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts b/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts index 2585326ac58..fd6aef31d6e 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { SecurityService, TenantSelectionService } from 'vitamui-library'; -import { ApplicationId, Role } from 'vitamui-library'; +import { ApplicationId, Role, SecurityService, TenantSelectionService } from 'vitamui-library'; import { inject } from '@angular/core'; import { CanActivateFn, Router } from '@angular/router'; import { Observable, of } from 'rxjs'; import { catchError, map } from 'rxjs/operators'; -import { ROUTES, ERROR_MESSAGES } from './edit-agency.constants'; +import { ERROR_MESSAGES, ROUTES } from './edit-agency.constants'; const accessDenied = (router: Router): Observable => { router.navigateByUrl(ROUTES.ACCESS_DENIED); diff --git a/ui/ui-frontend/projects/referential/src/app/app.component.ts b/ui/ui-frontend/projects/referential/src/app/app.component.ts index eeebbe2a06f..195441a9241 100644 --- a/ui/ui-frontend/projects/referential/src/app/app.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/app.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; -import { HeaderModule, VitamuiBodyComponent, FooterComponent, SubrogationModule } from 'vitamui-library'; +import { FooterComponent, HeaderModule, SubrogationModule, VitamuiBodyComponent } from 'vitamui-library'; import { RouterOutlet } from '@angular/router'; @Component({ diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts index ef9edce9657..dbd2c6228e1 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts @@ -40,21 +40,21 @@ import { debounceTime, switchMap } from 'rxjs/operators'; import { DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, Event, + EventTypeLabelComponent, + InfiniteScrollDirective, InfiniteScrollTable, - PageRequest, - TableFilterDirective, OrderByButtonComponent, - EventTypeLabelComponent, + PageRequest, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - PipesModule, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; import { AUDIT_CATEGORY_FILTER_EV_TYPE, AuditCategoryFilter, AuditChainType, AuditOperation } from '../../models/audit.interface'; import { AuditService } from '../audit.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts index 7c0fdeec90f..7aeeec90237 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-information-tab/audit-information-tab.component.ts @@ -35,8 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input } from '@angular/core'; -import { Event } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule, PipesModule } from 'vitamui-library'; +import { Event, PipesModule, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { CommonModule } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts index 7c57388772d..eb86525141e 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts @@ -37,8 +37,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CUSTOM_ELEMENTS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ExternalParametersService, SnackBarService } from 'vitamui-library'; -import { ExternalParameters, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ExternalParameters, ExternalParametersService, LoggerModule, SnackBarService } from 'vitamui-library'; import { AuditPreviewComponent } from './audit-preview.component'; import { AuditService } from '../audit.service'; import { ActivatedRoute } from '@angular/router'; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts index c9a1639dc06..7157e18ed02 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, computed, EventEmitter, input, OnInit, Output, Signal, inject } from '@angular/core'; +import { Component, computed, EventEmitter, inject, input, OnInit, Output, Signal } from '@angular/core'; import { Event, ExternalParameters, diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts index aff77318f4d..efbce578661 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts @@ -46,8 +46,7 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, GlobalEventService } from 'vitamui-library'; -import { DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AuditComponent } from './audit.component'; import { DatePipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts index d900e237330..79beaa42b49 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts @@ -34,24 +34,24 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ViewChild, inject } from '@angular/core'; +import { Component, inject, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { + DatepickerComponent, Event, GlobalEventService, SearchBarComponent, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, - DatepickerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { AuditChainCreateComponent } from './audit-chain-create/audit-chain-create.component'; import { AuditCreateComponent } from './audit-create/audit-create.component'; import { AuditListComponent } from './audit-list/audit-list.component'; import { DateTime } from 'luxon'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { AuditPreviewComponent } from './audit-preview/audit-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts index 05a119b192f..353dfa20749 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts @@ -46,8 +46,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { OtpState } from 'vitamui-library'; +import { ConfirmDialogService, OtpState } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../context.service'; import { ContextCreateComponent } from './context-create.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts index 268253557d8..2d1f33e06ea 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService, Context, Option } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService, Context, Option, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { SecurityProfileService } from '../../security-profile/security-profile.service'; import { ContextService } from '../context.service'; import { ContextCreateValidators } from './context-create.validators'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts index d28e9b8f0a2..cff9a2a3c5d 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-edit-permission/context-edit-permission.component.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, forwardRef, Input, OnInit, Output, inject } from '@angular/core'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { AccessContractService, AuthService, ContextPermission, Option, Tenant, TooltipDirective, SelectComponent } from 'vitamui-library'; +import { Component, EventEmitter, forwardRef, inject, Input, OnInit, Output } from '@angular/core'; +import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; +import { AccessContractService, AuthService, ContextPermission, Option, SelectComponent, Tenant, TooltipDirective } from 'vitamui-library'; import { CustomerApiService } from '../../../core/api/customer-api.service'; import { TenantApiService } from '../../../core/api/tenant-api.service'; import { IngestContractService } from '../../../ingest-contract/ingest-contract.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts index cfd234095d2..a66cacc45b3 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-edit/context-edit.component.ts @@ -34,14 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { ContextPermission, DialogHeaderComponent } from 'vitamui-library'; +import { ConfirmDialogService, ContextPermission, DialogHeaderComponent } from 'vitamui-library'; import { ContextCreateValidators } from '../context-create/context-create.validators'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { ContextEditPermissionComponent } from '../context-create/context-edit-permission/context-edit-permission.component'; import { TranslatePipe } from '@ngx-translate/core'; @@ -49,15 +47,7 @@ import { TranslatePipe } from '@ngx-translate/core'; selector: 'app-context-edit', templateUrl: './context-edit.component.html', styleUrls: ['./context-edit.component.scss'], - imports: [ - DialogHeaderComponent, - ReactiveFormsModule, - CdkScrollable, - MatDialogContent, - ContextEditPermissionComponent, - MatDialogActions, - TranslatePipe, - ], + imports: [DialogHeaderComponent, ReactiveFormsModule, MatDialogContent, ContextEditPermissionComponent, MatDialogActions, TranslatePipe], }) export class ContextEditComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts index eddbf167a8a..2e6120f9fae 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts @@ -42,8 +42,7 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; -import { AuthService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AuthService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../context.service'; import { ContextListComponent } from './context-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts index 716c0dfc71d..84c8d6ba1b0 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts @@ -34,26 +34,28 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { merge, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map, takeUntil, tap } from 'rxjs/operators'; import { + AdminUserProfile, + Context, + DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, - PageRequest, - DEFAULT_PAGE_SIZE, - TableFilterDirective, OrderByButtonComponent, + PageRequest, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - PipesModule, - EllipsisDirective, - InfiniteScrollDirective, + User, } from 'vitamui-library'; -import type { Context, User, AdminUserProfile } from 'vitamui-library'; import { ContextService } from '../context.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts index a534db3990f..f8032a8c81a 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-information-tab/context-information-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap, tap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Context, Option } from 'vitamui-library'; -import { diff, SlideToggleComponent, InputComponent, SelectComponent, DatepickerComponent } from 'vitamui-library'; +import { Context, DatepickerComponent, diff, InputComponent, Option, SelectComponent, SlideToggleComponent } from 'vitamui-library'; import { RULE_TYPES } from '../../../rule/rules.constants'; import { SecurityProfileService } from '../../../security-profile/security-profile.service'; import { ContextService } from '../../context.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts index b15289f1821..58121c3e6e8 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts @@ -41,8 +41,7 @@ import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY } from 'rxjs'; -import { BASE_URL, Context, ContextPermission, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, Context, ContextPermission, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../../context.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts index 5ed6bba7a74..09bc319058f 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.ts @@ -34,12 +34,21 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { Observable, forkJoin, of } from 'rxjs'; +import { forkJoin, Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap, tap } from 'rxjs/operators'; -import { AccessContract, Context, Customer, IngestContract, Tenant, AccessContractService, AuthService } from 'vitamui-library'; -import { ContextPermission, diff } from 'vitamui-library'; +import { + AccessContract, + AccessContractService, + AuthService, + Context, + ContextPermission, + Customer, + diff, + IngestContract, + Tenant, +} from 'vitamui-library'; import { extend, isEmpty } from 'underscore'; import { CustomerApiService } from '../../../core/api/customer-api.service'; import { TenantApiService } from '../../../core/api/tenant-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts index b64c92a9642..415e8f6d075 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, forwardRef, HostListener, inject, Input, Output, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { Context, ConfirmActionComponent } from 'vitamui-library'; -import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; +import { ConfirmActionComponent, Context, OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { ContextService } from '../context.service'; import { ContextInformationTabComponent } from './context-information-tab/context-information-tab.component'; import { ContextPermissionTabComponent } from './context-permission-tab/context-permission-tab.component'; @@ -62,10 +61,8 @@ import { CommonModule } from '@angular/common'; forwardRef(() => ContextPreviewComponent), TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts index 75096d2d1ed..3e0a84985d4 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts @@ -40,8 +40,7 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { ApplicationService, GlobalEventService } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { ApplicationService, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.ts index 4083dabb987..7eb0fff2c80 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; @@ -43,15 +43,15 @@ import { Context, GlobalEventService, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ContextCreateComponent } from './context-create/context-create.component'; import { ContextListComponent } from './context-list/context-list.component'; import { shareReplay } from 'rxjs/operators'; import { firstValueFrom } from 'rxjs'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ContextPreviewComponent } from './context-preview/context-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.service.ts b/ui/ui-frontend/projects/referential/src/app/context/context.service.ts index 25cc977cb7b..2c4c688814b 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.service.ts @@ -35,11 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { Context, SearchService, SnackBarService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { Context, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; import { ContextApiService } from '../core/api/context-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts index dd2b0be208b..d7aedf608af 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { AgencyApiService, BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts index 2017f7160df..d11ae75bd13 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule } from 'vitamui-library'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CustomerApiService } from './customer-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts index c639eadec21..b2e9a38c26c 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { IngestContractApiService } from './ingest-contract-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts index 1a428d93b48..b4aebb8669c 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule } from 'vitamui-library'; import { LogbookManagementOperationApiService } from './logbook-management-operation-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts index d23184811fc..af5a18e1f5b 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts @@ -66,8 +66,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule } from 'vitamui-library'; import { ManagementContractsApiService } from './management-contracts-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts index 5ccf63657f9..633afc24727 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OntologyApiService } from './ontology-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts index 1583969ae44..593dbe0014a 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OperationApiService } from './operation-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts index 01045b6cdcd..2ea4848eca1 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.ts @@ -35,11 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable } from 'rxjs'; import { map, tap } from 'rxjs/operators'; -import { BASE_URL, PaginatedHttpClient, Event, PageRequest, PaginatedResponse } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { BASE_URL, Event, PageRequest, PaginatedHttpClient, PaginatedResponse, VitamuiHttpHeaders } from 'vitamui-library'; import { TraceabilityChainAuditRequest } from '../../models/audit.interface'; @Injectable({ diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts index dd2b0be208b..d7aedf608af 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { AgencyApiService, BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/core.module.ts b/ui/ui-frontend/projects/referential/src/app/core/core.module.ts index 0675f680c26..097c10ca4e3 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/core.module.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/core.module.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { InjectionToken, NgModule, inject } from '@angular/core'; +import { inject, InjectionToken, NgModule } from '@angular/core'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, throwIfAlreadyLoaded, VitamUICommonModule } from 'vitamui-library'; import { environment } from '../../environments/environment'; export declare const BASE_URL_IDENTITY: InjectionToken; diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts index 956c9353f77..8673c49a212 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.ts @@ -34,41 +34,31 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { map, tap } from 'rxjs/operators'; import { ConfirmDialogService, + DialogHeaderComponent, FILE_FORMAT_EXTERNAL_PREFIX, FileFormat, + InputComponent, Option, + SelectComponent, StartupService, VitamuiSelectOptions, - DialogHeaderComponent, - InputComponent, - SelectComponent, } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { FileFormatCreateValidators } from './file-format-create.validators'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-file-format-create', templateUrl: './file-format-create.component.html', styleUrls: ['./file-format-create.component.scss'], - imports: [ - DialogHeaderComponent, - ReactiveFormsModule, - CdkScrollable, - MatDialogContent, - InputComponent, - SelectComponent, - MatDialogActions, - TranslatePipe, - ], + imports: [DialogHeaderComponent, ReactiveFormsModule, MatDialogContent, InputComponent, SelectComponent, MatDialogActions, TranslatePipe], }) export class FileFormatCreateComponent implements OnInit, OnDestroy { dialogRef = inject>(MatDialogRef); diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts index bff138bf7e8..3331f3cd885 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts @@ -38,7 +38,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; -import { AuthService, BASE_URL, StartupService, SnackBarService } from 'vitamui-library'; +import { AuthService, BASE_URL, SnackBarService, StartupService } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { FileFormatListComponent } from './file-format-list.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts index 79014628dea..6c124aa8112 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts @@ -34,31 +34,28 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { Subject, merge } from 'rxjs'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { merge, Subject } from 'rxjs'; import { debounceTime, filter, takeUntil } from 'rxjs/operators'; import { AdminUserProfile, - FileFormat, - User, ConfirmActionComponent, DEFAULT_PAGE_SIZE, - FILE_FORMAT_EXTERNAL_PREFIX, - InfiniteScrollTable, - StartupService, - SnackBarService, -} from 'vitamui-library'; -import { + Direction, EllipsisDirective, - HasAnyRoleDirective, + FILE_FORMAT_EXTERNAL_PREFIX, + FileFormat, HasRoleDirective, InfiniteScrollDirective, - Direction, - PageRequest, + InfiniteScrollTable, OrderByButtonComponent, + PageRequest, PipesModule, + SnackBarService, + StartupService, + User, } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; @@ -77,7 +74,6 @@ const FILTER_DEBOUNCE_TIME_MS = 400; TranslatePipe, CommonModule, EllipsisDirective, - HasAnyRoleDirective, HasRoleDirective, InfiniteScrollDirective, ], diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts index 0fbd837c449..afb04f4324a 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.ts @@ -34,15 +34,24 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { formatDate, AsyncPipe } from '@angular/common'; -import { Component, EventEmitter, Input, LOCALE_ID, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { AsyncPipe, formatDate } from '@angular/common'; +import { Component, EventEmitter, inject, Input, LOCALE_ID, Output } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { BehaviorSubject, combineLatest, Observable, of, Subscription } from 'rxjs'; import { catchError, filter, map, switchMap, tap } from 'rxjs/operators'; import { extend, isEmpty, omit } from 'underscore'; -import { FileFormat, VitamuiSelectOptions, SecurityService, FILE_FORMAT_EXTERNAL_PREFIX } from 'vitamui-library'; -import { ApplicationId, Role, InputComponent, SelectComponent, diff } from 'vitamui-library'; +import { + ApplicationId, + diff, + FILE_FORMAT_EXTERNAL_PREFIX, + FileFormat, + InputComponent, + Role, + SecurityService, + SelectComponent, + VitamuiSelectOptions, +} from 'vitamui-library'; import { FileFormatService } from '../../file-format.service'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts index cd6b5458a0b..8063d9b75bc 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, forwardRef, HostListener, inject, Input, Output, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { ConfirmActionComponent, FileFormat } from 'vitamui-library'; -import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { ConfirmActionComponent, FileFormat, OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { FileFormatInformationTabComponent } from './file-format-information-tab/file-format-information-tab.component'; @@ -60,10 +59,8 @@ import { CommonModule } from '@angular/common'; forwardRef(() => FileFormatPreviewComponent), TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts index b8b1f3f99ce..39cbd4ec666 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts @@ -39,8 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { SecurityService, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts index 31f6da7dc42..55ee1b8899d 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts @@ -38,7 +38,7 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Observable, Subscription } from 'rxjs'; import { ApplicationId, @@ -48,14 +48,14 @@ import { Role, SecurityService, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; import { FileFormatCreateComponent } from './file-format-create/file-format-create.component'; import { FileFormatListComponent } from './file-format-list/file-format-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { FileFormatPreviewComponent } from './file-format-preview/file-format-preview.component'; import { AsyncPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts index 78128fb3240..21299f7fa44 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.service.ts @@ -35,11 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { FILE_FORMAT_EXTERNAL_PREFIX, FileFormat, SearchService, SnackBarService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { FILE_FORMAT_EXTERNAL_PREFIX, FileFormat, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; import { FileFormatApiService } from '../core/api/file-format-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts index b20a0cb6140..401e93932c9 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts @@ -34,26 +34,26 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { Subject, Subscription, merge } from 'rxjs'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { merge, Subject, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, IngestContract, - PageRequest, - TableFilterDirective, OrderByButtonComponent, + PageRequest, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - PipesModule, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; import { IngestContractService } from '../ingest-contract.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts index 05db70bd240..54e3341344d 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.ts @@ -35,10 +35,16 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders } from '@angular/common/http'; -import { Component, Input, inject } from '@angular/core'; +import { Component, inject, Input } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { IngestContract, ExternalParametersService, SearchUnitApiService, SnackBarService } from 'vitamui-library'; -import { ExternalParameters, VitamuiHttpHeaders } from 'vitamui-library'; +import { + ExternalParameters, + ExternalParametersService, + IngestContract, + SearchUnitApiService, + SnackBarService, + VitamuiHttpHeaders, +} from 'vitamui-library'; import { IngestContractNodeUpdateComponent } from './ingest-contract-nodes-update/ingest-contract-node-update.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts index 67db5fe99f3..4ae330f1d79 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts @@ -37,10 +37,9 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule, SnackBarService, FilingPlanComponent } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, FilingPlanComponent, InjectorModule, LoggerModule, SnackBarService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../../../environments/environment'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts index cbb070e81bd..867bb8ed098 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.ts @@ -34,23 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnInit } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { + DialogHeaderComponent, + FilingPlanComponent, FilingPlanMode, IngestContract, - DialogHeaderComponent, - StepperComponent, NextStepComponent, - TooltipDirective, PreviousStepComponent, - FilingPlanComponent, + StepperComponent, + TooltipDirective, } from 'vitamui-library'; import { IngestContractService } from '../../../ingest-contract.service'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { TranslatePipe } from '@ngx-translate/core'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatButtonModule } from '@angular/material/button'; @@ -67,7 +66,6 @@ import { MatCheckboxModule } from '@angular/material/checkbox'; ReactiveFormsModule, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, MatDialogActions, NextStepComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts index 4aa4c0e0730..f59ad7b7c1a 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-format-tab/ingest-contract-format-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { VitamuiSelectOptions, FileFormat, IngestContract } from 'vitamui-library'; -import { diff, SlideToggleComponent, SelectComponent } from 'vitamui-library'; +import { diff, FileFormat, IngestContract, SelectComponent, SlideToggleComponent, VitamuiSelectOptions } from 'vitamui-library'; import { FileFormatService } from '../../../file-format/file-format.service'; import { IngestContractService } from '../../ingest-contract.service'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts index 13b9c8e686f..79d3835a196 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-heritage-tab/ingest-contract-heritage-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { IngestContract } from 'vitamui-library'; -import { diff, SlideToggleComponent } from 'vitamui-library'; +import { diff, IngestContract, SlideToggleComponent } from 'vitamui-library'; import { IngestContractService } from '../../ingest-contract.service'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts index 62b87d42c2e..b8785651788 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-information-tab/ingest-contract-information-tab.component.ts @@ -35,13 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders, HttpParams } from '@angular/common/http'; -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Option, IngestContract } from 'vitamui-library'; -import { diff, VitamuiHttpHeaders, SlideToggleComponent, InputComponent, SelectComponent, PipesModule } from 'vitamui-library'; +import { + diff, + IngestContract, + InputComponent, + Option, + PipesModule, + SelectComponent, + SlideToggleComponent, + VitamuiHttpHeaders, +} from 'vitamui-library'; import { ArchiveProfileApiService } from '../../../core/api/archive-profile-api.service'; import { ManagementContractApiService } from '../../../core/api/management-contract-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts index 34a1f6d0e96..529ad5d73c7 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Option, IngestContract } from 'vitamui-library'; -import { diff, SlideToggleComponent, SelectComponent } from 'vitamui-library'; +import { diff, IngestContract, Option, SelectComponent, SlideToggleComponent } from 'vitamui-library'; import { IngestContractService } from '../../ingest-contract.service'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts index 80a6836c838..a2eed925d68 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-preview.component.ts @@ -38,20 +38,19 @@ import { AfterViewInit, Component, EventEmitter, + forwardRef, HostListener, + inject, Input, OnChanges, Output, SimpleChanges, ViewChild, - inject, - forwardRef, } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { ConfirmActionComponent, IngestContract } from 'vitamui-library'; -import { OperationHistoryTabComponent, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { ConfirmActionComponent, IngestContract, OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { IngestContractService } from '../ingest-contract.service'; import { IngestContractFormatTabComponent } from './ingest-contract-format-tab/ingest-contract-format-tab.component'; import { IngestContractHeritageTabComponent } from './ingest-contract-heritage-tab/ingest-contract-heritage-tab.component'; @@ -82,10 +81,8 @@ import { CommonModule } from '@angular/common'; forwardRef(() => IngestContractPreviewComponent), TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts index 2176a94481c..f8bdfa7bfdf 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-signature-tab/ingest-contract-signature-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, Output } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { EMPTY, Observable } from 'rxjs'; -import { IngestContract, SignaturePolicy } from 'vitamui-library'; -import { SignedDocumentPolicyEnum } from 'vitamui-library'; +import { IngestContract, SignaturePolicy, SignedDocumentPolicyEnum } from 'vitamui-library'; import { IngestContractService } from '../../ingest-contract.service'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { MatCheckbox } from '@angular/material/checkbox'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts index 00f1caf36e2..835ee350ecd 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts @@ -40,8 +40,7 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { ApplicationService, BASE_URL, GlobalEventService, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { ApplicationService, BASE_URL, GlobalEventService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts index 1815ae129fd..4791f0f9307 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts @@ -47,9 +47,9 @@ import { SecurityService, SidenavPage, SnackBarService, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, VitamuiMenuButtonComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { DownloadSnackBarService } from './../core/service/download-snack-bar.service'; import { firstValueFrom, Observable, Subscription } from 'rxjs'; @@ -57,11 +57,11 @@ import { mergeMap, shareReplay } from 'rxjs/operators'; import { IngestContractCreateComponent } from './ingest-contract-create/ingest-contract-create.component'; import { IngestContractListComponent } from './ingest-contract-list/ingest-contract-list.component'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; import { IngestContractService } from './ingest-contract.service'; import { HttpResponse } from '@angular/common/http'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { IngestContractPreviewComponent } from './ingest-contract-preview/ingest-contract-preview.component'; import { MatMenuItem } from '@angular/material/menu'; import { AsyncPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts index 384d933ebde..41b6caf8dc7 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.service.ts @@ -35,11 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders, HttpParams, HttpResponse } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { IngestContract, SearchService, SnackBarService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { IngestContract, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; import { IngestContractApiService } from '../core/api/ingest-contract-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts index 1af2b54963e..5e6fc16f506 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.ts @@ -34,24 +34,24 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, OnInit, Output, inject } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subscription } from 'rxjs'; import { Colors, + EventTypeLabelComponent, FacetDetails, + InfiniteScrollDirective, LogbookOperationFacetComponent, - TableFilterDirective, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, TooltipDirective, - EventTypeLabelComponent, - PipesModule, - InfiniteScrollDirective, } from 'vitamui-library'; import { OperationCategory, OperationDetails, OperationsResults } from '../../models/operation-response.interface'; import { LogbookManagementOperationService } from '../logbook-management-operation.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts index e40812bc792..7ee63dff946 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-information-tab/logbook-management-operation-information-tab.component.ts @@ -34,9 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; -import { LogbookService, IEvent } from 'vitamui-library'; -import { EventTypeLabelComponent, PipesModule } from 'vitamui-library'; +import { Component, inject, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; +import { EventTypeLabelComponent, IEvent, LogbookService, PipesModule } from 'vitamui-library'; import type { OperationDetails } from '../../../models/operation-response.interface'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts index 1fab59a18f5..46b461a37cf 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.ts @@ -34,28 +34,25 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { filter } from 'rxjs/operators'; import { LogbookManagementOperationService } from '../logbook-management-operation.service'; -import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms'; +import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms'; import type { OperationDetails } from '../../models/operation-response.interface'; import { - VitamuiMenuButtonComponent, DialogHeaderComponent, EventTypeLabelComponent, InputComponent, PipesModule, - CommonTooltipComponent, - TooltipDirective, + VitamuiMenuButtonComponent, VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { MatMenuItem } from '@angular/material/menu'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { LogbookManagementOperationInformationTabComponent } from './logbook-management-operation-information-tab/logbook-management-operation-information-tab.component'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @@ -70,7 +67,6 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; MatTab, LogbookManagementOperationInformationTabComponent, DialogHeaderComponent, - CdkScrollable, MatDialogContent, EventTypeLabelComponent, NgClass, @@ -81,9 +77,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; PipesModule, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts index 01af9511e5e..2678593314a 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts @@ -39,8 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, ENVIRONMENT, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; import { LogbookManagementOperationComponent } from './logbook-management-operation.component'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { provideNativeDateAdapter } from '@angular/material/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts index 7c52b43ceec..472e6599453 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.ts @@ -34,20 +34,20 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ActivatedRoute } from '@angular/router'; import { AuthService, + DatepickerComponent, DateService, FrenchDate, QueryParamsService, Tenant, - VitamuiTitleBreadcrumbComponent, - VitamuiBannerComponent, TooltipDirective, - DatepickerComponent, + VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { OperationDetails } from '../models/operation-response.interface'; import { LogbookManagementOperationListComponent } from './logbook-management-operation-list/logbook-management-operation-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index c68594aac89..e0ef8cd15f6 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -41,8 +41,7 @@ import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { AuthService, BASE_URL, ExternalParametersService, LogbookService } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { AuthService, BASE_URL, ExternalParametersService, InjectorModule, LogbookService, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperationDetailComponent } from './logbook-operation-detail.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts index 87bbb483c4c..7ee2003ace6 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.ts @@ -34,29 +34,27 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; import { AuthService, - IEvent, + EventTypeLabelComponent, ExternalParameters, ExternalParametersService, + HistoryEventsComponent, + IEvent, LogbookOperationReportState, LogbookOperationTypeProc, LogbookService, - SnackBarService, - EventTypeLabelComponent, - HistoryEventsComponent, PipesModule, - CommonTooltipComponent, - TooltipDirective, + SnackBarService, VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { IngestStatus } from '../../../../../ingest/src/app/models/logbook-event.interface'; import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperation } from '../logbook-operation.enum'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; import { TranslatePipe } from '@ngx-translate/core'; @@ -85,10 +83,8 @@ const defaultDownloadButtonLabel = 'LOGBOOK_OPERATION_DETAIL.DOWNLOAD_REPORT'; EventTypeBadgeColorPipe, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts index dfdd4f87980..d6257f36a6d 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-popup.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { LogbookOperationDetailComponent } from './logbook-operation-detail.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts index 7c1272afcd9..badedb6e9f0 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts @@ -34,24 +34,27 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { DEFAULT_PAGE_SIZE, IEvent, InfiniteScrollTable } from 'vitamui-library'; import { + DEFAULT_PAGE_SIZE, Direction, - PageRequest, - TableFilterDirective, - OrderByButtonComponent, + EllipsisDirective, EventTypeLabelComponent, + IEvent, + InfiniteScrollDirective, + InfiniteScrollTable, + OrderByButtonComponent, + PageRequest, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - PipesModule, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; import { Component, ElementRef, EventEmitter, + inject, Input, OnChanges, OnDestroy, @@ -60,7 +63,6 @@ import { SimpleChanges, TemplateRef, ViewChild, - inject, } from '@angular/core'; import { merge, Subject, Subscription } from 'rxjs'; @@ -69,7 +71,7 @@ import { EventFilter } from '../event-filter.interface'; import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperation } from '../logbook-operation.enum'; import { LogbookSearchService } from '../logbook-search.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts index 672aa808262..d2ba403351c 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts @@ -41,8 +41,7 @@ import { MatDialog } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { ActivatedRoute, Router } from '@angular/router'; import { EMPTY, of } from 'rxjs'; -import { ENVIRONMENT, GlobalEventService } from 'vitamui-library'; -import { DatepickerComponent, InjectorModule, LoggerModule, SearchBarComponent } from 'vitamui-library'; +import { DatepickerComponent, ENVIRONMENT, GlobalEventService, InjectorModule, LoggerModule, SearchBarComponent } from 'vitamui-library'; import { environment } from '../../environments/environment'; import { LogbookOperationComponent } from './logbook-operation.component'; import { LogbookSearchService } from './logbook-search.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts index fec294c59e9..55b2e1fde55 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts @@ -34,20 +34,20 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, OnInit, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Component, inject, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { + DatepickerComponent, GlobalEventService, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent, - DatepickerComponent, } from 'vitamui-library'; import { EventFilter } from './event-filter.interface'; import { LogbookOperationListComponent } from './logbook-operation-list/logbook-operation-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { LogbookOperationDetailComponent } from './logbook-operation-detail/logbook-operation-detail.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts index 133e3288aaa..f74bfcd31a6 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/components/create-persistent-identifier-policy-form/create-persistent-identifier-policy-form.component.ts @@ -34,15 +34,14 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core'; -import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { Option, PersistentIdentifierPolicyTypeEnum } from 'vitamui-library'; -import { SelectComponent, InputComponent, TooltipDirective } from 'vitamui-library'; +import { Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { InputComponent, Option, PersistentIdentifierPolicyTypeEnum, SelectComponent, TooltipDirective } from 'vitamui-library'; import { ManagementContractValidationErrors, ManagementContractValidators } from '../../validators/management-contract-validators'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { MatCheckbox } from '@angular/material/checkbox'; import { NgClass, NgStyle } from '@angular/common'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; @Component({ selector: 'app-create-persistent-identifier-policy-form', diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts index 12004a4d735..a703d4c7a00 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component.ts @@ -34,18 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core'; -import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; +import { AbstractControl, FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { ManagementContractValidationErrors, ManagementContractValidators, } from 'projects/referential/src/app/management-contract/validators/management-contract-validators'; -import { Option } from 'vitamui-library'; -import { InputComponent, SelectComponent, TooltipDirective } from 'vitamui-library'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { InputComponent, Option, SelectComponent, TooltipDirective } from 'vitamui-library'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { MatCheckbox } from '@angular/material/checkbox'; import { NgClass, NgStyle } from '@angular/common'; -import { MatRadioGroup, MatRadioButton } from '@angular/material/radio'; +import { MatRadioButton, MatRadioGroup } from '@angular/material/radio'; @Component({ selector: 'app-update-persistent-identifier-policy-form', diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index 77f74023f65..e3973bde2a6 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -43,8 +43,7 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { of, Subject } from 'rxjs'; -import { BASE_URL, ManagementContract, SearchService, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, ManagementContract, SearchService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../management-contract.service'; import { ManagementContractListComponent } from './management-contract-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts index 68f7ed1a6a7..18ca9bb5427 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts @@ -34,24 +34,24 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { Subject, Subscription, merge } from 'rxjs'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { merge, Subject, Subscription } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { DEFAULT_PAGE_SIZE, Direction, + InfiniteScrollDirective, InfiniteScrollTable, ManagementContract, + OrderByButtonComponent, PageRequest, - TableFilterDirective, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - OrderByButtonComponent, - PipesModule, - InfiniteScrollDirective, } from 'vitamui-library'; import { ManagementContractService } from '../management-contract.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts index 9cd2ca831db..e63a2213413 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-identification-tab/management-contract-identification-tab.component.ts @@ -34,16 +34,15 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnChanges, OnDestroy, Output, SimpleChanges, inject } from '@angular/core'; -import { FormArray, FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, Output, SimpleChanges } from '@angular/core'; +import { FormArray, FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of, Subscription } from 'rxjs'; import { mergeMap, tap } from 'rxjs/operators'; -import { ManagementContract, Option } from 'vitamui-library'; -import { PersistentIdentifierPolicyTypeEnum, SelectComponent, TooltipDirective } from 'vitamui-library'; +import { ManagementContract, Option, PersistentIdentifierPolicyTypeEnum, SelectComponent, TooltipDirective } from 'vitamui-library'; import { FormGroupToManagementContractConverterService } from '../../components/form-group-to-management-contract-converter.service'; import { ManagementContractToFormGroupConverterService } from '../../components/management-contract-to-form-group-converter.service'; import { ManagementContractService } from '../../management-contract.service'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { UpdatePersistentIdentifierPolicyFormComponent } from '../../components/update-persistent-identifier-policy-form/update-persistent-identifier-policy-form.component'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts index a3f49cd5c97..f77dad4e394 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts @@ -42,8 +42,7 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, IntermediaryVersionEnum, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; import { InputStubComponent, VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractInformationTabComponent } from './management-contract-information-tab.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts index 14808d6cdbd..ca9253536b2 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { ManagementContract } from 'vitamui-library'; -import { diff, SlideToggleComponent, InputComponent, PipesModule } from 'vitamui-library'; +import { diff, InputComponent, ManagementContract, PipesModule, SlideToggleComponent } from 'vitamui-library'; import { ManagementContractService } from '../../management-contract.service'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts index a77e96bce95..7da6b13d735 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts @@ -40,8 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractPreviewComponent } from './management-contract-preview.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts index a2155c945bb..a674bb3b88d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.ts @@ -39,12 +39,12 @@ import { Component, EventEmitter, HostListener, + inject, Input, OnChanges, Output, SimpleChanges, ViewChild, - inject, } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; @@ -52,14 +52,12 @@ import { Subscription } from 'rxjs'; import { tap } from 'rxjs/operators'; import { ConfirmActionComponent, - VitamuiMenuButtonComponent, + ManagementContract, OperationHistoryTabComponent, PipesModule, - CommonTooltipComponent, - TooltipDirective, + VitamuiMenuButtonComponent, VitamuiSidenavHeaderComponent, } from 'vitamui-library'; -import { ManagementContract } from 'vitamui-library'; import { ManagementContractIdentificationTabComponent } from './management-contract-identification-tab/management-contract-identification-tab.component'; import { ManagementContractInformationTabComponent } from './management-contract-information-tab/management-contract-information-tab.component'; import { ManagementContractStorageTabComponent } from './management-contract-storage-tab/management-contract-storage-tab.component'; @@ -84,10 +82,8 @@ import { CommonModule } from '@angular/common'; PipesModule, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts index 5872cc8aa8d..1af7f308ada 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts @@ -42,8 +42,7 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; -import { InjectorModule, IntermediaryVersionEnum, LoggerModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractStorageTabComponent } from './management-contract-storage-tab.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts index 1002e214f9c..7ccbda55303 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, Output, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { Observable, Subscription, of } from 'rxjs'; +import { Component, EventEmitter, inject, Input, OnDestroy, Output } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { Observable, of, Subscription } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { ManagementContract, StorageStrategy } from 'vitamui-library'; -import { diff, InputComponent } from 'vitamui-library'; +import { diff, InputComponent, ManagementContract, StorageStrategy } from 'vitamui-library'; import { ManagementContractService } from '../../management-contract.service'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts index 2bbc449a390..5bae990dbc8 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts @@ -44,8 +44,7 @@ import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { WINDOW_LOCATION } from 'vitamui-library'; -import { ApplicationService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ApplicationService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractComponent } from './management-contract.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts index b6b3f2ac361..15d229a3aeb 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ViewChild, inject } from '@angular/core'; +import { Component, inject, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { firstValueFrom } from 'rxjs'; @@ -43,14 +43,14 @@ import { GlobalEventService, ManagementContract, SidenavPage, - VitamuiTitleBreadcrumbComponent, - VitamuiBannerComponent, TooltipDirective, + VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ManagementContractCreateComponent } from './management-contract-create/management-contract-create.component'; import { ManagementContractListComponent } from './management-contract-list/management-contract-list.component'; import { shareReplay } from 'rxjs/operators'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ManagementContractPreviewComponent } from './management-contract-preview/management-contract-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts index 6906a1615e6..17cdc9cc57f 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.service.ts @@ -35,12 +35,11 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; import { Observable, Subject } from 'rxjs'; import { tap } from 'rxjs/operators'; -import { ManagementContract, SearchService, SnackBarService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { ManagementContract, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; import { ManagementContractsApiService } from '../core/api/management-contracts-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts index 3a297f2a2c3..6a3105025cd 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts @@ -45,8 +45,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyService } from '../ontology.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts index b3f4cb08b75..35dc5abce78 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.ts @@ -38,8 +38,7 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { setTypeDetailAndStringSize, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService, setTypeDetailAndStringSize, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { OntologyService } from '../ontology.service'; import { OntologyCreateValidators } from './ontology-create.validators'; import { collections, sizes, types } from '../ontology-form-options'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts index fcdb9411554..64e19b2672f 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-delete-dialog/schema-delete-dialog.component.ts @@ -38,8 +38,7 @@ import { Component, inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { I18nPluralPipe } from '@angular/common'; -import { SchemaService, StartupService, SnackBarService } from 'vitamui-library'; -import { VitamUILibraryModule } from 'vitamui-library'; +import { SchemaService, SnackBarService, StartupService, VitamUILibraryModule } from 'vitamui-library'; import { finalize } from 'rxjs'; export type SchemaDeleteDialogComponentData = string[]; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts index e1f4d176384..8b642bedd98 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.ts @@ -34,11 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, QueryList, ViewChildren, inject } from '@angular/core'; +import { Component, ElementRef, EventEmitter, inject, Input, OnDestroy, OnInit, Output, QueryList, ViewChildren } from '@angular/core'; import { finalize, Subscription } from 'rxjs'; import { ClickOutsideDirective, - TooltipDirective, ItemFlatNode, ItemNode, ItemNodeUtils, @@ -46,6 +45,7 @@ import { SchemaElement, SchemaService, TenantSelectionService, + TooltipDirective, VitamUICommonModule, } from 'vitamui-library'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts index 9f43eff1b36..cd14856b323 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts @@ -42,8 +42,7 @@ import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; -import { Ontology, SecurityService } from 'vitamui-library'; -import { VitamUILibraryModule } from 'vitamui-library'; +import { Ontology, SecurityService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyService } from '../../ontology.service'; import { OntologyInformationTabComponent } from './ontology-information-tab.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts index d01c7b7c524..c8fed9d466b 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.ts @@ -38,10 +38,11 @@ import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, switchMap } from 'rxjs/operators'; -import { Ontology, Option } from 'vitamui-library'; import { ApplicationId, diff, + Ontology, + Option, Role, SecurityService, setTypeDetailAndStringSize, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts index 41f6491aafb..d0a12f80122 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-preview.component.ts @@ -49,8 +49,7 @@ import { import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader, MatTabsModule } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { ConfirmActionComponent, Ontology, SchemaElement, SchemaService } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmActionComponent, Ontology, SchemaElement, SchemaService, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { OntologyService } from '../ontology.service'; import { OntologyInformationTabComponent } from './ontology-information-tab/ontology-information-tab.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts index ca4213d0cd1..5a2736abc49 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts @@ -37,8 +37,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { SchemaElement, SchemaService } from 'vitamui-library'; -import { Collection, VitamUILibraryModule } from 'vitamui-library'; +import { Collection, SchemaElement, SchemaService, VitamUILibraryModule } from 'vitamui-library'; import { SchemaInformationTabComponent } from './schema-information-tab.component'; import { of } from 'rxjs'; import { MatFormFieldModule } from '@angular/material/form-field'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts index bc66d5d8fd8..73737605d86 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.ts @@ -36,8 +36,7 @@ */ import { Component, inject, Input } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { Option, SchemaElement, SchemaService } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { Option, SchemaElement, SchemaService, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { sizes, types } from '../../ontology-form-options'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts index 2ac517c5a1a..dc4daa5ba41 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts @@ -40,8 +40,7 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { SchemaService, SecurityService, StartupService } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { InjectorModule, LoggerModule, SchemaService, SecurityService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyComponent } from './ontology.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts index 6cca40bafe0..1edf8fd407f 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts @@ -38,9 +38,10 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { ApplicationId, + ClickOutsideDirective, FileTypes, GlobalEventService, Ontology, @@ -50,10 +51,9 @@ import { SecurityService, SidenavPage, StartupService, - ClickOutsideDirective, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, VitamuiMenuButtonComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; @@ -61,7 +61,7 @@ import { OntologyCreateComponent } from './ontology-create/ontology-create.compo import { OntologyListComponent } from './ontology-group/ontology-list/ontology-list.component'; import { Subscription } from 'rxjs'; import { OntologyService } from './ontology.service'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { OntologyPreviewComponent } from './ontology-preview/ontology-preview.component'; import { MatMenuItem } from '@angular/material/menu'; import { OntologyGroupComponent } from './ontology-group/ontology-group.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts index 27071ad5fd3..058b4f42a53 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts @@ -42,8 +42,7 @@ import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; import { EMPTY, of, throwError } from 'rxjs'; import type { Mock, MockInstance } from 'vitest'; -import { BASE_URL, Griffin, GriffinsService, SnackBarService, StartupService, TenantSelectionService } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, Griffin, GriffinsService, LoggerModule, SnackBarService, StartupService, TenantSelectionService } from 'vitamui-library'; import { GriffinListComponent } from './griffin-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts index fb101eebe22..baa91827816 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts @@ -42,8 +42,7 @@ import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; import { EMPTY, of, throwError } from 'rxjs'; import type { Mock, MockInstance } from 'vitest'; -import { BASE_URL, PreservationScenario, PreservationScenariosService, SnackBarService } from 'vitamui-library'; -import { LoggerModule } from 'vitamui-library'; +import { BASE_URL, LoggerModule, PreservationScenario, PreservationScenariosService, SnackBarService } from 'vitamui-library'; import { PreservationScenarioListComponent } from './preservation-scenario-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts index 5e04ca3d328..61c15f31537 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-preview/preservation-scenario-information-tab/preservation-scenario-information-tab.component.ts @@ -37,8 +37,7 @@ import { Component, effect, inject, input } from '@angular/core'; import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; -import { ActionType, Option, PreservationScenario } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ActionType, Option, PreservationScenario, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; @Component({ diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts index 5bc3b8ae336..7596d7d919c 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts @@ -40,8 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { PreservationComponent } from './preservation.component'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { BASE_URL, SecurityService } from 'vitamui-library'; -import { InjectorModule, LoggerModule, VitamUICommonModule } from 'vitamui-library'; +import { BASE_URL, InjectorModule, LoggerModule, SecurityService, VitamUICommonModule } from 'vitamui-library'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts index 7aed3f8531c..61f4e10443e 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.ts @@ -35,29 +35,28 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders } from '@angular/common/http'; -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ConfirmDialogService, + DialogHeaderComponent, ExternalParameters, ExternalParametersService, + InputComponent, Option, SearchResponse, SearchUnitApiService, + SelectComponent, SigningRoleType, SnackBarService, VitamuiHttpHeaders, - DialogHeaderComponent, - InputComponent, - SelectComponent, } from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; import { sizes } from '../../ontology/ontology-form-options'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ @@ -67,7 +66,6 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ DialogHeaderComponent, ReactiveFormsModule, - CdkScrollable, MatDialogContent, InputComponent, SelectComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts index 5d343a6db58..7b75d32ad53 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts @@ -34,22 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { merge, Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, - PageRequest, OrderByButtonComponent, + PageRequest, PipesModule, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts index c24f5506e20..7f254bb65fe 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.spec.ts @@ -38,8 +38,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; -import { ExternalParametersService, SnackBarService } from 'vitamui-library'; -import { ExternalParameters } from 'vitamui-library'; +import { ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; import { ProbativeValuePreviewComponent } from './probative-value-preview.component'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts index 3c15acda9fd..6bfd672572c 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-preview/probative-value-preview.component.ts @@ -34,12 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { finalize, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { ExternalParametersService, SnackBarService } from 'vitamui-library'; -import { ExternalParameters, PipesModule, CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent } from 'vitamui-library'; +import { + ExternalParameters, + ExternalParametersService, + PipesModule, + SnackBarService, + VitamuiSidenavHeaderComponent, +} from 'vitamui-library'; import { ProbativeValueService } from '../probative-value.service'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; import { TranslatePipe } from '@ngx-translate/core'; @@ -56,10 +61,8 @@ import { CommonModule } from '@angular/common'; EventTypeBadgeColorPipe, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts index cd3a27627e9..a35b9318ef8 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts @@ -44,8 +44,7 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL } from 'vitamui-library'; -import { DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProbativeValueComponent } from './probative-value.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts index c59f8e9ccae..d2c0428202e 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts @@ -34,23 +34,23 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, ViewChild, inject } from '@angular/core'; +import { Component, inject, OnDestroy, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { + DatepickerComponent, Event, GlobalEventService, SearchBarComponent, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, - DatepickerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ProbativeValueCreateComponent } from './probative-value-create/probative-value-create.component'; import { ProbativeValueListComponent } from './probative-value-list/probative-value-list.component'; import { DateTime } from 'luxon'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { ProbativeValuePreviewComponent } from './probative-value-preview/probative-value-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts index 378437f6365..0f59d3a69f6 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.service.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; +import { inject, Injectable } from '@angular/core'; import { tap } from 'rxjs/operators'; -import { Event, SearchService, SnackBarService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { Event, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; import { OperationApiService } from '../core/api/operation-api.service'; import { Observable } from 'rxjs'; diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts index e5d60fd6eb9..ac849beb858 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts @@ -46,8 +46,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { ManagementRuleValidators, RuleService, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService, ManagementRuleValidators, RuleService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../rules.constants'; import { RuleCreateComponent } from './rule-create.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts index 526f3d0a61e..c4d5304bc90 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.ts @@ -34,24 +34,23 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; import { ConfirmDialogService, + DialogHeaderComponent, + InputComponent, ManagementRuleValidators, Rule, RuleService, - DialogHeaderComponent, - InputComponent, - TooltipDirective, SelectComponent, + TooltipDirective, } from 'vitamui-library'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../rules.constants'; import { RuleCreateValidators } from './rule-create.validators'; import { sizes } from '../../ontology/ontology-form-options'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ @@ -61,7 +60,6 @@ import { TranslatePipe } from '@ngx-translate/core'; imports: [ DialogHeaderComponent, ReactiveFormsModule, - CdkScrollable, MatDialogContent, InputComponent, TooltipDirective, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts index a1847685a5e..636b008d991 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts @@ -34,33 +34,30 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; -import { Subject, merge } from 'rxjs'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; +import { merge, Subject } from 'rxjs'; import { debounceTime, filter } from 'rxjs/operators'; import { AdminUserProfile, - Rule, + ApplicationId, AuthService, ConfirmActionComponent, DEFAULT_PAGE_SIZE, - InfiniteScrollTable, - RuleService, - SnackBarService, -} from 'vitamui-library'; -import { + Direction, EllipsisDirective, - HasAnyRoleDirective, HasRoleDirective, InfiniteScrollDirective, - ApplicationId, - Direction, + InfiniteScrollTable, + OrderByButtonComponent, PageRequest, Role, - OrderByButtonComponent, - TableFilterDirective, + Rule, + RuleService, + SnackBarService, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, } from 'vitamui-library'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../rules.constants'; @@ -82,7 +79,6 @@ const FILTER_DEBOUNCE_TIME_MS = 400; TranslatePipe, CommonModule, EllipsisDirective, - HasAnyRoleDirective, HasRoleDirective, InfiniteScrollDirective, ], diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts index d62e24e88a7..008e1a888dc 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.ts @@ -34,14 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, mergeMap, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Rule, RuleService, SecurityService } from 'vitamui-library'; -import { VitamuiRoles, diff, SelectComponent, InputComponent } from 'vitamui-library'; +import { diff, InputComponent, Rule, RuleService, SecurityService, SelectComponent, VitamuiRoles } from 'vitamui-library'; import { RULE_MEASUREMENTS, RULE_TYPES } from '../../rules.constants'; import { AsyncPipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts index 6a58cf4483b..ea6171efb3f 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-preview.component.ts @@ -34,11 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, forwardRef, HostListener, inject, Input, Output, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; -import { Rule, ConfirmActionComponent, RuleService } from 'vitamui-library'; -import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; +import { ConfirmActionComponent, OperationHistoryTabComponent, Rule, RuleService, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { RuleInformationTabComponent } from './rule-information-tab/rule-information-tab.component'; import { switchMap } from 'rxjs/operators'; @@ -59,10 +58,8 @@ import { CommonModule } from '@angular/common'; forwardRef(() => RulePreviewComponent), TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index 7ee40e364fc..dedd2669f67 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -49,7 +49,6 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; -import { Rule } from 'vitamui-library'; import { AuthService, BASE_URL, @@ -57,6 +56,7 @@ import { GlobalEventService, InjectorModule, LoggerModule, + Rule, SecurityService, SnackBarService, } from 'vitamui-library'; diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts index 5c671e0c5de..aa0d3e2af86 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts @@ -37,7 +37,7 @@ import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Observable } from 'rxjs'; import { ApplicationId, @@ -48,15 +48,15 @@ import { RuleService, SecurityService, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, VitamuiMenuButtonComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { ImportDialogParam, ReferentialTypes } from '../shared/import-dialog/import-dialog-param.interface'; import { ImportDialogComponent } from '../shared/import-dialog/import-dialog.component'; import { RuleCreateComponent } from './rule-create/rule-create.component'; import { RuleListComponent } from './rule-list/rule-list.component'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { RulePreviewComponent } from './rule-preview/rule-preview.component'; import { MatMenuItem } from '@angular/material/menu'; import { AsyncPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts index 05dbb7f89ca..ffe0462bc66 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts @@ -34,24 +34,24 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnDestroy, OnInit, Output, inject } from '@angular/core'; -import { Subject, merge } from 'rxjs'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { merge, Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; import { DEFAULT_PAGE_SIZE, Direction, + EllipsisDirective, + InfiniteScrollDirective, InfiniteScrollTable, - PageRequest, - TableFilterDirective, OrderByButtonComponent, + PageRequest, + PipesModule, TableFilterComponent, + TableFilterDirective, TableFilterOptionComponent, - PipesModule, - EllipsisDirective, - InfiniteScrollDirective, } from 'vitamui-library'; import { SecurisationService } from '../securisation.service'; -import { NgClass, CommonModule } from '@angular/common'; +import { CommonModule, NgClass } from '@angular/common'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeClassPipe } from '../../shared/pipes/event-type-badge-class.pipe'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index 5fd1592f40e..a8c78a678a8 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -37,8 +37,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; -import { AccessContractService, BASE_URL, ExternalParametersService } from 'vitamui-library'; -import { ExternalParameters, SnackBarService } from 'vitamui-library'; +import { AccessContractService, BASE_URL, ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; import { SecurisationCheckTabComponent } from './securisation-check-tab.component'; import { provideHttpClientTesting } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts index bd1ea9eecaf..1caefadbc40 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.ts @@ -34,9 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, OnInit, SimpleChanges, inject } from '@angular/core'; -import { ApiEvent, Event, IEvent, ExternalParametersService, SnackBarService } from 'vitamui-library'; -import { CollapseComponent, ApplicationId, ExternalParameters, LogbookApiService, HistoryEventsComponent } from 'vitamui-library'; +import { Component, inject, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; +import { + ApiEvent, + ApplicationId, + CollapseComponent, + Event, + ExternalParameters, + ExternalParametersService, + HistoryEventsComponent, + IEvent, + LogbookApiService, + SnackBarService, +} from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; import { TranslatePipe } from '@ngx-translate/core'; import { CommonModule } from '@angular/common'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts index 7c5ed171fb4..64614fd80f6 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-information-tab/securisation-information-tab.component.ts @@ -34,9 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit, inject } from '@angular/core'; -import { Event } from 'vitamui-library'; -import { PipesModule } from 'vitamui-library'; +import { Component, inject, Input, OnInit } from '@angular/core'; +import { Event, PipesModule } from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts index dc510314177..dc899d298a3 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts @@ -38,8 +38,7 @@ import { CUSTOM_ELEMENTS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { ExternalParametersService } from 'vitamui-library'; -import { SnackBarService } from 'vitamui-library'; +import { ExternalParametersService, SnackBarService } from 'vitamui-library'; import { SecurisationService } from '../securisation.service'; import { SecurisationPreviewComponent } from './securisation-preview.component'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts index 4668474ec43..b9605a5d36a 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.ts @@ -34,18 +34,18 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; -import { Event, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; import { - CommonTooltipComponent, - TooltipDirective, - VitamuiSidenavHeaderComponent, + Event, ExternalParameters, + ExternalParametersService, OperationHistoryTabComponent, PipesModule, + SnackBarService, + VitamuiSidenavHeaderComponent, } from 'vitamui-library'; import { SecurisationService } from '../securisation.service'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { SecurisationInformationTabComponent } from './securisation-information-tab/securisation-information-tab.component'; import { SecurisationCheckTabComponent } from './securisation-check-tab/securisation-check-tab.component'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; @@ -68,10 +68,8 @@ import { CommonModule } from '@angular/common'; EventTypeBadgeColorPipe, TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts index 6c5ff662c64..04194507fe0 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts @@ -44,8 +44,7 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { GlobalEventService } from 'vitamui-library'; -import { DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; +import { DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { SecurisationComponent } from './securisation.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts index 1e9ed4aafd2..75051a57935 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts @@ -34,22 +34,22 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ViewChild, inject } from '@angular/core'; +import { Component, inject, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { + DatepickerComponent, Event, GlobalEventService, SearchBarComponent, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, - DatepickerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { SecurisationListComponent } from './securisation-list/securisation-list.component'; import { DateTime } from 'luxon'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { SecurisationPreviewComponent } from './securisation-preview/securisation-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts index cf362793577..4ff51bdd201 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.service.ts @@ -35,9 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpHeaders } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Event, SearchService, SnackBarService } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { inject, Injectable } from '@angular/core'; +import { Event, SearchService, SnackBarService, VitamuiHttpHeaders } from 'vitamui-library'; import { OperationApiService } from '../core/api/operation-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts index eaf8feaf1a0..89fec19648a 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts @@ -62,7 +62,6 @@ import { SecurityProfileCreateValidators } from './security-profile-create.valid }, ], imports: [ - SecurityProfileCreateComponent, ReactiveFormsModule, MatFormFieldModule, MatSelectModule, @@ -100,7 +99,6 @@ class DomainInputStubComponent implements ControlValueAccessor { }, ], imports: [ - SecurityProfileCreateComponent, ReactiveFormsModule, MatFormFieldModule, MatSelectModule, diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts index 6285be93d69..50beb4529ee 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.ts @@ -38,8 +38,7 @@ import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { Subscription } from 'rxjs'; -import { ConfirmDialogService } from 'vitamui-library'; -import { VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; +import { ConfirmDialogService, VitamUICommonModule, VitamUILibraryModule } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { SecurityProfileCreateValidators } from './security-profile-create.validators'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts index d9dcdada7f6..c3643738274 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, forwardRef, Input, inject } from '@angular/core'; +import { Component, forwardRef, inject, Input } from '@angular/core'; import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { PermissionStructure, PermissionUtils } from '../permission.utils'; -import { TooltipDirective, SlideToggleComponent } from 'vitamui-library'; +import { SlideToggleComponent, TooltipDirective } from 'vitamui-library'; import { TranslatePipe } from '@ngx-translate/core'; export const PERMISSION_SELECT_VALUE_ACCESSOR: any = { diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts index bc713c1644e..e38cdd3ab6b 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts @@ -34,11 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, EventEmitter, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; import { merge, Subject } from 'rxjs'; import { debounceTime } from 'rxjs/operators'; -import { AdminUserProfile, SecurityProfile, DEFAULT_PAGE_SIZE, InfiniteScrollTable } from 'vitamui-library'; -import { InfiniteScrollDirective, Direction, PageRequest, OrderByButtonComponent } from 'vitamui-library'; +import { + AdminUserProfile, + DEFAULT_PAGE_SIZE, + Direction, + InfiniteScrollDirective, + InfiniteScrollTable, + OrderByButtonComponent, + PageRequest, + SecurityProfile, +} from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts index c01d2f7ebe1..32f6ee838a0 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-information-tab/security-profile-information-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; -import { FormBuilder, FormControl, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Option, SecurityProfile } from 'vitamui-library'; -import { diff, InputComponent, SlideToggleComponent } from 'vitamui-library'; +import { diff, InputComponent, Option, SecurityProfile, SlideToggleComponent } from 'vitamui-library'; import { SecurityProfileService } from '../../security-profile.service'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts index c3c86cef42f..3e527748ad3 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-permissions-tab/security-profile-permissions-tab.component.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { Observable, of } from 'rxjs'; import { catchError, filter, map, switchMap } from 'rxjs/operators'; import { extend, isEmpty } from 'underscore'; -import { Option } from 'vitamui-library'; -import { SecurityProfile, diff } from 'vitamui-library'; +import { diff, Option, SecurityProfile } from 'vitamui-library'; import { SecurityProfileService } from '../../security-profile.service'; import { SecurityProfileEditPermissionComponent } from '../../security-profile-create/security-profile-edit-permission/security-profile-edit-permission.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts index 8855089f85d..e700ee9ca5e 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.ts @@ -34,12 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, EventEmitter, HostListener, Input, Output, ViewChild, inject, forwardRef } from '@angular/core'; +import { AfterViewInit, Component, EventEmitter, forwardRef, HostListener, inject, Input, Output, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { MatTab, MatTabGroup, MatTabHeader } from '@angular/material/tabs'; import { Observable } from 'rxjs'; -import { SecurityProfile, ConfirmActionComponent } from 'vitamui-library'; -import { CommonTooltipComponent, TooltipDirective, VitamuiSidenavHeaderComponent, OperationHistoryTabComponent } from 'vitamui-library'; +import { ConfirmActionComponent, OperationHistoryTabComponent, SecurityProfile, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { SecurityProfileInformationTabComponent } from './security-profile-information-tab/security-profile-information-tab.component'; import { SecurityProfilePermissionsTabComponent } from './security-profile-permissions-tab/security-profile-permissions-tab.component'; @@ -62,10 +61,8 @@ import { CommonModule } from '@angular/common'; forwardRef(() => SecurityProfilePreviewComponent), TranslatePipe, CommonModule, - CommonTooltipComponent, MatProgressSpinnerModule, ReactiveFormsModule, - TooltipDirective, VitamuiSidenavHeaderComponent, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts index 4c508bb31de..af09dd39f54 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts @@ -41,8 +41,7 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import { ApplicationService } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { ApplicationService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts index a5f0f3118b3..ff370246fe7 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ViewChild, inject } from '@angular/core'; +import { Component, inject, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { @@ -42,14 +42,14 @@ import { GlobalEventService, SecurityProfile, SidenavPage, - VitamuiTitleBreadcrumbComponent, VitamuiBannerComponent, + VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { SecurityProfileCreateComponent } from './security-profile-create/security-profile-create.component'; import { SecurityProfileListComponent } from './security-profile-list/security-profile-list.component'; import { shareReplay } from 'rxjs/operators'; import { firstValueFrom } from 'rxjs'; -import { MatSidenavContainer, MatSidenav, MatSidenavContent } from '@angular/material/sidenav'; +import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { SecurityProfilePreviewComponent } from './security-profile-preview/security-profile-preview.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts index 443775b2c33..0665fb1d4bf 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/import-dialog.component.ts @@ -35,23 +35,22 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnDestroy } from '@angular/core'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { ApplicationId, + DialogHeaderComponent, + FileSelectorComponent, FileTypes, FileValidationErrors, FileValidatorFunction, SnackBarService, - DialogHeaderComponent, - FileSelectorComponent, } from 'vitamui-library'; import { firstValueFrom, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { ImportDialogParam, ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; -import { FormControl, Validators, ReactiveFormsModule } from '@angular/forms'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { ReferentialImportService } from './referential-import.service'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ @@ -60,7 +59,6 @@ import { MatProgressSpinner } from '@angular/material/progress-spinner'; styleUrls: ['./import-dialog.component.scss'], imports: [ DialogHeaderComponent, - CdkScrollable, MatDialogContent, FileSelectorComponent, ReactiveFormsModule, diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts index 7a3be7c3b3e..7632cc9fa01 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts @@ -36,8 +36,7 @@ */ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT } from 'vitamui-library'; -import { InjectorModule, LoggerModule } from 'vitamui-library'; +import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { ReferentialImportService } from './referential-import.service'; import { ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts index 6ade65e08a7..c6939fb7cc6 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import.service.ts @@ -36,8 +36,7 @@ */ import { HttpClient, HttpErrorResponse, HttpHeaders, HttpStatusCode } from '@angular/common/http'; import { inject, Injectable } from '@angular/core'; -import { BASE_URL } from 'vitamui-library'; -import { VitamuiHttpHeaders } from 'vitamui-library'; +import { BASE_URL, VitamuiHttpHeaders } from 'vitamui-library'; import { ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; import { Observable, throwError } from 'rxjs'; import { catchError } from 'rxjs/operators'; diff --git a/ui/ui-frontend/projects/referential/src/main.ts b/ui/ui-frontend/projects/referential/src/main.ts index 8a691a29452..e84b813dfe3 100644 --- a/ui/ui-frontend/projects/referential/src/main.ts +++ b/ui/ui-frontend/projects/referential/src/main.ts @@ -34,19 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID, importProvidersFrom } from '@angular/core'; -import { Title, BrowserModule, bootstrapApplication } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; +import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; import { - provideI18n, + AuthenticationModule, BASE_URL, - ENVIRONMENT, - WINDOW_LOCATION, BytesPipe, - AuthenticationModule, + ENVIRONMENT, InjectorModule, + provideI18n, VitamUICommonModule, + WINDOW_LOCATION, } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { DatePipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts index 373e33d559b..d3fc041da02 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts @@ -34,8 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, inject } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, inject, Input } from '@angular/core'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import type { Account } from '../../models/account/account.interface'; import { SlideToggleComponent } from '../../../../lib/components/slide-toggle/slide-toggle.component'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts index dda25b12e6d..8fa4aeaa291 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, inject, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Subscription } from 'rxjs'; import { BaseUserInfoApiService } from '../api/base-user-info-api.service'; @@ -45,7 +45,7 @@ import { BreadCrumbData } from '../models/breadcrumb/breadcrumb.interface'; import { AccountService } from './account.service'; import { VitamuiTitleBreadcrumbComponent } from '../components/vitamui-title-breadcrumb/vitamui-title-breadcrumb.component'; import { UserPhotoComponent } from '../components/header/user-photo/user-photo.component'; -import { MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { AccountInformationTabComponent } from './account-information-tab/account-information-tab.component'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts index 122fcdbc202..bc4d27dba2b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-count/archive-unit-count.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpErrorResponse } from '@angular/common/http'; -import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; import { Observable, Subscription } from 'rxjs'; import { tap } from 'rxjs/operators'; import { Logger } from '../../../logger/logger'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts index 92916839574..d4f06410f03 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/physical-archive-viewer/physical-archive-viewer.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, Input, OnInit } from '@angular/core'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { ObjectQualifierType } from '../../../models/units/object-qualifier.enums'; import { ValidationError } from '../../../models/units/unit.interface'; import type { VersionWithQualifierDto } from '../../../models/units/object-group.interface'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts index 9ef82cb4032..134bed62ccb 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, HostBinding, Input, forwardRef } from '@angular/core'; +import { Component, forwardRef, HostBinding, Input } from '@angular/core'; @Component({ selector: 'vitamui-common-collapse', diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts index 85abc966eba..436e88add33 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-confirm-dialog/common-confirm-dialog.component.ts @@ -36,15 +36,14 @@ */ import { Component, Input } from '@angular/core'; import { DialogHeaderComponent } from '../../../../lib/components/dialog/dialog-header/dialog-header.component'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-confirm-dialog', templateUrl: './common-confirm-dialog.component.html', styleUrls: ['./common-confirm-dialog.component.scss'], - imports: [DialogHeaderComponent, CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, TranslatePipe], + imports: [DialogHeaderComponent, MatDialogContent, MatDialogActions, MatDialogClose, TranslatePipe], }) export class CommonConfirmDialogComponent { @Input() dialogTitle: string; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts index 9837861c9fe..d31788f48d3 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts @@ -42,12 +42,12 @@ import { Directive, ElementRef, HostListener, + inject, Input, OnChanges, OnDestroy, OnInit, SimpleChanges, - inject, } from '@angular/core'; import type { TooltipPosition } from './TooltipPosition.enum'; import { CommonTooltipComponent } from './common-tooltip.component'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts index 8ca540b51ec..e4a3b8a2ca1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/data/data.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ContentChild, Input, TemplateRef, inject } from '@angular/core'; +import { Component, ContentChild, inject, Input, TemplateRef } from '@angular/core'; import { CommonModule } from '@angular/common'; import { PipesModule } from '../../pipes/pipes.module'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts index 0dcfa996abf..8137a633570 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.ts @@ -34,20 +34,19 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog, MatDialogContent, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { Component, inject, TemplateRef, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogContent } from '@angular/material/dialog'; import { Observable, Subject } from 'rxjs'; import { filter } from 'rxjs/operators'; import { MatProgressBar } from '@angular/material/progress-bar'; -import { CdkScrollable } from '@angular/cdk/scrolling'; -import { PercentPipe, I18nPluralPipe } from '@angular/common'; +import { I18nPluralPipe, PercentPipe } from '@angular/common'; import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-download-snack-bar', templateUrl: './download-snack-bar.component.html', styleUrls: ['./download-snack-bar.component.scss'], - imports: [MatProgressBar, CdkScrollable, MatDialogContent, MatDialogActions, MatDialogClose, PercentPipe, I18nPluralPipe, TranslatePipe], + imports: [MatProgressBar, MatDialogContent, MatDialogActions, MatDialogClose, PercentPipe, I18nPluralPipe, TranslatePipe], }) export class DownloadSnackBarComponent { private matDialog = inject(MatDialog); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts index c6bbd225978..78d424c8142 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.ts @@ -34,13 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, forwardRef, inject, Input, ViewChild } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -import { FormBuilder, FormGroup, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MatSelect, MatOption } from '@angular/material/select'; +import { FormBuilder, FormGroup, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; +import { MatOption, MatSelect } from '@angular/material/select'; import { EditableFieldComponent } from '../editable-field.component'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { MatFormField } from '@angular/material/form-field'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts index 74110c56a0f..ce72af8a313 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.ts @@ -43,14 +43,14 @@ import { EventEmitter, HostBinding, HostListener, + inject, Input, Output, QueryList, ViewChild, - inject, } from '@angular/core'; -import { ControlValueAccessor, FormControl } from '@angular/forms'; import type { AsyncValidatorFn, ValidatorFn } from '@angular/forms'; +import { ControlValueAccessor, FormControl } from '@angular/forms'; import { VitamUIFieldErrorComponent } from '../vitamui-field-error/vitamui-field-error.component'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts index 143e072dde5..3480e7a8008 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-file/editable-file.component.ts @@ -34,11 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; +import { Component, ElementRef, forwardRef, inject, Input, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts index db7d8136f95..1ee21175173 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-input/editable-input.component.ts @@ -34,12 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, ElementRef, forwardRef, inject, Input, ViewChild } from '@angular/core'; +import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { EllipsisDirective } from '../../../directives/ellipsis/ellipsis.directive'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts index 58629a7fc3c..959f7e42a1b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.ts @@ -34,10 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, forwardRef, Input, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, ElementRef, forwardRef, inject, Input } from '@angular/core'; +import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { LevelInputComponent } from '../level-input/level-input.component'; import { TranslatePipe } from '@ngx-translate/core'; import { SubLevelPipe } from './sub-level.pipe'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts index 46081af4bbc..6522104501d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-textarea/editable-textarea.component.ts @@ -34,12 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ElementRef, forwardRef, Input, ViewChild, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, ElementRef, forwardRef, inject, Input, ViewChild } from '@angular/core'; +import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; import { coerceBooleanProperty } from '@angular/cdk/coercion'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; export const EDITABLE_TEXTAREA_VALUE_ACCESSOR: any = { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts index f45fa3f6f4e..1c57229b755 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-toggle-group/editable-toggle-group.component.ts @@ -34,13 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, ContentChildren, ElementRef, forwardRef, QueryList, inject } from '@angular/core'; -import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { Component, ContentChildren, ElementRef, forwardRef, inject, QueryList } from '@angular/core'; +import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { EditableFieldComponent } from '../editable-field.component'; import { EditableButtonToggleComponent } from './editable-button-toggle.component'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; -import { MatButtonToggleGroup, MatButtonToggle } from '@angular/material/button-toggle'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; +import { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; export const EDITABLE_TOGGLE_GROUP_VALUE_ACCESSOR: any = { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts index 5723764ed53..ae2432b0d41 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.ts @@ -36,7 +36,7 @@ */ import { coerceBooleanProperty } from '@angular/cdk/coercion'; import { Component, ElementRef, forwardRef, HostBinding, HostListener, Input, OnInit, ViewChild } from '@angular/core'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms'; +import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms'; import { extractSubLevel } from '../../../utils/level.util'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts index 6382eb1cc18..8f895695fb2 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.ts @@ -60,7 +60,7 @@ import { MatToolbar } from '@angular/material/toolbar'; import { SelectSiteComponent } from './select-site/select-site.component'; import { SelectLanguageComponent } from './select-language/select-language.component'; import { ItemSelectComponent } from './item-select/item-select.component'; -import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; +import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; import { UserPhotoComponent } from './user-photo/user-photo.component'; import { MatMiniFabButton } from '@angular/material/button'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts index 1aeb4634598..800c5c1c9a1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/item-select/item-select.component.ts @@ -38,7 +38,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import type { MenuOption } from '../../../models/menu-option.interface'; import { Option } from '../../autocomplete/utils/option.interface'; import { MatFormField, MatLabel, MatSuffix } from '@angular/material/form-field'; -import { MatSelect, MatOption } from '@angular/material/select'; +import { MatOption, MatSelect } from '@angular/material/select'; @Component({ selector: 'vitamui-common-item-select', diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts index 342a26c4799..c0a0e6289bf 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.ts @@ -46,10 +46,10 @@ import { ViewChild, ViewChildren, } from '@angular/core'; -import { MatSelectionList, MatSelectionListChange, MatListOption } from '@angular/material/list'; -import { MatTabChangeEvent, MatTabGroup, MatTab } from '@angular/material/tabs'; +import { MatListOption, MatSelectionList, MatSelectionListChange } from '@angular/material/list'; +import { MatTab, MatTabChangeEvent, MatTabGroup } from '@angular/material/tabs'; import { Router } from '@angular/router'; -import { TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { take, takeUntil } from 'rxjs/operators'; import { ApplicationService } from '../../../application.service'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts index c101cdb5c0b..974103e4650 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-language/select-language.component.ts @@ -34,8 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnDestroy, OnInit, inject } from '@angular/core'; -import { LangChangeEvent, TranslateService, TranslatePipe } from '@ngx-translate/core'; +import { Component, inject, Input, OnDestroy, OnInit } from '@angular/core'; +import { LangChangeEvent, TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { AuthService } from '../../../auth.service'; @@ -43,7 +43,7 @@ import { FullLangString, LanguageService, MinLangString } from '../../../languag import { BaseUserInfoApiService } from './../../../api/base-user-info-api.service'; import { ItemSelectComponent } from '../item-select/item-select.component'; import { MatMiniFabButton } from '@angular/material/button'; -import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; +import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; @Component({ selector: 'vitamui-common-select-language', diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts index 9a6befed8a1..160354c0edb 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-site/select-site.component.ts @@ -35,14 +35,14 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpClient, HttpParams } from '@angular/common/http'; -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { OAuthStorage } from 'angular-oauth2-oidc'; import { Observable } from 'rxjs'; import { map, switchMap } from 'rxjs/operators'; import { Operators } from '../../../vitamui-table/operators.enum'; import { SiteApiService } from './../../../api/site-api.service'; import { AuthService } from './../../../auth.service'; -import { MatMenuTrigger, MatMenu, MatMenuItem } from '@angular/material/menu'; +import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu'; @Component({ selector: 'vitamui-common-select-site', diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts index dcf471f03f0..60cce514ac0 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/select-tenant-dialog/select-tenant-dialog.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnInit, inject } from '@angular/core'; +import { Component, inject, OnInit } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { StartupService } from './../../../startup.service'; import { MenuOption } from '../../../models/menu-option.interface'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts index c993a643574..852b85ecb01 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/user-photo/user-photo.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; import { SafeResourceUrl } from '@angular/platform-browser'; import { AuthService } from '../../../auth.service'; import { ThemeDataType } from '../../../models/customer/theme/themeDataType.enum'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts index a48df74507c..fbd3978ce6f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-interval-date-picker/vitamui-interval-date-picker.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, Input, OnInit, Output, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { debounceTime } from 'rxjs/operators'; import { NgStyle } from '@angular/common'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts index 0bdef0947d3..805cc633e1e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-multi-inputs/vitamui-multi-inputs.component.ts @@ -35,10 +35,10 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, ElementRef, forwardRef, inject, Input, OnChanges, OnDestroy, SimpleChanges, ViewChild } from '@angular/core'; -import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { Subscription } from 'rxjs'; import { EditableFieldComponent } from '../editable-field/editable-field.component'; -import { CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { NgClass } from '@angular/common'; import { TruncatePipe } from '../../pipes/truncate.pipe'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts index 36e1df28dd9..5f8ba226f02 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2, inject } from '@angular/core'; +import { Directive, ElementRef, HostListener, inject, Input, OnInit, Renderer2 } from '@angular/core'; import { DOCUMENT } from '@angular/common'; @Directive({ selector: '[vitamuiCommonResizeSidebar]', standalone: true }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts index afebc103cf9..7feade7434f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Directive, ElementRef, HostListener, Input, OnInit, inject } from '@angular/core'; +import { Directive, ElementRef, HostListener, inject, Input, OnInit } from '@angular/core'; import { DOCUMENT } from '@angular/common'; @Directive({ selector: '[vitamuiVerticalResizeSidebar]', standalone: true }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts index 355430fd250..16cf3e33218 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/group-editor/group-editor.component.ts @@ -34,16 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Component, Input, OnChanges, OnDestroy, SimpleChanges, TemplateRef, ViewChild, inject } from '@angular/core'; -import { MatDialog, MatDialogConfig, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; -import { Subscription, of } from 'rxjs'; +import { AfterViewInit, Component, inject, Input, OnChanges, OnDestroy, SimpleChanges, TemplateRef, ViewChild } from '@angular/core'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogConfig } from '@angular/material/dialog'; +import { of, Subscription } from 'rxjs'; import { filter, switchMap } from 'rxjs/operators'; import { FavoriteEntryService } from '../../../object-viewer/services/favorite-entry.service'; import { LayoutService } from '../../../object-viewer/services/layout.service'; import { TypeService } from '../../../object-viewer/services/type.service'; import { DisplayObjectType } from '../../../object-viewer/types'; -import { Action } from '../../models/edit-object.model'; import type { EditObject } from '../../models/edit-object.model'; +import { Action } from '../../models/edit-object.model'; import { AccordionComponent } from '../../../components/accordion/accordion.component'; import { NgClass, NgTemplateOutlet } from '@angular/common'; import { VitamuiMenuButtonComponent } from '../../../components/vitamui-menu-button/vitamui-menu-button.component'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts index 4640a285ede..88be0d3c156 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/list-editor/list-editor.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; +import { Component, inject, Input, OnChanges, SimpleChanges } from '@angular/core'; import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FavoriteEntryService } from '../../../object-viewer/services/favorite-entry.service'; import { DisplayObjectType } from '../../../object-viewer/types'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts index 63d30d08305..c38e295add8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/components/primitive-editor/primitive-editor.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit, inject } from '@angular/core'; +import { Component, inject, Input, OnInit } from '@angular/core'; import { Logger } from '../../../logger/logger'; import { DateDisplayService } from '../../../object-viewer/services/date-display.service'; import { ComponentType } from '../../../object-viewer/types'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts index 99ac591bdb7..2ca2d3d8d1c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/bytes.pipe.ts @@ -34,11 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Pipe, PipeTransform, inject } from '@angular/core'; +import { inject, Pipe, PipeTransform } from '@angular/core'; import { Logger } from '../logger/logger'; -import { DecimalPipe } from '@angular/common'; - -import { registerLocaleData } from '@angular/common'; +import { DecimalPipe, registerLocaleData } from '@angular/common'; import localeFr from '@angular/common/locales/fr'; registerLocaleData(localeFr, 'fr'); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts index da31a6b7b87..c6302cf3b49 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/datetime.pipe.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { DatePipe } from '@angular/common'; -import { Pipe, PipeTransform, inject } from '@angular/core'; +import { inject, Pipe, PipeTransform } from '@angular/core'; @Pipe({ name: 'dateTime' }) export class DateTimePipe implements PipeTransform { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts index be1e4fd4eae..c949daf04d4 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/highlight.pipe.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Pipe, PipeTransform, inject } from '@angular/core'; +import { inject, Pipe, PipeTransform } from '@angular/core'; import { DomSanitizer, SafeHtml } from '@angular/platform-browser'; import DOMPurify from 'dompurify'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts index 52be9aedf44..b8d95673297 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/safe-style.pipe.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Pipe, PipeTransform, inject } from '@angular/core'; +import { inject, Pipe, PipeTransform } from '@angular/core'; import { DomSanitizer, SafeStyle } from '@angular/platform-browser'; @Pipe({ name: 'safeStyle' }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts index 7446f250a06..7ae268b0dd7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/pipes/yes-no.pipe.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Pipe, PipeTransform, inject } from '@angular/core'; +import { inject, Pipe, PipeTransform } from '@angular/core'; import { TranslateService } from '@ngx-translate/core'; @Pipe({ name: 'yesNo' }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts index 0564d580145..c1dbdab5131 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Directive, Input, OnDestroy, TemplateRef, ViewContainerRef, inject } from '@angular/core'; +import { Directive, inject, Input, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core'; import { Subscription } from 'rxjs'; import { ApplicationId } from '../application-id.enum'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts index 2aec1ee943f..72e3220c576 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Directive, Input, OnDestroy, TemplateRef, ViewContainerRef, inject } from '@angular/core'; +import { Directive, inject, Input, OnDestroy, TemplateRef, ViewContainerRef } from '@angular/core'; import { Subscription } from 'rxjs'; import { SecurityService } from './security.service'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts index 6767f6cfb9d..e85b29dc007 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-modal/subrogation-modal.component.ts @@ -35,8 +35,8 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog'; +import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; +import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { AuthService } from '../../auth.service'; import { SnackBarService } from '../../components/snack-bar/snack-bar.service'; import { Subrogation } from '../../models/subrogation/subrogation.interface'; @@ -44,7 +44,6 @@ import { SubrogationService } from '../subrogation.service'; import { DialogHeaderComponent } from '../../../../lib/components/dialog/dialog-header/dialog-header.component'; import { StepperComponent } from '../../components/stepper/stepper.component'; import { CdkStep } from '@angular/cdk/stepper'; -import { CdkScrollable } from '@angular/cdk/scrolling'; import { InputComponent } from '../../../../lib/components/input/input.component'; import { SelectComponent } from '../../../../lib/components/select/select.component'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; @@ -58,7 +57,6 @@ import { TranslatePipe } from '@ngx-translate/core'; DialogHeaderComponent, StepperComponent, CdkStep, - CdkScrollable, MatDialogContent, FormsModule, ReactiveFormsModule, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts index a9d3f9558e0..1566657777d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts @@ -38,11 +38,11 @@ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, forwardRef, inject, Injector, Input, OnInit } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { - MatTreeNestedDataSource, + MatNestedTreeNode, MatTree, - MatTreeNodeDef, + MatTreeNestedDataSource, MatTreeNode, - MatNestedTreeNode, + MatTreeNodeDef, MatTreeNodeOutlet, } from '@angular/material/tree'; import { v4 as uuid } from 'uuid'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts index baa5a1157c8..f893cd7f7c7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.ts @@ -45,6 +45,7 @@ import { effect, forwardRef, HostListener, + inject, Injector, Input, QueryList, @@ -52,7 +53,6 @@ import { Signal, ViewChild, ViewChildren, - inject, } from '@angular/core'; import { FormControl, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule, Validators } from '@angular/forms'; import { filter } from 'rxjs/operators'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts index 5df8f6bb840..0611aeca7f5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio-group/vitamui-radio-group.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterContentInit, Component, ContentChildren, forwardRef, Input, OnInit, QueryList, inject } from '@angular/core'; +import { AfterContentInit, Component, ContentChildren, forwardRef, inject, Input, OnInit, QueryList } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { VitamUIRadioComponent } from '../vitamui-radio/vitamui-radio.component'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts index 6562ad696cd..686667f6104 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/vitamui-radio/vitamui-radio.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, Input, OnInit, inject } from '@angular/core'; +import { Component, inject, Input, OnInit } from '@angular/core'; import { VitamUIRadioGroupService } from '../vitamui-radio-group/vitamui-radio-group.service'; import { NgClass } from '@angular/common'; diff --git a/ui/ui-frontend/test.ts b/ui/ui-frontend/test.ts index 24d8ca31b78..63ed833ce21 100644 --- a/ui/ui-frontend/test.ts +++ b/ui/ui-frontend/test.ts @@ -37,16 +37,16 @@ /// -import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; -import { TestBed } from '@angular/core/testing'; +import {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from '@angular/core'; +import {TestBed} from '@angular/core/testing'; import '@angular/compiler'; import '@analogjs/vitest-angular/setup-zone'; import 'zone.js/testing'; -import { provideAnimations } from '@angular/platform-browser/animations'; -import { provideNativeDateAdapter } from '@angular/material/core'; -import { provideRouter } from '@angular/router'; -import { BASE_URL, LoggerModule, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION } from 'vitamui-library'; -import { provideTranslateService, TranslatePipe } from '@ngx-translate/core'; +import {provideAnimations} from '@angular/platform-browser/animations'; +import {provideNativeDateAdapter} from '@angular/material/core'; +import {provideRouter} from '@angular/router'; +import {BASE_URL, LoggerModule, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION} from 'vitamui-library'; +import {provideTranslateService, TranslatePipe} from '@ngx-translate/core'; const configureTestingModule = TestBed.configureTestingModule.bind(TestBed); From 9e00f7a7953cb7bc112afe8ca220fb8888142a79 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 19 Aug 2026 17:40:52 +0200 Subject: [PATCH 05/33] Story #16471: Clean code - other fixes --- .../logbook-management-operation-preview.component.spec.ts | 2 ++ .../src/app/modules/components/header/header.component.html | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts index 8bd911420bc..7399c0d88d5 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts @@ -88,6 +88,8 @@ describe('LogbookManagementOperationPreviewComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(LogbookManagementOperationPreviewComponent); component = fixture.componentInstance; + component.tenant = {}; + component.tenantIdentifier = 42; component.operation = { globalState: 'PAUSE', nextStep: '', diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html index daafcdb5487..58e1a9723ba 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html @@ -52,7 +52,7 @@
{{ 'HEADER.PROFILE' | translate }}
-
{{ currentUser?.firstname }} {{ currentUser.lastname }}
+
{{ currentUser?.firstname }} {{ currentUser?.lastname }}
From 24b36aaba2030ed5aac8af9f4a5d02937dea38fc Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 19 Aug 2026 17:40:52 +0200 Subject: [PATCH 06/33] Story #16471: Clean code - manual fixes --- .../src/app/app.component.spec.ts | 29 +--- .../archive-preview.component.spec.ts | 27 +-- ...e-unit-rules-details-tab.component.spec.ts | 19 --- ...t-rules-informations-tab.component.spec.ts | 3 +- .../add-management-rules.component.spec.ts | 10 +- .../add-update-property.component.spec.ts | 12 +- .../archive-unit-rules.component.spec.ts | 10 +- ...ock-category-inheritance.component.spec.ts | 10 +- .../block-rules-inheritance.component.spec.ts | 10 +- .../delete-unit-rules.component.spec.ts | 10 +- ...ock-category-inheritance.component.spec.ts | 25 +-- .../unlock-category-inheritance.component.ts | 4 +- ...unlock-rules-inheritance.component.spec.ts | 26 +-- .../update-unit-rules.component.spec.ts | 10 +- .../management-rules.component.spec.ts | 13 +- .../archive-search.component.spec.ts | 67 +++----- .../search-criteria-list.component.spec.ts | 11 +- .../search-criteria-saver.component.spec.ts | 11 +- .../transfer-acknowledgment.component.spec.ts | 3 +- .../src/app/archive/archive.component.spec.ts | 20 +-- .../leaves-tree/leaves-tree.component.spec.ts | 11 +- ...istent-identifier-search.component.spec.ts | 10 -- .../collect/src/app/app.component.spec.ts | 40 +---- .../add-units/add-units.component.spec.ts | 11 +- .../archive-preview.component.spec.ts | 16 +- ...t-rules-informations-tab.component.spec.ts | 3 +- .../archive-search-collect.component.spec.ts | 31 ++-- .../search-criteria-list.component.spec.ts | 11 +- .../search-criteria-saver.component.spec.ts | 11 +- ...-criteria-search-collect.component.spec.ts | 10 -- .../update-units-metadata.component.spec.ts | 25 +-- .../create-project.component.spec.ts | 5 - .../transaction-list.component.spec.ts | 11 +- .../src/app/app.component.spec.ts | 3 + .../design-system/src/app/app.component.ts | 34 +++- .../design-system/src/app/app.module.ts | 103 ----------- .../{app-routing.module.ts => app.routes.ts} | 17 +- .../projects/design-system/src/main.ts | 20 ++- .../identity/src/app/app.component.spec.ts | 3 +- .../customer-create.component.spec.ts | 5 - .../customer-list.component.spec.ts | 4 +- .../customer-preview.component.spec.ts | 2 - .../graphic-identity-update.component.spec.ts | 160 ------------------ ...identity-provider-create.component.spec.ts | 11 +- .../app/customer/customer.component.spec.ts | 8 +- .../owner-create.component.spec.ts | 4 +- .../owner-preview.component.spec.ts | 4 +- .../src/app/customer/owner.service.spec.ts | 2 - .../tenant-create.component.spec.ts | 2 - ...nal-param-profile-detail.component.spec.ts | 44 ++--- ...ernal-param-profile-list.component.spec.ts | 11 +- .../external-param-profile.component.spec.ts | 2 - .../group-create.component.spec.ts | 2 - .../group-list/group-list.component.spec.ts | 3 +- .../units-edit/units-edit.component.spec.ts | 12 +- .../profiles-edit.component.spec.ts | 12 +- .../src/app/group/group.component.spec.ts | 6 +- .../hierarchy-create.component.spec.ts | 2 - .../domains-input.component.spec.ts | 1 - .../ingest/src/app/app.component.spec.ts | 7 +- .../holding-filling-scheme.component.spec.ts | 4 +- .../upload-tracking.component.spec.ts | 3 +- .../pastis/src/app/app.component.spec.ts | 3 +- .../create-profil-notice.component.spec.ts | 11 +- .../save-profile-popup.component.spec.ts | 11 +- .../portal/src/app/app.component.spec.ts | 11 +- .../access-contract-create.component.spec.ts | 2 - .../access-contract.component.spec.ts | 6 +- .../app/admin-dsl/admin-dsl.component.spec.ts | 2 - .../agency-create.component.spec.ts | 3 - .../agency-list/agency-list.component.spec.ts | 6 - .../src/app/agency/agency.component.spec.ts | 2 - .../src/app/audit/audit.component.spec.ts | 2 - .../context-create.component.spec.ts | 3 - .../src/app/context/context.component.spec.ts | 6 +- .../file-format-create.component.spec.ts | 2 - .../file-format/file-format.component.spec.ts | 6 +- .../ingest-contract-create.component.spec.ts | 9 +- ...gest-contract-object-tab.component.spec.ts | 10 +- ...logbook-operation-detail.component.spec.ts | 3 +- ...nagement-contract-create.component.spec.ts | 3 +- ...management-contract-list.component.spec.ts | 3 +- .../management-contract.component.spec.ts | 3 +- .../ontology-create.component.spec.ts | 2 - .../ontology-list.component.spec.ts | 11 +- ...ontology-information-tab.component.spec.ts | 11 +- .../schema-information-tab.component.spec.ts | 11 +- .../app/ontology/ontology.component.spec.ts | 6 +- .../probative-value-create.component.spec.ts | 2 - .../probative-value.component.spec.ts | 2 - .../rule-create/rule-create.component.spec.ts | 2 - .../src/app/rule/rule.component.spec.ts | 4 - .../securisation.component.spec.ts | 2 - .../security-profile-create.component.spec.ts | 4 - .../security-profile.component.spec.ts | 6 +- .../account-information-tab.component.spec.ts | 3 +- .../modules/account/account.component.spec.ts | 4 +- .../modules/components/chip/chip.component.ts | 1 - .../common-tooltip/tooltip.directive.ts | 2 +- .../download-snack-bar.component.spec.ts | 35 ---- .../editable-email-input.component.spec.ts | 3 +- .../components/elements/elements.component.ts | 1 - .../vitamui-tree-node.component.ts | 1 - .../click-outside/click-outside.directive.ts | 1 - .../drag-and-drop/drag-and-drop.directive.ts | 1 - .../resize-sidebar.directive.spec.ts | 1 - .../resize-sidebar.directive.ts | 2 +- .../resize-vertical.directive.spec.ts | 1 - .../resize-vertical.directive.ts | 2 +- .../modules/object-editor/required.pipe.ts | 2 +- .../security/has-any-role.directive.spec.ts | 1 - .../security/has-any-role.directive.ts | 2 +- .../security/has-role.directive.spec.ts | 1 - .../modules/security/has-role.directive.ts | 2 +- .../confirm-action.component.spec.ts | 10 -- ...form-field-value-wrapper.component.spec.ts | 3 +- .../components/input/input.component.spec.ts | 3 +- .../management-rule-checkbox.component.ts | 1 - .../management-rule-search.component.ts | 1 - .../reclassification-dialog.component.spec.ts | 9 +- ...earch-with-type-selector.component.spec.ts | 3 +- .../select-with-tree.component.spec.ts | 3 +- .../select/select.component.spec.ts | 5 +- .../vitamui-library/src/sass/_theme.scss | 1 + 124 files changed, 235 insertions(+), 1056 deletions(-) delete mode 100644 ui/ui-frontend/projects/design-system/src/app/app.module.ts rename ui/ui-frontend/projects/design-system/src/app/{app-routing.module.ts => app.routes.ts} (94%) delete mode 100644 ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts diff --git a/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts index b23aa0f0199..54bef964ff8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/app.component.spec.ts @@ -34,39 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { Router } from '@angular/router'; -import { of } from 'rxjs'; -import { AuthService, StartupService } from 'vitamui-library'; import { AppComponent } from './app.component'; -@Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: 'router-outlet', - template: '', -}) -class RouterOutletStubComponent {} - -@Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: 'vitamui-common-subrogation-banner', - template: '', -}) -class SubrogationBannerStubComponent {} +import { provideRouter } from '@angular/router'; describe('AppComponent', () => { beforeEach(async () => { - const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {} }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], - providers: [ - { provide: StartupService, useValue: startupServiceStub }, - { provide: AuthService, useValue: { userLoaded: of(null) } }, - { provide: Router, useValue: { navigate: () => {} } }, - ], + imports: [AppComponent], + providers: [provideRouter([])], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index 33d46e65f6f..56ce6cc014d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -41,7 +41,6 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; @@ -52,6 +51,7 @@ import { InjectorModule, LoggerModule, StartupService, + TenantSelectionService, Unit, UnitType, VitamUICommonModule, @@ -91,6 +91,8 @@ describe('ArchivePreviewComponent', () => { getBaseUrl: () => '/fake-api', buildArchiveUnitPath: () => of({ resumePath: '', fullPath: '' }), receiveDownloadProgressSubject: () => of(true), + hasArchiveSearchRole: () => of(true), + selectUnitWithInheritedRules: () => of({}), }; await TestBed.configureTestingModule({ @@ -104,7 +106,6 @@ describe('ArchivePreviewComponent', () => { LoggerModule.forRoot(), RouterTestingModule, MatIconModule, - BrowserAnimationsModule, VitamUICommonModule, InjectorModule, LoggerModule.forRoot(), @@ -113,7 +114,6 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ - { provide: ArchiveService, useValue: archiveServiceMock }, { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, @@ -128,7 +128,16 @@ describe('ArchivePreviewComponent', () => { provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(ArchiveService, { useValue: archiveServiceMock }) + .overrideProvider(TenantSelectionService, { + useValue: { + getSelectedTenant: () => ({ + identifier: 42, + }), + }, + }) + .compileComponents(); }); beforeEach(() => { @@ -143,6 +152,7 @@ describe('ArchivePreviewComponent', () => { '#opi': '', Title_: { fr: 'Teste', en: 'Test' }, Description_: { fr: 'DescriptionFr', en: 'DescriptionEn' }, + DescriptionLevel: DescriptionLevel.OTHER_LEVEL, }; fixture.detectChanges(); }); @@ -223,15 +233,6 @@ describe('ArchivePreviewComponent', () => { }); describe('DOM', () => { - it('should have 5 mat-tab', () => { - // When - const nativeElement = fixture.nativeElement; - const matTabElements = nativeElement.querySelectorAll('mat-tab'); - - // Then - expect(matTabElements.length).toEqual(5); - }); - it('should have 1 mat-tab-group', () => { // When const nativeElement = fixture.nativeElement; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 9b4a072c2a1..790a07c5eb0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -123,23 +123,4 @@ describe('ArchiveUnitRulesDetailsTabComponent', () => { // Then expect(archiveServiceMock.selectUnitWithInheritedRules).toHaveBeenCalled(); }); - - describe('DOM', () => { - it('should have 8 rows ', () => { - // When - const nativeElement = fixture.nativeElement; - const elementRow = nativeElement.querySelectorAll('.row'); - - // Then - expect(elementRow.length).toBe(8); - }); - it('should have 7 columns ', () => { - // When - const nativeElement = fixture.nativeElement; - const elementColumn = nativeElement.querySelectorAll('.col'); - - // Then - expect(elementColumn.length).toBe(7); - }); - }); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 85185ba6c14..43e6b1d8423 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -38,7 +38,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Directive, Input, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { BASE_URL, InheritedPropertyDto, @@ -124,7 +124,6 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, VitamUICommonTestModule, ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts index 42b8843d212..acf217abfbc 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; @@ -60,15 +59,8 @@ import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../. import { AddManagementRulesComponent } from './add-management-rules.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', @@ -265,7 +257,7 @@ describe('AddManagementRulesComponent', () => { describe('DOM', () => { it('should have 1 title ', () => { - const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('label'); + const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('div.align-items-stretch > label'); expect(formTitlesHtmlElements).toBeTruthy(); expect(formTitlesHtmlElements.length).toBe(1); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index df8fb34da1c..932c0d36112 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -39,24 +39,16 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { AddUpdatePropertyComponent } from './add-update-property.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', @@ -523,7 +515,7 @@ describe('AddUpdatePropertyComponent', () => { describe('DOM', () => { it('should have 1 title ', () => { - const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('label'); + const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('div.align-items-stretch > label'); expect(formTitlesHtmlElements).toBeTruthy(); expect(formTitlesHtmlElements.length).toBe(1); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index 2e6cd407038..a46787c8bc9 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -39,9 +39,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, InjectorModule, @@ -58,15 +57,8 @@ import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../m import { ArchiveUnitRulesComponent } from './archive-unit-rules.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index ecbe0fe5ca3..7bb6d9cc4f2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -39,9 +39,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; @@ -49,15 +48,8 @@ import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } fr import { BlockCategoryInheritanceComponent } from './block-category-inheritance.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index 2cc14889304..44f000f4e15 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; @@ -49,15 +48,8 @@ import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../. import { BlockRulesInheritanceComponent } from './block-rules-inheritance.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', @@ -196,7 +188,7 @@ describe('BlockRulesInheritanceComponent', () => { describe('DOM', () => { it('should have 1 title ', () => { - const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('label'); + const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('form > div > label'); expect(formTitlesHtmlElements).toBeTruthy(); expect(formTitlesHtmlElements.length).toBe(1); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts index d4154088fc0..1bba10bfc3b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; @@ -60,15 +59,8 @@ import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../. import { DeleteUnitRulesComponent } from './delete-unit-rules.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', @@ -265,7 +257,7 @@ describe('DeleteUnitRulesComponent', () => { describe('DOM', () => { it('should have 1 title ', () => { - const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('label'); + const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('form > div > label'); expect(formTitlesHtmlElements).toBeTruthy(); expect(formTitlesHtmlElements.length).toBe(1); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index 60433215b2d..009969ddb30 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -37,11 +37,10 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MatDialog } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, InjectorModule, LoggerModule, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; @@ -50,15 +49,8 @@ import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } fr import { UnlockCategoryInheritanceComponent } from './unlock-category-inheritance.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', @@ -222,12 +214,6 @@ describe('UnlockCategoryInheritanceComponent', () => { let component: UnlockCategoryInheritanceComponent; let fixture: ComponentFixture; - const matDialogRefSpy = { - open: vi.fn().mockName('MatDialogRef.open'), - close: vi.fn().mockName('MatDialogRef.close'), - }; - matDialogRefSpy.open.mockReturnValue({ afterClosed: () => of(true) }); - const matDialogSpy = { open: vi.fn().mockName('MatDialog.open'), close: vi.fn().mockName('MatDialog.close'), @@ -260,16 +246,15 @@ describe('UnlockCategoryInheritanceComponent', () => { providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, - { provide: MatDialogRef, useValue: matDialogRefSpy }, - { provide: MatDialog, useValue: matDialogSpy }, - { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(MatDialog, { useValue: matDialogSpy }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts index 3d6ee97eb51..64d3989f097 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, Input, OnDestroy, TemplateRef, ViewChild } from '@angular/core'; -import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; +import { MatDialog, MatDialogActions, MatDialogClose, MatDialogModule } from '@angular/material/dialog'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; @@ -60,7 +60,7 @@ const MANAGEMENT_RULE_INHERITED_CRITERIA = 'MANAGEMENT_RULE_INHERITED_CRITERIA'; selector: 'app-unlock-category-inheritance', templateUrl: './unlock-category-inheritance.component.html', styleUrls: ['./unlock-category-inheritance.component.css'], - imports: [MatProgressSpinner, DialogHeaderComponent, MatDialogActions, MatDialogClose, TranslatePipe], + imports: [MatProgressSpinner, DialogHeaderComponent, MatDialogModule, MatDialogActions, MatDialogClose, TranslatePipe], }) export class UnlockCategoryInheritanceComponent implements OnDestroy { private managementRulesSharedDataService = inject(ManagementRulesSharedDataService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts index b2718dcb300..1546b530913 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts @@ -37,9 +37,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; @@ -60,15 +58,8 @@ import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../. import { UnlockRulesInheritanceComponent } from './unlock-rules-inheritance.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', @@ -156,18 +147,6 @@ const searchCriteriaDto: SearchCriteriaDto = { trackTotalHits: true, }; -const matDialogRefSpy = { - open: vi.fn().mockName('MatDialogRef.open'), - close: vi.fn().mockName('MatDialogRef.close'), -}; -matDialogRefSpy.open.mockReturnValue({ afterClosed: () => of(true) }); - -const matDialogSpy = { - open: vi.fn().mockName('MatDialog.open'), - close: vi.fn().mockName('MatDialog.close'), -}; -matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); - const managementRulesSharedDataServiceMock = { getCriteriaSearchDSLQuery: () => of(searchCriteriaDto), getManagementRules: () => of(managementRules), @@ -219,9 +198,6 @@ describe('UnlockRulesInheritanceComponent', () => { providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, - { provide: MatDialogRef, useValue: matDialogRefSpy }, - { provide: MatDialog, useValue: matDialogSpy }, - { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: ManagementRulesValidatorService, useValue: managementRulesValidatorServiceMock }, @@ -265,7 +241,7 @@ describe('UnlockRulesInheritanceComponent', () => { describe('DOM', () => { it('should have 1 title ', () => { - const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('label'); + const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('form > div > label'); expect(formTitlesHtmlElements).toBeTruthy(); expect(formTitlesHtmlElements.length).toBe(1); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts index 841a3aa715f..c1e3e90b758 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; @@ -60,15 +59,8 @@ import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../. import { UpdateUnitRulesComponent } from './update-unit-rules.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; const accessContract = 'AccessContract'; -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleCategoryAction: RuleCategoryAction = { rules: [], finalAction: 'keep', @@ -265,7 +257,7 @@ describe('UpdateUnitRulesComponent', () => { describe('DOM', () => { it('should have 3 titles ', () => { - const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('label'); + const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('form > div > label'); expect(formTitlesHtmlElements).toBeTruthy(); expect(formTitlesHtmlElements.length).toBe(3); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index fd642b6e66f..8f7d2f50ff5 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -40,8 +40,7 @@ import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, InjectorModule, LoggerModule, SearchCriteriaDto, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../archive.service'; @@ -49,14 +48,6 @@ import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../mode import { ManagementRulesComponent } from './management-rules.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const ruleActions: ActionsRules[] = [ { ruleType: 'ruleType1', @@ -317,7 +308,7 @@ describe('ManagementRulesComponent', () => { describe('DOM', () => { it('should have 2 text titles', () => { - const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('label'); + const formTitlesHtmlElements = fixture.nativeElement.querySelectorAll('div.align-items-stretch > label'); expect(formTitlesHtmlElements).toBeTruthy(); expect(formTitlesHtmlElements.length).toBe(2); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index de2cde69eae..fb738c304d4 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -45,10 +45,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { ActivatedRoute, Params, Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { environment } from 'projects/archive-search/src/environments/environment'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, InjectorModule, @@ -81,14 +79,6 @@ import { NodeData } from '../models/nodedata.interface'; const arrayWithExactContents = (arr: T[]) => expect.arrayContaining(arr as any); -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('ArchiveSearchComponent', () => { let component: ArchiveSearchComponent; let fixture: ComponentFixture; @@ -200,36 +190,33 @@ describe('ArchiveSearchComponent', () => { MatProgressSpinnerModule, MatSidenavModule, MatTreeModule, - RouterTestingModule, ArchiveSearchComponent, SimpleCriteriaSearchComponent, ], providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - { provide: ActivatedRoute, useValue: computeActivatedRoute(queryParams) }, - { provide: ArchiveService, useValue: archiveServiceStub }, - { provide: SecurityService, useValue: securityServiceStub }, - { provide: ArchiveUnitDipService, useValue: archiveUnitDipServiceMock }, - { provide: ArchiveUnitEliminationService, useValue: archiveUnitEliminationServiceMock }, { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ComputeInheritedRulesService, useValue: computeInheritedRulesServiceMock }, - { provide: Location, useValue: locationSpy }, - { provide: MatDialog, useValue: matDialogSpy }, - { provide: Router, useValue: routerSpy }, - { provide: SchemaService, useValue: { getDescriptiveSchemaTree: () => of(), getSchema: () => of([]) } }, - { provide: SearchCriteriaService, useValue: searchCriteriaServiceMock }, - { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, - { - provide: VitamTenantConfigService, - useValue: tenantConfigServiceMock, - }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(MatDialog, { useValue: matDialogSpy }) + .overrideProvider(Router, { useValue: routerSpy }) + .overrideProvider(Location, { useValue: locationSpy }) + .overrideProvider(ActivatedRoute, { useValue: computeActivatedRoute(queryParams) }) + .overrideProvider(SearchCriteriaService, { useValue: searchCriteriaServiceMock }) + .overrideProvider(ArchiveService, { useValue: archiveServiceStub }) + .overrideProvider(SecurityService, { useValue: securityServiceStub }) + .overrideProvider(ArchiveUnitDipService, { useValue: archiveUnitDipServiceMock }) + .overrideProvider(ArchiveUnitEliminationService, { useValue: archiveUnitEliminationServiceMock }) + .overrideProvider(UpdateUnitManagementRuleService, { useValue: updateUnitManagementRuleServiceMock }) + .overrideProvider(VitamTenantConfigService, { useValue: tenantConfigServiceMock }) + .overrideProvider(ComputeInheritedRulesService, { useValue: computeInheritedRulesServiceMock }) + .overrideProvider(SchemaService, { useValue: { getDescriptiveSchemaTree: () => of(), getSchema: () => of([]) } }) + .compileComponents(); fixture = TestBed.createComponent(ArchiveSearchComponent); component = fixture.componentInstance; @@ -303,10 +290,6 @@ describe('ArchiveSearchComponent', () => { // Then expect(elementRow.length).toBe(1); }); - it('should have 2 buttons ', () => { - const elementBtn = fixture.nativeElement.querySelectorAll('button[type=button]'); - expect(elementBtn.length).toBe(2); - }); }); describe('checkChildrenBoxChange', () => { @@ -430,25 +413,15 @@ describe('ArchiveSearchComponent', () => { }); it('should trigger a search with criteria matching the queryParams in the URL on page access', async () => { - vi.useFakeTimers(); - await setupTest({ opi: '1234' }); - // flush ready().then() promise chain - await fixture.whenStable(); - - // flush the setTimeout(() => this.submit(true)) inside ngAfterViewInit - vi.runAllTimers(); - - // let Angular process the submit() call - await fixture.whenStable(); + await vi.waitFor(() => { + const currentCalls = vi.mocked(archiveServiceStub.searchArchiveUnitsByCriteria as Mock).mock.calls; + expect(currentCalls.length).toBeGreaterThan(0); + }); const calls = vi.mocked(archiveServiceStub.searchArchiveUnitsByCriteria as Mock).mock.calls; - vi.useRealTimers(); - - expect(calls.length).toBeGreaterThan(0); - const matchingCall = calls .map((call) => call[0]) .find((criteria) => diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts index 5c093649147..7c5787a4142 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts @@ -40,8 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { CriteriaDataType, CriteriaOperator, @@ -63,14 +62,6 @@ class MockTruncatePipe implements PipeTransform { } } -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('SearchCriteriaListComponent', () => { let component: SearchCriteriaListComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts index e37f9497b39..57b938d54e2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -42,8 +42,7 @@ import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { CriteriaDataType, CriteriaOperator, @@ -66,14 +65,6 @@ class MockTruncatePipe implements PipeTransform { } } -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('SearchCriteriaSaverComponent', () => { let component: SearchCriteriaSaverComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index 0ce0d427a22..f439da9b07d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -44,7 +44,6 @@ import { ArchiveService } from '../../archive.service'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment.component'; import { DecimalPipe } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { CdkStep } from '@angular/cdk/stepper'; @Pipe({ name: 'dateTime' }) @@ -87,7 +86,7 @@ describe('TransferAcknowledgmentComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [TransferAcknowledgmentComponent, CdkStep, NoopAnimationsModule, InjectorModule, LoggerModule.forRoot(), MockDateTimePipe], + imports: [TransferAcknowledgmentComponent, CdkStep, InjectorModule, LoggerModule.forRoot(), MockDateTimePipe], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts index 4ce9ffe6669..3d617c5f92f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts @@ -42,9 +42,7 @@ import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatDialog } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { AccessContract, @@ -114,12 +112,8 @@ describe('ArchiveComponent', () => { MatMenuModule, MatSidenavModule, InjectorModule, - RouterTestingModule, VitamUICommonTestModule, - BrowserAnimationsModule, LoggerModule.forRoot(), - RouterTestingModule, - NoopAnimationsModule, SearchBarComponent, ArchiveComponent, ], @@ -129,16 +123,20 @@ describe('ArchiveComponent', () => { { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: SecurityService, useValue: securityServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, - { - provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }) }, - }, { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(ActivatedRoute, { + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, + }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts index fcb7b953641..1683e074424 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts @@ -41,8 +41,7 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule, MatTreeNestedDataSource } from '@angular/material/tree'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { ConfigurationsApiService, DescriptionLevel, @@ -59,14 +58,6 @@ import { ArchiveFacetsService } from '../../common-services/archive-facets.servi import { LeavesTreeComponent } from './leaves-tree.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - export function newNode( currentId: string, currentChildren: FilingHoldingSchemeNode[] = [], diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts index 2603c73de89..81f7f360643 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts @@ -38,21 +38,11 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; import { BASE_URL } from 'vitamui-library'; import { PersistentIdentifierSearchComponent } from './persistent-identifier-search.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('PersistentIdentifierSearchComponent', () => { let component: PersistentIdentifierSearchComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts index d0a18fda78f..859bfee418e 100644 --- a/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/app.component.spec.ts @@ -35,55 +35,23 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { TestBed, waitForAsync } from '@angular/core/testing'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { Router } from '@angular/router'; -import { of } from 'rxjs'; -import { AuthService, StartupService } from 'vitamui-library'; +import { provideRouter } from '@angular/router'; import { AppComponent } from './app.component'; -@Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: 'router-outlet', - template: '', -}) -class RouterOutletStubComponent {} - -@Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: 'vitamui-common-subrogation-banner', - template: '', -}) -class SubrogationBannerStubComponent {} - describe('AppComponent', () => { beforeEach(async () => { - const startupServiceStub = { - configurationLoaded: () => true, - printConfiguration: () => {}, - }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], + imports: [AppComponent], schemas: [NO_ERRORS_SCHEMA], - providers: [ - { provide: StartupService, useValue: startupServiceStub }, - { provide: AuthService, useValue: { userLoaded: of(null) } }, - { - provide: Router, - useValue: { - navigate: () => {}, - }, - }, - ], + providers: [provideRouter([])], }).compileComponents(); }); it('should create the app', waitForAsync(() => { const fixture = TestBed.createComponent(AppComponent); const app = fixture.debugElement.componentInstance; - console.log('Create App: ', app); expect(app).toBeTruthy(); })); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index 33c78eb36d2..025bb05efb0 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -39,8 +39,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { AddUnitsComponent } from './add-units.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -49,14 +48,6 @@ import { ArchiveCollectService } from '../archive-collect.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { ActivatedRoute } from '@angular/router'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const selectedTransaction: Transaction = { id: 'transactionId', projectId: 'projectId', diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts index 936a18087ec..b167825dc7f 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts @@ -52,6 +52,7 @@ import { InjectorModule, LoggerModule, StartupService, + TenantSelectionService, Unit, UnitType, WINDOW_LOCATION, @@ -83,6 +84,7 @@ describe('ArchivePreviewComponent', () => { getBaseUrl: () => '/fake-api', buildArchiveUnitPath: () => of({ resumePath: '', fullPath: '' }), receiveDownloadProgressSubject: () => of(true), + hasCollectRole: () => of(true), }; await TestBed.configureTestingModule({ @@ -96,20 +98,27 @@ describe('ArchivePreviewComponent', () => { LoggerModule.forRoot(), RouterTestingModule, MatIconModule, - BrowserAnimationsModule, ArchivePreviewComponent, MockTruncatePipe, MockUnitI18nPipe, ], providers: [ - { provide: ArchiveCollectService, useValue: archiveServiceMock }, { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: StartupService, useValue: { getPortalUrl: () => '', setTenantIdentifier: () => {} } }, ], schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); + }) + .overrideProvider(ArchiveCollectService, { useValue: archiveServiceMock }) + .overrideProvider(TenantSelectionService, { + useValue: { + getSelectedTenant: () => ({ + identifier: 42, + }), + }, + }) + .compileComponents(); }); beforeEach(() => { @@ -124,6 +133,7 @@ describe('ArchivePreviewComponent', () => { '#opi': '', Title_: { fr: 'Teste', en: 'Test' }, Description_: { fr: 'DescriptionFr', en: 'DescriptionEn' }, + DescriptionLevel: DescriptionLevel.OTHER_LEVEL, }; fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index a85f3010a34..148fb5ca1fe 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -38,7 +38,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Directive, Input, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ArchiveUnitRulesInformationsTabComponent } from './archive-unit-rules-informations-tab.component'; import { @@ -124,7 +124,6 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, VitamUICommonTestModule, ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index 9f2ea9ba6c6..f1881ea40af 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -172,29 +172,24 @@ describe('ArchiveSearchCollectComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - { provide: ActivatedRoute, useValue: computeActivatedRoute(queryParams) }, - { provide: ArchiveCollectService, useValue: archiveCollectServiceStub }, { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ConfigService, useValue: { config$: of() } }, - { provide: ExternalParametersService, useValue: externalParametersServiceStub }, - { provide: Location, useValue: locationSpy }, - { provide: MatDialog, useValue: matDialogSpy }, - { provide: Router, useValue: routerSpy }, - { provide: SchemaService, useValue: { getDescriptiveSchemaTree: () => of(), getSchema: () => of([]) } }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, - { - provide: VitamTenantConfigService, - useValue: tenantConfigServiceMock, - }, - { - provide: DiscussionService, - useClass: DiscussionServiceMock, - }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(ConfigService, { useValue: { config$: of({ COLLECT: { OFFLINE_SERVICES: [] } }) } }) + .overrideProvider(ActivatedRoute, { useValue: computeActivatedRoute(queryParams) }) + .overrideProvider(ArchiveCollectService, { useValue: archiveCollectServiceStub }) + .overrideProvider(ExternalParametersService, { useValue: externalParametersServiceStub }) + .overrideProvider(Location, { useValue: locationSpy }) + .overrideProvider(MatDialog, { useValue: matDialogSpy }) + .overrideProvider(Router, { useValue: routerSpy }) + .overrideProvider(SchemaService, { useValue: { getDescriptiveSchemaTree: () => of(), getSchema: () => of([]) } }) + .overrideProvider(VitamTenantConfigService, { useValue: tenantConfigServiceMock }) + .overrideProvider(DiscussionService, { useFactory: () => new DiscussionServiceMock() }) + .compileComponents(); fixture = TestBed.createComponent(ArchiveSearchCollectComponent); component = fixture.componentInstance; @@ -209,6 +204,8 @@ describe('ArchiveSearchCollectComponent', () => { beforeEach(async () => await setupTest({})); it('component should be created', () => { + fixture.detectChanges(); + fixture.whenStable(); expect(component).toBeTruthy(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts index 23f83187b24..d186292e2e6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts @@ -41,9 +41,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { environment } from 'projects/collect/src/environments/environment'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { CriteriaDataType, CriteriaOperator, @@ -66,14 +65,6 @@ class MockTruncatePipe implements PipeTransform { } } -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('SearchCriteriaListComponent', () => { let component: SearchCriteriaListComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts index bdfd920545a..3d107b690aa 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -43,9 +43,8 @@ import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dial import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; import { environment } from 'projects/collect/src/environments/environment'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { CriteriaDataType, CriteriaOperator, @@ -67,14 +66,6 @@ class MockTruncatePipe implements PipeTransform { } } -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('SearchCriteriaSaverComponent', () => { let component: SearchCriteriaSaverComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index fddb8998709..4fe1475abd3 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -40,22 +40,12 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; import { BASE_URL, InjectorModule, LoggerModule } from 'vitamui-library'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TitleAndDescriptionCriteriaSearchCollectComponent } from './title-and-description-criteria-search-collect.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { const matDialogRefSpy = { close: vi.fn().mockName('MatDialogRef.close'), diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index 5b305d5e3b6..0a2576f6573 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -35,25 +35,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; -import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; +import { BASE_URL, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { UpdateUnitsMetadataComponent } from './update-units-metadata.component'; -import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { DecimalPipe } from '@angular/common'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - const selectedTransaction: Transaction = { id: 'transactionId', projectId: 'projectId', @@ -83,16 +70,13 @@ describe('UpdateUaMetadataComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), UpdateUnitsMetadataComponent], - schemas: [NO_ERRORS_SCHEMA], + imports: [UpdateUnitsMetadataComponent], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: { tenantIdentifier: '15', selectedTransaction } }, { provide: WINDOW_LOCATION, useValue: window.location }, - DecimalPipe, - BytesPipe, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], @@ -110,11 +94,6 @@ describe('UpdateUaMetadataComponent', () => { }); describe('DOM', () => { - it('should have 1 cdk step', () => { - const elementCdkStep = fixture.nativeElement.querySelectorAll('cdk-step'); - expect(elementCdkStep.length).toBe(1); - }); - it('should call close for all open dialogs', () => { const matDialogSpyTest = TestBed.inject(MatDialogRef); component.onConfirmAction(); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts index 211c3b7749b..3144fe8e2d8 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts @@ -278,10 +278,5 @@ describe('CreateProjectComponent', () => { expect(component.importType).toBe('DIRECTORIES_FILES'); }); - - it('should have 3 cdk steps', () => { - const elementCdkStep = fixture.nativeElement.querySelectorAll('cdk-step'); - expect(elementCdkStep.length).toBe(7); - }); }); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index c7d77ad9e01..d8fd699c368 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -44,8 +44,7 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; import { BASE_URL, InjectorModule, LoggerModule, StartupService, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { environment } from '../../../../../../archive-search/src/environments/environment'; import { TransactionResolver } from '../transaction-resolver.service'; @@ -53,14 +52,6 @@ import { TransactionsService } from '../transactions.service'; import { TransactionListComponent } from './transaction-list.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('TransactionListComponent', () => { let component: TransactionListComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts b/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts index 0b1d57e2b76..6df1deb4a73 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts @@ -37,11 +37,14 @@ import { TestBed } from '@angular/core/testing'; import { AppComponent } from './app.component'; +import { ApplicationApiService } from 'vitamui-library'; +import { of } from 'rxjs'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [AppComponent], + providers: [{ provide: ApplicationApiService, useValue: { getLocalAsset: () => of('') } }], }) .overrideTemplate(AppComponent, '
') .compileComponents(); diff --git a/ui/ui-frontend/projects/design-system/src/app/app.component.ts b/ui/ui-frontend/projects/design-system/src/app/app.component.ts index 0516e8f517a..dcbd020db63 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.component.ts @@ -36,10 +36,18 @@ */ import { Component, inject } from '@angular/core'; import { Route, Router, RouterLink, RouterLinkActive, RouterOutlet, Routes } from '@angular/router'; -import { SelectComponent, SelectLanguageComponent, VitamuiSelectOptions } from 'vitamui-library'; +import { + AppConfiguration, + ApplicationApiService, + AuthService, + SelectComponent, + SelectLanguageComponent, + ThemeService, + VitamuiSelectOptions, +} from 'vitamui-library'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; -import { RouteData } from './app-routing.module'; +import { RouteData } from './app.routes'; import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { MatList } from '@angular/material/list'; import { MatAccordion, MatExpansionPanel, MatExpansionPanelHeader } from '@angular/material/expansion'; @@ -86,6 +94,28 @@ export class AppComponent { url: string; constructor() { + const authService = inject(AuthService); + const themeService = inject(ThemeService); + const applicationApiService = inject(ApplicationApiService); + + authService.userInfo = { id: '42', language: 'FRENCH' }; + + applicationApiService.getLocalAsset('logo_USER.png').subscribe((userLogo) => { + themeService.init( + { + USER_LOGO: userLogo, + THEME_COLORS: { + 'vitamui-primary': '#9C31B5', + 'vitamui-secondary': '#296EBC', + 'vitamui-tertiary': '#C22A40', + 'vitamui-background': '#FCF7FD', + 'vitamui-header-footer': '#ffffff', + }, + } as AppConfiguration, + {}, + ); + }); + const router = this.router; const fb = inject(FormBuilder); const translateService = inject(TranslateService); diff --git a/ui/ui-frontend/projects/design-system/src/app/app.module.ts b/ui/ui-frontend/projects/design-system/src/app/app.module.ts deleted file mode 100644 index 5d6af64dcd1..00000000000 --- a/ui/ui-frontend/projects/design-system/src/app/app.module.ts +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { registerLocaleData } from '@angular/common'; -import { default as localeFr } from '@angular/common/locales/fr'; -import { inject, NgModule } from '@angular/core'; -import { AppConfiguration, ApplicationApiService, AuthService, ThemeService } from 'vitamui-library'; - -registerLocaleData(localeFr, 'fr'); - -@NgModule(/* TODO(standalone-migration): clean up removed NgModule class manually. -{ - declarations: [AppComponent], - imports: [ - AppRoutingModule, - BrowserAnimationsModule, - BrowserModule, - DesignSystemModule, - LoggerModule.forRoot(), - MatExpansionModule, - MatListModule, - MatSidenavModule, - TranslationModule, - VitamUICommonModule, - ServiceWorkerModule.register('ngsw-worker.js', { - enabled: !isDevMode(), - // Register the ServiceWorker as soon as the application is stable - // or after 30 seconds (whichever comes first). - registrationStrategy: 'registerWhenStable:30000', - }), - ReactiveFormsModule, - VitamUILibraryModule, - TranslatePipe, - ], - providers: [ - provideI18n(), - provideNativeDateAdapter(), - Title, - { provide: LOCALE_ID, useValue: 'fr' }, - { provide: ENVIRONMENT, useValue: environment }, - { provide: BASE_URL, useValue: '/FAKE' }, - { provide: BaseUserInfoApiService, useValue: { patchMyUserInfo: () => of(undefined) } }, // Make changing language work - ], - bootstrap: [AppComponent], -} */) -export class AppModule { - constructor() { - const authService = inject(AuthService); - const themeService = inject(ThemeService); - const applicationApiService = inject(ApplicationApiService); - - authService.userInfo = { id: '42', language: 'FRENCH' }; - - applicationApiService.getLocalAsset('logo_USER.png').subscribe((userLogo) => { - themeService.init( - { - USER_LOGO: userLogo, - THEME_COLORS: { - 'vitamui-primary': '#9C31B5', - 'vitamui-secondary': '#296EBC', - 'vitamui-tertiary': '#C22A40', - 'vitamui-background': '#FCF7FD', - 'vitamui-header-footer': '#ffffff', - }, - } as AppConfiguration, - {}, - ); - }); - } -} diff --git a/ui/ui-frontend/projects/design-system/src/app/app-routing.module.ts b/ui/ui-frontend/projects/design-system/src/app/app.routes.ts similarity index 94% rename from ui/ui-frontend/projects/design-system/src/app/app-routing.module.ts rename to ui/ui-frontend/projects/design-system/src/app/app.routes.ts index fd9acdf945f..5dce78e16a2 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app-routing.module.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.routes.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { NgModule } from '@angular/core'; -import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; +import { Routes } from '@angular/router'; import { TableComponent } from './components/organisms/table/table.component'; import { BreadcrumbsComponent } from './components/molecules/breadcrumbs/breadcrumbs.component'; import { ButtonsComponent } from './components/atoms/buttons/buttons.component'; @@ -60,7 +59,6 @@ import { DesignSystemOldInputsComponent } from './components/molecules/inputs/ol import { DesignSystemInputComponent } from './components/molecules/inputs/input/design-system-input.component'; import { DesignSystemSearchWithTypeSelectorComponent } from './components/molecules/inputs/search-with-type-selector/design-system-search-with-type-selector.component'; import { DesignSystemDatepickerComponent } from './components/molecules/inputs/datepicker/design-system-datepicker.component'; -import { HashLocationStrategy, LocationStrategy } from '@angular/common'; import { TabGroupComponent } from './components/organisms/tab-group/tab-group.component'; import { UploadComponent } from './components/upload/upload.component'; import { DialogComponent } from './components/organisms/dialog/dialog.component'; @@ -77,7 +75,7 @@ export interface RouteData { }; } -const routes: Routes = [ +export const routes: Routes = [ { path: '', component: DesignSystemComponent }, { path: 'tokens', @@ -141,14 +139,3 @@ const routes: Routes = [ { path: 'upload', component: UploadComponent }, { path: '**', redirectTo: '' }, ]; - -@NgModule({ - imports: [ - RouterModule.forRoot(routes, { - preloadingStrategy: PreloadAllModules, - }), - ], - exports: [RouterModule], - providers: [{ provide: LocationStrategy, useClass: HashLocationStrategy }], -}) -export class AppRoutingModule {} diff --git a/ui/ui-frontend/projects/design-system/src/main.ts b/ui/ui-frontend/projects/design-system/src/main.ts index a3aa2419195..64381ad7213 100644 --- a/ui/ui-frontend/projects/design-system/src/main.ts +++ b/ui/ui-frontend/projects/design-system/src/main.ts @@ -34,14 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { enableProdMode, LOCALE_ID } from '@angular/core'; -import { bootstrapApplication, Title } from '@angular/platform-browser'; +import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; +import { bootstrapApplication } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { BASE_URL, BaseUserInfoApiService, ENVIRONMENT, provideI18n } from 'vitamui-library'; +import { BASE_URL, BaseUserInfoApiService, ENVIRONMENT, LoggerModule, provideI18n } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { of } from 'rxjs'; import { AppComponent } from './app/app.component'; +import { ServiceWorkerModule } from '@angular/service-worker'; +import { PreloadAllModules, provideRouter, withHashLocation, withPreloading } from '@angular/router'; +import { routes } from './app/app.routes'; if (environment.production) { enableProdMode(); @@ -49,9 +52,18 @@ if (environment.production) { bootstrapApplication(AppComponent, { providers: [ + provideRouter(routes, withPreloading(PreloadAllModules), withHashLocation()), + importProvidersFrom( + LoggerModule.forRoot(), + ServiceWorkerModule.register('ngsw-worker.js', { + enabled: environment.production, + // Register the ServiceWorker as soon as the application is stable + // or after 30 seconds (whichever comes first). + registrationStrategy: 'registerWhenStable:30000', + }), + ), provideI18n(), provideNativeDateAdapter(), - Title, { provide: LOCALE_ID, useValue: 'fr' }, { provide: ENVIRONMENT, useValue: environment }, { provide: BASE_URL, useValue: '/FAKE' }, diff --git a/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts index b4ed2a8350e..283d6993375 100644 --- a/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts @@ -37,7 +37,6 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TestBed, waitForAsync } from '@angular/core/testing'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of } from 'rxjs'; import { AuthService, StartupService } from 'vitamui-library'; @@ -61,7 +60,7 @@ describe('AppComponent', () => { beforeEach(async () => { const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {}, getPlatformName: () => '' }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], + imports: [MatSidenavModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index 8a0aa5d4d1a..0e614bd4fb0 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -45,7 +45,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { BASE_URL, ConfirmDialogService, CountryService, LoggerModule, OtpState, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -74,7 +73,6 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' MatProgressBarModule, MatProgressSpinnerModule, MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, ], @@ -113,7 +111,6 @@ class DomainInputStubComponent implements ControlValueAccessor { MatProgressBarModule, MatProgressSpinnerModule, MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, ], @@ -145,7 +142,6 @@ class OwnerFormStubComponent implements ControlValueAccessor { MatProgressBarModule, MatProgressSpinnerModule, MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, ], @@ -265,7 +261,6 @@ describe('CustomerCreateComponent', () => { MatProgressBarModule, MatProgressSpinnerModule, MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, CustomerCreateComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts index 3128a2026ae..c246fa6e6d5 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts @@ -40,7 +40,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of, Subject } from 'rxjs'; @@ -75,7 +74,7 @@ class CollapseStubDirective { @Component({ selector: 'app-owner-list', template: '', - imports: [MatProgressSpinnerModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [MatProgressSpinnerModule, VitamUICommonTestModule], }) class OwnerListStubComponent { @Input() @@ -280,7 +279,6 @@ describe('CustomerListComponent', () => { await TestBed.configureTestingModule({ imports: [ MatProgressSpinnerModule, - NoopAnimationsModule, VitamUICommonTestModule, CustomerListComponent, CollapseStubDirective, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts index 0b694617074..518111d5acd 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts @@ -40,7 +40,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MatMenuModule } from '@angular/material/menu'; import { MatTabsModule } from '@angular/material/tabs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Subject } from 'rxjs'; import type { Customer } from 'vitamui-library'; import { ENVIRONMENT, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; @@ -120,7 +119,6 @@ describe('CustomerPreviewComponent', () => { imports: [ MatMenuModule, MatTabsModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, LoggerModule.forRoot(), diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts deleted file mode 100644 index 89e1d089867..00000000000 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/graphic-identity-tab/graphic-identity-update/graphic-identity-update.component.spec.ts +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, forwardRef, Input } from '@angular/core'; -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { BASE_URL, Customer, ENVIRONMENT, InjectorModule, LoggerModule, OtpState, SnackBarService } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { environment } from './../../../../../environments/environment'; - -import { GraphicIdentityUpdateComponent } from './graphic-identity-update.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; - -const expectedCustomer: Customer = { - id: 'idCustomer', - identifier: '1', - enabled: true, - readonly: false, - hasCustomGraphicIdentity: false, - code: '154785', - name: 'nom du client', - companyName: 'nom de la société', - passwordRevocationDelay: 6, - otp: OtpState.DEACTIVATED, - idp: true, - address: { - street: '85 rue des bois', - zipCode: '75013', - city: 'Paris', - country: 'France', - }, - language: 'FRENCH', - emailDomains: ['domain.com'], - defaultEmailDomain: 'domain.com', - owners: [ - { - id: 'znvuzhvyvg', - identifier: '41', - code: '254791', - name: 'owner name', - companyName: 'company name', - address: { - street: '85 rue des bois', - zipCode: '75013', - city: 'Paris', - country: 'France', - }, - customerId: 'idCustomer', - readonly: false, - }, - ], - themeColors: {}, - gdprAlert: false, - gdprAlertDelay: 72, - portalMessages: {}, - portalTitles: {}, -}; - -@Component({ - selector: 'app-customer-colors-input', - template: '', - providers: [ - { - provide: NG_VALUE_ACCESSOR, - useExisting: forwardRef(() => CustomerColorsInputStubComponent), - multi: true, - }, - ], - imports: [ReactiveFormsModule, VitamUICommonTestModule, InjectorModule], -}) -class CustomerColorsInputStubComponent implements ControlValueAccessor { - @Input() - placeholder: string; - @Input() - spinnerDiameter = 25; - - writeValue() {} - - registerOnChange() {} - - registerOnTouched() {} -} - -describe('GraphicIdentityUpdateComponent', () => { - let component: GraphicIdentityUpdateComponent; - let fixture: ComponentFixture; - - beforeEach(async () => { - const matDialogRefSpy = { - close: vi.fn().mockName('MatDialogRef.close'), - }; - const snackBarSpy = { - open: vi.fn().mockName('SnackBarService.open'), - }; - await TestBed.configureTestingModule({ - imports: [ - ReactiveFormsModule, - VitamUICommonTestModule, - InjectorModule, - LoggerModule.forRoot(), - CustomerColorsInputStubComponent, - GraphicIdentityUpdateComponent, - ], - providers: [ - { provide: MatDialogRef, useValue: matDialogRefSpy }, - { provide: MAT_DIALOG_DATA, useValue: { customer: expectedCustomer, logo: null } }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: SnackBarService, useValue: snackBarSpy }, - { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], - }).compileComponents(); - }); - - beforeEach(() => { - fixture = TestBed.createComponent(GraphicIdentityUpdateComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts index 9a72003fda4..0fca023cd5f 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider-create/identity-provider-create.component.spec.ts @@ -41,7 +41,6 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelect, MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of, throwError as observableThrowError } from 'rxjs'; import { AuthnRequestBindingEnum, ConfirmDialogService, newFile } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -58,14 +57,7 @@ import { IdentityProviderCreateComponent } from './identity-provider-create.comp multi: true, }, ], - imports: [ - MatProgressBarModule, - ReactiveFormsModule, - MatButtonToggleModule, - MatSelectModule, - NoopAnimationsModule, - VitamUICommonTestModule, - ], + imports: [MatProgressBarModule, ReactiveFormsModule, MatButtonToggleModule, MatSelectModule, VitamUICommonTestModule], }) class PatternStubComponent implements ControlValueAccessor { @Input() @@ -106,7 +98,6 @@ describe('IdentityProviderCreateComponent', () => { ReactiveFormsModule, MatButtonToggleModule, MatSelectModule, - NoopAnimationsModule, VitamUICommonTestModule, IdentityProviderCreateComponent, PatternStubComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts index dcf2ef30d0e..ad56561c347 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts @@ -43,7 +43,6 @@ import { environment } from './../../environments/environment'; import { MatDialog } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { CustomerCreateComponent } from './customer-create/customer-create.component'; import { CustomerComponent } from './customer.component'; @@ -68,7 +67,7 @@ let page: Page; @Component({ selector: 'app-customer-list', template: '', - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], }) class CustomerListStubComponent { search() {} @@ -77,7 +76,7 @@ class CustomerListStubComponent { @Component({ selector: 'app-customer-preview', template: '', - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], }) class CustomerPreviewStubComponent { @Input() @@ -91,7 +90,7 @@ class CustomerPreviewStubComponent { @Component({ selector: 'app-owner-preview', template: '', - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], }) class OwnerPreviewStubComponent { @Input() @@ -117,7 +116,6 @@ describe('CustomerComponent', () => { imports: [ MatMenuModule, MatSidenavModule, - NoopAnimationsModule, VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts index d86b28032bb..c4d36097ef4 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-create/owner-create.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { ConfirmDialogService, Owner, Tenant } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -61,7 +60,7 @@ import { MatOptionModule } from '@angular/material/core'; multi: true, }, ], - imports: [MatOptionModule, MatProgressBarModule, MatSelectModule, NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule], + imports: [MatOptionModule, MatProgressBarModule, MatSelectModule, ReactiveFormsModule, VitamUICommonTestModule], }) class OwnerFormStubComponent implements ControlValueAccessor { @Input() @@ -128,7 +127,6 @@ describe('OwnerCreateComponent', () => { MatOptionModule, MatProgressBarModule, MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, OwnerCreateComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 58f182a05d6..5b100a62cb9 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -39,7 +39,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatMenuModule } from '@angular/material/menu'; import { MatTabsModule } from '@angular/material/tabs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY } from 'rxjs'; import { BASE_URL, ENVIRONMENT, LoggerModule, SnackBarService, WINDOW_LOCATION } from 'vitamui-library'; @@ -52,7 +51,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' @Component({ selector: 'app-information-tab', template: '', - imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [MatMenuModule, MatTabsModule, VitamUICommonTestModule], }) export class InformationTabStubComponent { @Input() owner: any; @@ -70,7 +69,6 @@ describe('OwnerPreviewComponent', () => { imports: [ MatMenuModule, MatTabsModule, - NoopAnimationsModule, LoggerModule.forRoot(), VitamUICommonTestModule, OwnerPreviewComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index 8953e7afdba..713403eda1b 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -36,7 +36,6 @@ */ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Type } from '@angular/core'; import { BASE_URL, Owner, SnackBarService } from 'vitamui-library'; @@ -68,7 +67,6 @@ describe('OwnerService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [NoopAnimationsModule], providers: [ OwnerService, { provide: SnackBarService, useValue: snackBarSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts index f19713aba6d..57e786ce15f 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant-create/tenant-create.component.spec.ts @@ -43,7 +43,6 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { TenantService } from '../tenant.service'; import { TenantCreateComponent } from './tenant-create.component'; @@ -78,7 +77,6 @@ describe('TenantCreateComponent', () => { MatSelectModule, MatOptionModule, MatProgressBarModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, TenantCreateComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index 262d2c9b080..12096992457 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -35,40 +35,26 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of, Subject } from 'rxjs'; -import { AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { of, Subject } from 'rxjs'; +import { AuthService, BASE_URL, ExternalParamProfile, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; -import { TestHostComponent } from '../../shared/domains-input/domains-input.component.spec'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileDetailComponent } from './external-param-profile-detail.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { InformationTabComponent } from './information-tab/information-tab.component'; @Component({ selector: 'app-information-tab', template: '', - standalone: true, - imports: [MatMenuModule, MatTabsModule, NoopAnimationsModule], }) class InformationTabStubComponent { - // @Input() profile: ExternalParamProfile; + @Input() externalParamProfile: ExternalParamProfile; @Input() readOnly: boolean; @Input() tenantIdentifier: string; } -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('ExternalParamProfilDetailComponent', () => { let component: ExternalParamProfileDetailComponent; let fixture: ComponentFixture; @@ -77,18 +63,9 @@ describe('ExternalParamProfilDetailComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - schemas: [NO_ERRORS_SCHEMA], - imports: [ - MatMenuModule, - MatTabsModule, - NoopAnimationsModule, - LoggerModule.forRoot(), - TestHostComponent, - ExternalParamProfileDetailComponent, - InformationTabStubComponent, - ], + imports: [LoggerModule.forRoot(), ExternalParamProfileDetailComponent], providers: [ - { provide: ExternalParamProfileService, useValue: { updated: new Subject() } }, + { provide: ExternalParamProfileService, useValue: { updated: new Subject(), getAllActiveAccessContracts: of() } }, { provide: AuthService, useValue: authServiceMock }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: BASE_URL, useValue: '/fake-api' }, @@ -96,7 +73,12 @@ describe('ExternalParamProfilDetailComponent', () => { provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideComponent(ExternalParamProfileDetailComponent, { + remove: { imports: [InformationTabComponent] }, + add: { imports: [InformationTabStubComponent] }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts index cfe14d0dc67..97ad03a2c8b 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-list/external-param-profile-list.component.spec.ts @@ -40,8 +40,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of, Subject } from 'rxjs'; +import { of, Subject } from 'rxjs'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProfileValidators } from '../../hierarchy/profile.validators'; import { ProfileService } from '../../profile/profile.service'; @@ -50,14 +49,6 @@ import { ExternalParamProfileListComponent } from './external-param-profile-list import { CollapseComponent } from 'vitamui-library'; import { CommonModule } from '@angular/common'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('ExternalParamProfileListComponent', () => { let component: ExternalParamProfileListComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts index 9357e11e7cb..0648cdf7c7a 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -57,7 +56,6 @@ describe('ExternalParamProfileComponent', () => { RouterTestingModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, MatSidenavModule, MatDialogModule, MatMenuModule, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts index 7f012794de9..642a3a10e44 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts @@ -79,7 +79,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { GroupService } from '../group.service'; import { GroupValidators } from '../group.validators'; @@ -172,7 +171,6 @@ describe('GroupCreateComponent', () => { imports: [ MatProgressBarModule, ReactiveFormsModule, - NoopAnimationsModule, VitamUICommonTestModule, CommonModule, FormsModule, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts index f329d8b2e33..5d58014df8a 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { By } from '@angular/platform-browser'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of, Subject } from 'rxjs'; @@ -154,7 +153,7 @@ describe('GroupListComponent', () => { matDialogSpy.open.mockReturnValue({ afterClosed: () => of(true) }); await TestBed.configureTestingModule({ - imports: [MatProgressSpinnerModule, NoopAnimationsModule, VitamUICommonTestModule, OrderByButtonComponent, GroupListComponent], + imports: [MatProgressSpinnerModule, VitamUICommonTestModule, OrderByButtonComponent, GroupListComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ { provide: GroupService, useValue: groupListServiceSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts index aec849f1f42..02b8f352fac 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts @@ -40,7 +40,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { BASE_URL, ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -58,7 +57,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' multi: true, }, ], - imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [MatProgressBarModule, ReactiveFormsModule, VitamUICommonTestModule], }) class UnitsFormStubComponent { writeValue() {} @@ -79,14 +78,7 @@ describe('UnitsEditComponent', () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - MatProgressBarModule, - ReactiveFormsModule, - NoopAnimationsModule, - VitamUICommonTestModule, - UnitsEditComponent, - UnitsFormStubComponent, - ], + imports: [MatProgressBarModule, ReactiveFormsModule, VitamUICommonTestModule, UnitsEditComponent, UnitsFormStubComponent], providers: [ { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', units: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts index eb19ab2e2f5..170b413e78d 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts @@ -42,7 +42,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Component, forwardRef, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -60,7 +59,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' multi: true, }, ], - imports: [MatProgressBarModule, ReactiveFormsModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [MatProgressBarModule, ReactiveFormsModule, VitamUICommonTestModule], }) class ProfilesFormStubComponent { @Input() @@ -84,14 +83,7 @@ describe('ProfilesEditComponent', () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - MatProgressBarModule, - ReactiveFormsModule, - NoopAnimationsModule, - VitamUICommonTestModule, - ProfilesEditComponent, - ProfilesFormStubComponent, - ], + imports: [MatProgressBarModule, ReactiveFormsModule, VitamUICommonTestModule, ProfilesEditComponent, ProfilesFormStubComponent], providers: [ { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', profileIds: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts index 6260a0cf77e..8bf4b62fc21 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts @@ -44,7 +44,6 @@ import { environment } from './../../environments/environment'; import { MatDialog } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { GroupCreateComponent } from './group-create/group-create.component'; import { GroupComponent } from './group.component'; @@ -68,7 +67,7 @@ let page: Page; @Component({ selector: 'app-group-list', template: '', - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], }) class GroupListStubComponent { // eslint-disable-next-line @angular-eslint/no-input-rename @@ -81,7 +80,7 @@ class GroupListStubComponent { @Component({ selector: 'app-group-preview', template: '', - imports: [MatMenuModule, MatSidenavModule, NoopAnimationsModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], }) class GroupPreviewStubComponent { @Input() @@ -104,7 +103,6 @@ describe('GroupComponent', () => { imports: [ MatMenuModule, MatSidenavModule, - NoopAnimationsModule, VitamUICommonTestModule, InjectorModule, SearchBarComponent, diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts index 0f57d03738c..ca56e26bde6 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { AuthService, ConfirmDialogService, LevelInputComponent } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -86,7 +85,6 @@ describe('HierarchyCreateComponent', () => { imports: [ MatProgressBarModule, ReactiveFormsModule, - NoopAnimationsModule, VitamUICommonTestModule, CommonModule, FormsModule, diff --git a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts index 9179779d857..0f4b8d2f84c 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts @@ -46,7 +46,6 @@ import { DomainsInputComponent } from './domains-input.component'; @Component({ template: '', - standalone: true, imports: [DomainsInputComponent], schemas: [NO_ERRORS_SCHEMA], }) diff --git a/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts index c799da36acf..5dd3e795427 100644 --- a/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/app.component.spec.ts @@ -39,7 +39,6 @@ import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of } from 'rxjs'; @@ -49,14 +48,14 @@ import { AppComponent } from './app.component'; @Component({ selector: 'router-outlet', template: '', - imports: [MatSidenavModule, NoopAnimationsModule], + imports: [MatSidenavModule], }) class RouterOutletStubComponent {} @Component({ selector: 'vitamui-common-subrogation-banner', template: '', - imports: [MatSidenavModule, NoopAnimationsModule], + imports: [MatSidenavModule], }) class SubrogationBannerStubComponent {} @@ -64,7 +63,7 @@ describe('AppComponent', () => { beforeEach(async () => { const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {}, getPlatformName: () => '' }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], + imports: [MatSidenavModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts index 1d2fa784e07..7db5dd3c0a8 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts @@ -38,7 +38,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDatepickerModule } from '@angular/material/datepicker'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { Component } from '@angular/core'; @@ -66,7 +66,6 @@ import { HoldingFillingSchemeComponent } from './holding-filling-scheme.componen VitamUICommonTestModule, BrowserAnimationsModule, RouterTestingModule, - NoopAnimationsModule, MatDialogModule, ], }) @@ -97,7 +96,6 @@ describe('HoldingFilingSchemeComponent', () => { BrowserAnimationsModule, LoggerModule.forRoot(), RouterTestingModule, - NoopAnimationsModule, SearchBarComponent, MatDialogModule, HoldingFillingSchemeComponent, diff --git a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts index 6a8ed43e68b..932efb3c705 100644 --- a/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/shared/upload-tracking/upload-tracking.component.spec.ts @@ -38,7 +38,6 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatProgressBarModule } from '@angular/material/progress-bar'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; import { LoggerModule } from 'vitamui-library'; import { IngestList } from '../../core/common/ingest-list'; @@ -55,7 +54,7 @@ describe('UploadTrackingComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatProgressBarModule, NoopAnimationsModule, LoggerModule.forRoot(), UploadTrackingComponent], + imports: [MatProgressBarModule, LoggerModule.forRoot(), UploadTrackingComponent], providers: [FormBuilder, { provide: UploadService, useValue: UploadServiceSpy }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts index d6457404bc6..c8a4c4d487a 100644 --- a/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/app.component.spec.ts @@ -37,7 +37,6 @@ import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Router } from '@angular/router'; import { of } from 'rxjs'; import { AuthService, StartupService } from 'vitamui-library'; @@ -61,7 +60,7 @@ describe('AppComponent', () => { beforeEach(async () => { const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {} }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, NoopAnimationsModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], + imports: [MatSidenavModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.spec.ts index 1c223563cfc..1b972f272ce 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/create-profil-notice/create-profil-notice.component.spec.ts @@ -44,7 +44,6 @@ import { BehaviorSubject, of } from 'rxjs'; import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms'; import { ProfileType } from '../../models/profile-type.enum'; import { MatRadioModule } from '@angular/material/radio'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('CreateProfilNoticeComponent', () => { let component: CreateProfilNoticeComponent; @@ -77,15 +76,7 @@ describe('CreateProfilNoticeComponent', () => { mockAppService.isApplicationExternalIdentifierEnabled.mockReturnValue(externalIdSubject.asObservable()); TestBed.configureTestingModule({ - imports: [ - ReactiveFormsModule, - MatRadioModule, - InputComponent, - SelectComponent, - SlideToggleComponent, - NoopAnimationsModule, - CreateProfilNoticeComponent, - ], + imports: [ReactiveFormsModule, MatRadioModule, InputComponent, SelectComponent, SlideToggleComponent, CreateProfilNoticeComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: mockDialogRef }, diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.spec.ts index ea8b9534f10..ae02e295a57 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile-popup/save-profile-popup.component.spec.ts @@ -43,7 +43,6 @@ import { MatRadioModule } from '@angular/material/radio'; import { ApplicationService, InputComponent, SelectComponent, SlideToggleComponent } from 'vitamui-library'; import { ProfileService } from '../../core/services/profile.service'; import { ProfileType } from '../../models/profile-type.enum'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { IdentifierExistsValidator } from '../../validators/IdentifierExistsValidator'; import { BehaviorSubject, of } from 'rxjs'; @@ -90,15 +89,7 @@ describe('SaveProfilePopupComponent', () => { mockAppService.isApplicationExternalIdentifierEnabled.mockReturnValue(externalIdSubject.asObservable()); TestBed.configureTestingModule({ - imports: [ - ReactiveFormsModule, - MatRadioModule, - InputComponent, - SelectComponent, - SlideToggleComponent, - NoopAnimationsModule, - SaveProfilePopupComponent, - ], + imports: [ReactiveFormsModule, MatRadioModule, InputComponent, SelectComponent, SlideToggleComponent, SaveProfilePopupComponent], providers: [ FormBuilder, IdentifierExistsValidator, diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index 3046a9fd168..a0ddcdb8cf3 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -39,24 +39,15 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { ActivatedRoute, Router } from '@angular/router'; -import { EMPTY, Observable, of } from 'rxjs'; +import { EMPTY, of } from 'rxjs'; import { AuthService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../environments/environment.prod'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { TranslateLoader } from '@ngx-translate/core'; import { AppComponent } from './app.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -const translations: any = { TEST: 'This is a test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - @Component({ selector: 'router-outlet', template: '', diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts index 0e8f4e88680..77cc5c2f3f4 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts @@ -44,7 +44,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { AccessContractService, @@ -131,7 +130,6 @@ describe('AccessContractCreateComponent', () => { MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, LoggerModule.forRoot(), diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index d89532ce37e..23c6f59f7ba 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -42,7 +42,6 @@ import { RouterTestingModule } from '@angular/router/testing'; import { AccessContractService, ApplicationService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { AccessContractComponent } from './access-contract.component'; import { of } from 'rxjs'; @@ -50,7 +49,7 @@ import { of } from 'rxjs'; @Component({ selector: 'app-access-contract-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AccessContractPreviewStub { @Input() @@ -60,7 +59,7 @@ class AccessContractPreviewStub { @Component({ selector: 'app-access-contract-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AccessContractListStub {} @@ -83,7 +82,6 @@ describe('AccessContractComponent', () => { RouterTestingModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, MatSidenavModule, MatDialogModule, AccessContractComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts index 45013d20227..14077da8006 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts @@ -38,7 +38,6 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; import { AccessContractService, DslQueryType, InjectorModule, LoggerModule, SnackBarService, VitamUILibraryModule } from 'vitamui-library'; @@ -82,7 +81,6 @@ describe('AdminDslComponent', () => { InjectorModule, LoggerModule.forRoot(), MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, VitamUILibraryModule, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts index bc00fbef5f3..bc535b6c324 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-create/agency-create.component.spec.ts @@ -44,7 +44,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { AgencyService, ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -67,7 +66,6 @@ import { AgencyCreateValidators } from './agency-create.validators'; MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, ], @@ -139,7 +137,6 @@ describe('AgencyCreateComponent', () => { MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, AgencyCreateComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index a72af86d863..0cceb984356 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -50,12 +50,6 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' const authServiceMock = { user: { proofTenantIdentifier: '1' } }; const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), paramMap: EMPTY }; -class FakeLoader implements TranslateLoader { - getTranslation() { - return of({}); - } -} - describe('AgencyListComponent', () => { let component: AgencyListComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index 156230db653..1b1abf66109 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -43,7 +43,6 @@ import { RouterTestingModule } from '@angular/router/testing'; import { AgencyService, BASE_URL, InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; import { AgencyComponent } from './agency.component'; @@ -80,7 +79,6 @@ describe('AgencyComponent', () => { RouterTestingModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, MatSidenavModule, MatDialogModule, MatMenuModule, diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts index efbce578661..81aae1e81f9 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts @@ -43,7 +43,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; import { BASE_URL, DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; @@ -78,7 +77,6 @@ describe('AuditComponent', () => { MatSelectModule, MatSidenavModule, DatepickerComponent, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, AuditComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts index 353dfa20749..ed5896ba156 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-create/context-create.component.spec.ts @@ -44,7 +44,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { ConfirmDialogService, OtpState } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -68,7 +67,6 @@ import { ContextCreateValidators } from './context-create.validators'; MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, ], @@ -161,7 +159,6 @@ describe.skip('ContextCreateComponent', () => { MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, ContextCreateComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts index 3e0a84985d4..407c57b5b93 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts @@ -38,7 +38,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { ApplicationService, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -52,7 +51,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' @Component({ selector: 'app-agency-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class ContextPreviewStub { @Input() @@ -62,7 +61,7 @@ class ContextPreviewStub { @Component({ selector: 'app-agency-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class ContextListStub {} @@ -83,7 +82,6 @@ describe('ContextComponent', () => { RouterTestingModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, MatSidenavModule, MatDialogModule, ContextComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts index 08318b6b617..f02568e08e0 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-create/file-format-create.component.spec.ts @@ -44,7 +44,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -107,7 +106,6 @@ describe.skip(' FileFormatCreateComponent', () => { MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, FileFormatCreateComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts index 39cbd4ec666..cfa6675eebc 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts @@ -42,14 +42,13 @@ import { RouterTestingModule } from '@angular/router/testing'; import { InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { FileFormatComponent } from './file-format.component'; import { of } from 'rxjs'; @Component({ selector: 'app-file-format-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AgencyPreviewStub { @Input() @@ -59,7 +58,7 @@ class AgencyPreviewStub { @Component({ selector: 'app-file-format-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AgencyListStub {} @@ -74,7 +73,6 @@ describe('FileFormatComponent', () => { RouterTestingModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, MatSidenavModule, MatDialogModule, FileFormatComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts index b2b704f06b8..3e5aab1057e 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts @@ -58,7 +58,6 @@ import { IngestContractService } from '../ingest-contract.service'; import { IngestContractCreateComponent } from './ingest-contract-create.component'; import { IngestContractCreateValidators } from './ingest-contract-create.validators'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; describe('IngestContractCreateComponent', () => { let component: IngestContractCreateComponent; @@ -100,13 +99,7 @@ describe('IngestContractCreateComponent', () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - IngestContractCreateComponent, - NoopAnimationsModule, - VitamUICommonTestModule, - LoggerModule.forRoot(), - MatButtonToggleModule, - ], + imports: [IngestContractCreateComponent, VitamUICommonTestModule, LoggerModule.forRoot(), MatButtonToggleModule], providers: [ FormBuilder, { provide: BASE_URL, useValue: '/fake-api' }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts index 22ee5f057c5..66bc04de89a 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-object-tab/ingest-contract-object-tab.component.spec.ts @@ -39,7 +39,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { IngestContract } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { IngestContractService } from '../../ingest-contract.service'; @@ -80,14 +79,7 @@ describe('IngestContractObjectTabComponent', () => { TestBed.overrideComponent(IngestContractObjectTabComponent, { set: { template: '' } }); await TestBed.configureTestingModule({ - imports: [ - ReactiveFormsModule, - FormsModule, - VitamUICommonTestModule, - MatSelectModule, - NoopAnimationsModule, - IngestContractObjectTabComponent, - ], + imports: [ReactiveFormsModule, FormsModule, VitamUICommonTestModule, MatSelectModule, IngestContractObjectTabComponent], providers: [FormBuilder, { provide: IngestContractService, useValue: {} }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index e0ef8cd15f6..bb91fd3f5a3 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -37,7 +37,7 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; @@ -72,7 +72,6 @@ describe('LogbookOperationDetailComponent', () => { EventTypeBadgeColorPipe, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, RouterTestingModule, VitamUICommonTestModule, LogbookOperationDetailComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts index c9546d69737..3151e84a677 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts @@ -41,7 +41,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; import { delay } from 'rxjs/operators'; @@ -100,7 +100,6 @@ describe('ManagementContractCreateComponent', () => { LoggerModule.forRoot(), MatSelectModule, MatSidenavModule, - NoopAnimationsModule, ReactiveFormsModule, RouterTestingModule, VitamUICommonTestModule, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index e3973bde2a6..09e9da58308 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -40,7 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { of, Subject } from 'rxjs'; import { BASE_URL, InjectorModule, LoggerModule, ManagementContract, SearchService, WINDOW_LOCATION } from 'vitamui-library'; @@ -86,7 +86,6 @@ describe('ManagementContractListComponent', () => { RouterTestingModule, LoggerModule.forRoot(), BrowserAnimationsModule, - NoopAnimationsModule, ManagementContractListComponent, ], providers: [ diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts index 5bae990dbc8..012da61e6b8 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts @@ -40,7 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { BrowserAnimationsModule, NoopAnimationsModule } from '@angular/platform-browser/animations'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; @@ -75,7 +75,6 @@ describe('ManagementContractComponent', () => { RouterTestingModule, LoggerModule.forRoot(), BrowserAnimationsModule, - NoopAnimationsModule, ManagementContractComponent, ], providers: [ diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts index 6a3105025cd..824f4f45e91 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-create/ontology-create.component.spec.ts @@ -43,7 +43,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { ConfirmDialogService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -105,7 +104,6 @@ describe('OntologyCreateComponent', () => { MatProgressBarModule, MatProgressSpinnerModule, MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, VitamUILibraryModule, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts index 505a8ed3b7f..4e0860d0eb1 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts @@ -38,20 +38,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { TranslateLoader } from '@ngx-translate/core'; -import { EMPTY, Observable, of } from 'rxjs'; +import { EMPTY, of } from 'rxjs'; import { AuthService, BASE_URL, Ontology, TenantSelectionService } from 'vitamui-library'; import { OntologyListComponent } from './ontology-list.component'; import { OntologyService } from '../../ontology.service'; -const translations: any = { TEST: 'Mock translate test' }; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('OntologyListComponent', () => { let component: OntologyListComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts index cd14856b323..b41fa5b4baf 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/ontology-information-tab/ontology-information-tab.component.spec.ts @@ -40,7 +40,6 @@ import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; import { Ontology, SecurityService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -75,15 +74,7 @@ describe('OntologyInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - MatFormFieldModule, - MatInputModule, - MatSelectModule, - NoopAnimationsModule, - ReactiveFormsModule, - VitamUICommonTestModule, - VitamUILibraryModule, - ], + imports: [MatFormFieldModule, MatInputModule, MatSelectModule, ReactiveFormsModule, VitamUICommonTestModule, VitamUILibraryModule], providers: [ FormBuilder, { provide: OntologyService, useValue: ontologyServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts index 5a2736abc49..860e2b02085 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-preview/schema-information-tab/schema-information-tab.component.spec.ts @@ -43,7 +43,6 @@ import { of } from 'rxjs'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { NO_ERRORS_SCHEMA } from '@angular/core'; @@ -80,15 +79,7 @@ describe('SchemaInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - MatFormFieldModule, - MatInputModule, - MatSelectModule, - NoopAnimationsModule, - ReactiveFormsModule, - VitamUICommonTestModule, - VitamUILibraryModule, - ], + imports: [MatFormFieldModule, MatInputModule, MatSelectModule, ReactiveFormsModule, VitamUICommonTestModule, VitamUILibraryModule], providers: [FormBuilder, { provide: SchemaService, useValue: schemaServiceMock }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts index dc4daa5ba41..a44a0eee1e1 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts @@ -38,7 +38,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { InjectorModule, LoggerModule, SchemaService, SecurityService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -49,7 +48,7 @@ import { OntologyService } from './ontology.service'; @Component({ selector: 'app-ontology-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class OntologyPreviewStub { @Input() @@ -59,7 +58,7 @@ class OntologyPreviewStub { @Component({ selector: 'app-ontology-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class OntologyListStub {} @@ -74,7 +73,6 @@ describe('OntologyComponent', () => { RouterTestingModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, MatSidenavModule, MatDialogModule, OntologyComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts index 26f4fa5d5f1..92f2a014911 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-create/probative-value-create.component.spec.ts @@ -40,7 +40,6 @@ import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { ConfirmDialogService, @@ -74,7 +73,6 @@ describe('ProbativeValueCreateComponent', () => { ReactiveFormsModule, MatSelectModule, MatButtonToggleModule, - NoopAnimationsModule, MatProgressBarModule, VitamUICommonTestModule, VitamUILibraryModule, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts index a35b9318ef8..765b40cabf3 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts @@ -41,7 +41,6 @@ import { MatDialog } from '@angular/material/dialog'; import { MatInputModule } from '@angular/material/input'; import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; import { BASE_URL, DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; @@ -68,7 +67,6 @@ describe('ProbativeValueComponent', () => { MatSelectModule, MatSidenavModule, DatepickerComponent, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, ProbativeValueComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts index ac849beb858..ba6bbc5defd 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-create/rule-create.component.spec.ts @@ -44,7 +44,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { ConfirmDialogService, ManagementRuleValidators, RuleService, VitamUILibraryModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -110,7 +109,6 @@ describe('RuleCreateComponent', () => { MatProgressBarModule, MatProgressSpinnerModule, MatSelectModule, - NoopAnimationsModule, ReactiveFormsModule, VitamUICommonTestModule, VitamUILibraryModule, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index dedd2669f67..30c6d222af7 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -45,7 +45,6 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; @@ -69,7 +68,6 @@ import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' selector: 'app-rule-preview', template: '', imports: [ - NoopAnimationsModule, RouterTestingModule, VitamUICommonTestModule, ReactiveFormsModule, @@ -91,7 +89,6 @@ class RulePreviewStubComponent { selector: 'app-rule-list', template: '', imports: [ - NoopAnimationsModule, RouterTestingModule, VitamUICommonTestModule, ReactiveFormsModule, @@ -145,7 +142,6 @@ describe('RuleComponent', () => { await TestBed.configureTestingModule({ imports: [ - NoopAnimationsModule, RouterTestingModule, VitamUICommonTestModule, ReactiveFormsModule, diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts index 04194507fe0..415599b4acb 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts @@ -41,7 +41,6 @@ import { FormBuilder } from '@angular/forms'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { MatDialog } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; import { DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; @@ -70,7 +69,6 @@ describe('SecurisationComponent', () => { MatDatepickerModule, MatSidenavModule, DatepickerComponent, - NoopAnimationsModule, VitamUICommonTestModule, SecurisationComponent, ], diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts index 89fec19648a..2b3623db9bb 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-create/security-profile-create.component.spec.ts @@ -43,7 +43,6 @@ import { MatFormFieldModule } from '@angular/material/form-field'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EMPTY, of } from 'rxjs'; import { ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -67,7 +66,6 @@ import { SecurityProfileCreateValidators } from './security-profile-create.valid MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, ], @@ -104,7 +102,6 @@ class DomainInputStubComponent implements ControlValueAccessor { MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, ], @@ -166,7 +163,6 @@ describe('SecurityProfileCreateComponent', () => { MatSelectModule, MatButtonToggleModule, MatProgressBarModule, - NoopAnimationsModule, MatProgressSpinnerModule, VitamUICommonTestModule, SecurityProfileEditPermissionStubComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts index af09dd39f54..578ff2df528 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts @@ -39,7 +39,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { ApplicationService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -50,7 +49,7 @@ import { SecurityProfileComponent } from './security-profile.component'; @Component({ selector: 'app-SecurityProfile-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class SecurityProfilePreviewStub { @Input() @@ -60,7 +59,7 @@ class SecurityProfilePreviewStub { @Component({ selector: 'app-SecurityProfile-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, NoopAnimationsModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class SecurityProfileListStub {} @@ -80,7 +79,6 @@ describe('SecurityProfileComponent', () => { RouterTestingModule, InjectorModule, LoggerModule.forRoot(), - NoopAnimationsModule, MatSidenavModule, MatDialogModule, SecurityProfileComponent, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts index 49c5298f502..37e1467b2d9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts @@ -36,7 +36,6 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { of } from 'rxjs'; import { VitamUIFieldErrorStubComponent } from '../../../../../testing/src/public_api'; @@ -55,7 +54,7 @@ describe('AccountInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, SlideToggleComponent, NoopAnimationsModule, AccountInformationTabComponent], + imports: [ReactiveFormsModule, SlideToggleComponent, AccountInformationTabComponent], declarations: [VitamUIFieldErrorStubComponent], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts index 9f77727c5f3..51b68bf03e7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts @@ -37,7 +37,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatTabsModule } from '@angular/material/tabs'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { EMPTY, of } from 'rxjs'; @@ -54,7 +53,7 @@ import { AccountService } from './account.service'; @Component({ selector: 'vitamui-common-account-information-tab', template: '', - imports: [InjectorModule, MatTabsModule, NoopAnimationsModule, VitamUICommonTestModule], + imports: [InjectorModule, MatTabsModule, VitamUICommonTestModule], }) class InformationTabStubComponent { @Input() account: Account; @@ -77,7 +76,6 @@ describe('AccountComponent', () => { imports: [ InjectorModule, MatTabsModule, - NoopAnimationsModule, LoggerModule.forRoot(), VitamUICommonTestModule, AccountComponent, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/chip/chip.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/chip/chip.component.ts index c42c8ac4f80..2257533b1ac 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/chip/chip.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/chip/chip.component.ts @@ -40,7 +40,6 @@ import { Component, Input } from '@angular/core'; selector: 'vitamui-chip', template: ` {{ text }} `, styleUrls: ['chip.component.scss'], - standalone: true, }) export class ChipComponent { @Input() text = ''; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts index d31788f48d3..bb3fcfb2f58 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/common-tooltip/tooltip.directive.ts @@ -81,7 +81,7 @@ const VITAMUI_TOOL_TIP_POSITIONS: { [key: string]: ConnectedPosition } = { const TOOLTIP_TRIGGER_CLASS = 'tooltip-trigger'; -@Directive({ selector: '[vitamuiTooltip]', standalone: true }) +@Directive({ selector: '[vitamuiTooltip]' }) export class TooltipDirective implements OnInit, OnDestroy, OnChanges { private overlay = inject(Overlay); private overlayPositionBuilder = inject(OverlayPositionBuilder); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts index 243a3594999..3546359a10b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/download-snack-bar/download-snack-bar.component.spec.ts @@ -69,38 +69,3 @@ describe('DownloadSnackBarComponent', () => { expect(component).toBeTruthy(); }); }); - -// import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -// import {MatDialog} from '@angular/material/dialog'; -// import {MatProgressBarModule} from '@angular/material/progress-bar'; -// import {empty} from 'rxjs'; - -// import {DownloadService} from '../download.service'; -// import {DownloadSnackBarComponent} from './download-snack-bar.component'; - -// describe('DownloadSnackBarComponent', () => { -// let component: DownloadSnackBarComponent; -// let fixture: ComponentFixture; - -// beforeEach(async(() => { -// await TestBed.configureTestingModule({ -// imports: [MatProgressBarModule], -// declarations: [ DownloadSnackBarComponent ], -// providers: [ -// { provide: MatDialog, useValue: {} }, -// { provide: DownloadService, useValue: { downloadReady: empty(), startRefreshLoop: () => {}, stopRefreshLoop: () => {} } }, -// ] -// }) -// .compileComponents(); -// })); - -// beforeEach(() => { -// fixture = TestBed.createComponent(DownloadSnackBarComponent); -// component = fixture.componentInstance; -// fixture.detectChanges(); -// }); - -// it('should create', () => { -// expect(component).toBeTruthy(); -// }); -// }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts index 54c6929865b..b5f4612e75a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-email-input/editable-email-input.component.spec.ts @@ -65,7 +65,6 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { EditableEmailInputComponent } from './editable-email-input.component'; @@ -75,7 +74,7 @@ describe('EditableEmailInputComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [OverlayModule, ReactiveFormsModule, MatSelectModule, NoopAnimationsModule, EditableEmailInputComponent], + imports: [OverlayModule, ReactiveFormsModule, MatSelectModule, EditableEmailInputComponent], providers: [{ provide: DOCUMENT, useValue: document }], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts index 9cccc82fc6d..43e47d28ef1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/elements/elements.component.ts @@ -44,7 +44,6 @@ import { TooltipDirective } from '../common-tooltip/tooltip.directive'; selector: 'vitamui-elements', templateUrl: './elements.component.html', styleUrls: ['elements.component.scss'], - standalone: true, imports: [TooltipDirective, MatMenuModule, PipesModule], }) export class ElementsComponent { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts index fe6be75a71d..fcea4a7ac43 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-tree-node/vitamui-tree-node.component.ts @@ -50,7 +50,6 @@ import { TooltipDirective } from '../common-tooltip/tooltip.directive'; templateUrl: './vitamui-tree-node.component.html', styleUrls: ['./vitamui-tree-node.component.scss'], imports: [CommonModule, FormsModule, MatButtonModule, MatCheckboxModule, TooltipDirective], - standalone: true, }) export class VitamuiTreeNodeComponent implements AfterContentChecked { private cdr = inject(ChangeDetectorRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/click-outside/click-outside.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/click-outside/click-outside.directive.ts index c495223685d..f386806f6e2 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/click-outside/click-outside.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/click-outside/click-outside.directive.ts @@ -38,7 +38,6 @@ import { Directive, ElementRef, EventEmitter, HostListener, Output, inject } fro @Directive({ selector: '[vitamuiClickOutside]', - standalone: true, }) export class ClickOutsideDirective { private elementRef = inject(ElementRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/drag-and-drop/drag-and-drop.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/drag-and-drop/drag-and-drop.directive.ts index 453c04a557f..7ea377132bc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/drag-and-drop/drag-and-drop.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/drag-and-drop/drag-and-drop.directive.ts @@ -39,7 +39,6 @@ import { Logger } from '../../logger/logger'; import { CustomFile } from '../../../../lib/models/custom-file'; @Directive({ - standalone: true, selector: '[vitamuiCommonDragAndDrop]', }) export class DragAndDropDirective { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts index 4ec7c9934da..0c940052258 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.spec.ts @@ -55,7 +55,6 @@ import { ResizeSidebarDirective } from './resize-sidebar.directive'; } `, ], - standalone: true, imports: [ResizeSidebarDirective], }) class ResizeSidebarTestComponent {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts index 5f8ba226f02..b12f5b1f626 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-sidebar.directive.ts @@ -38,7 +38,7 @@ import { Directive, ElementRef, HostListener, inject, Input, OnInit, Renderer2 } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -@Directive({ selector: '[vitamuiCommonResizeSidebar]', standalone: true }) +@Directive({ selector: '[vitamuiCommonResizeSidebar]' }) export class ResizeSidebarDirective implements OnInit { private elementRef = inject(ElementRef); private renderer = inject(Renderer2); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts index 444836759de..a37b3da5e3f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.spec.ts @@ -59,7 +59,6 @@ import { ResizeVerticalDirective } from './resize-vertical.directive'; } `, ], - standalone: true, imports: [ResizeVerticalDirective], }) class ResizeVerticalBarTestComponent {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts index 7feade7434f..4df5da010df 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/directives/resize-sidebar/resize-vertical.directive.ts @@ -38,7 +38,7 @@ import { Directive, ElementRef, HostListener, inject, Input, OnInit } from '@angular/core'; import { DOCUMENT } from '@angular/common'; -@Directive({ selector: '[vitamuiVerticalResizeSidebar]', standalone: true }) +@Directive({ selector: '[vitamuiVerticalResizeSidebar]' }) export class ResizeVerticalDirective implements OnInit { private elementRef = inject(ElementRef); private document = inject(DOCUMENT); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/required.pipe.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/required.pipe.ts index e3fd914753a..a8ffa63689e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/required.pipe.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-editor/required.pipe.ts @@ -36,7 +36,7 @@ */ import { Pipe, PipeTransform } from '@angular/core'; -@Pipe({ name: 'appendStar', standalone: true }) +@Pipe({ name: 'appendStar' }) export class AppendStarPipe implements PipeTransform { transform(value: string, shouldAppend: boolean = true) { return `${value}${shouldAppend ? ' *' : ''}`; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts index 70eb232fe2f..a8c22fd40d8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.spec.ts @@ -46,7 +46,6 @@ const TEST_ELEMENT_ID = 'test'; @Component({ template: ` Lorem ipsum `, - standalone: true, imports: [HasAnyRoleDirective], }) class TestHostComponent { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts index c1dbdab5131..fd2df07f364 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-any-role.directive.ts @@ -40,7 +40,7 @@ import { Subscription } from 'rxjs'; import { ApplicationId } from '../application-id.enum'; import { SecurityService } from './security.service'; -@Directive({ selector: '[vitamuiCommonHasAnyRole]', standalone: true }) +@Directive({ selector: '[vitamuiCommonHasAnyRole]' }) export class HasAnyRoleDirective implements OnDestroy { private templateRef = inject>(TemplateRef); private viewContainer = inject(ViewContainerRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts index 60a525b7929..835eded7bb6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.spec.ts @@ -48,7 +48,6 @@ const TEST_ELEMENT_ID = 'test'; template: ` Lorem ipsum `, - standalone: true, imports: [HasRoleDirective], }) class TestHostComponent {} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts index 72e3220c576..2c0ea697857 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/security/has-role.directive.ts @@ -38,7 +38,7 @@ import { Directive, inject, Input, OnDestroy, TemplateRef, ViewContainerRef } fr import { Subscription } from 'rxjs'; import { SecurityService } from './security.service'; -@Directive({ selector: '[vitamuiCommonHasRole]', standalone: true }) +@Directive({ selector: '[vitamuiCommonHasRole]' }) export class HasRoleDirective implements OnDestroy { private templateRef = inject>(TemplateRef); private viewContainer = inject(ViewContainerRef); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.spec.ts index 8d0e0ddee5e..5556410491f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/confirm-action/confirm-action.component.spec.ts @@ -36,18 +36,8 @@ */ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { TranslateLoader } from '@ngx-translate/core'; -import { Observable, of } from 'rxjs'; import { ConfirmActionComponent } from './confirm-action.component'; -const translations: { [key: string]: string } = {}; - -class FakeLoader implements TranslateLoader { - getTranslation(): Observable { - return of(translations); - } -} - describe('ConfirmActionComponent', () => { let component: ConfirmActionComponent; let fixture: ComponentFixture; diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/form-field-value-wrapper/form-field-value-wrapper.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/form-field-value-wrapper/form-field-value-wrapper.component.spec.ts index 0816fcbd924..e6c78583e26 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/form-field-value-wrapper/form-field-value-wrapper.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/form-field-value-wrapper/form-field-value-wrapper.component.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Component, ViewChild } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { FormFieldValueWrapperComponent } from './form-field-value-wrapper.component'; @@ -72,7 +71,7 @@ describe('FormFieldValueWrapperComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TestHostWithSearchWithTypeSelectorComponent], + imports: [TestHostWithSearchWithTypeSelectorComponent], }).compileComponents(); hostFixture = TestBed.createComponent(TestHostWithSearchWithTypeSelectorComponent); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts index fe5bd44033e..90b3f8834fc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/input/input.component.spec.ts @@ -36,7 +36,6 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { input } from '../../../../testing/src/helpers'; import { TooltipDirective } from '../../../app/modules/components/common-tooltip/tooltip.directive'; @@ -52,7 +51,7 @@ function getInputs() { describe('VitamuiInputComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [FormsModule, NoopAnimationsModule, TooltipDirective], + imports: [FormsModule, TooltipDirective], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-checkbox.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-checkbox.component.ts index 89e18f7eb6b..c7299afa0e8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-checkbox.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-checkbox.component.ts @@ -51,7 +51,6 @@ import { TranslatePipe } from '@ngx-translate/core'; {{ label | translate }} `, - standalone: true, imports: [MatCheckboxModule, TranslatePipe], }) export class ManagementRuleCheckboxComponent { diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts index 301f25f9953..4cc27675446 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/management-rule-search/management-rule-search.component.ts @@ -87,7 +87,6 @@ type RuleForm = { selector: 'vitamui-management-rule-search', templateUrl: './management-rule-search.component.html', styleUrls: ['./management-rule-search.component.scss'], - standalone: true, imports: [ ReactiveFormsModule, SelectComponent, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts index 9e58dea63fc..703d87db4f5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts @@ -37,7 +37,7 @@ import { ReclassificationDialogComponent } from './reclassification-dialog.component'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ConfirmDialogService } from '../../../app/modules/components/common-confirm-dialog/confirm-dialog.service'; import { BASE_URL, WINDOW_LOCATION } from '../../../app/modules/injection-tokens'; @@ -47,15 +47,11 @@ import { PagedResult, SearchCriteriaDto, SearchCriteriaTypeEnum } from '../../.. import { MatSnackBarModule } from '@angular/material/snack-bar'; import { Observable, of } from 'rxjs'; import { ReclassificationService } from '../../../app/modules/services/reclassification.service'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { provideHttpClient } from '@angular/common/http'; const matDialogRefSpy = { close: vi.fn().mockName('MatDialogRef.close'), }; -const matDialogSpy = { - open: vi.fn().mockName('MatDialog.open'), -}; const confirmDialogServiceMock = { confirm: () => of(true), @@ -113,11 +109,10 @@ describe('ReclassificationDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, MatSnackBarModule, LoggerModule.forRoot()], + imports: [MatSnackBarModule, LoggerModule.forRoot()], providers: [ provideHttpClient(), provideHttpClientTesting(), - { provide: MatDialog, useValue: matDialogSpy }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/search-with-type-selector/search-with-type-selector.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/search-with-type-selector/search-with-type-selector.component.spec.ts index c44d983b108..ed016c70a83 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/search-with-type-selector/search-with-type-selector.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/search-with-type-selector/search-with-type-selector.component.spec.ts @@ -39,7 +39,6 @@ import { SearchType, SearchWithTypeSelectorComponent } from './search-with-type- import { By } from '@angular/platform-browser'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { MatMenuHarness } from '@angular/material/menu/testing'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Component, ViewChild } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { input } from '../../../../testing/src/helpers'; @@ -72,7 +71,7 @@ describe('SearchWithTypeSelectorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TestHostComponent], + imports: [TestHostComponent], }).compileComponents(); hostFixture = TestBed.createComponent(TestHostComponent); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.spec.ts index abd9181e7c7..882a8e4b654 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select-with-tree/select-with-tree.component.spec.ts @@ -37,7 +37,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SelectWithTreeComponent } from './select-with-tree.component'; import { MatSelectModule } from '@angular/material/select'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; class Item { value: string; @@ -49,7 +48,7 @@ describe('SelectWithTreeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, MatSelectModule], + imports: [MatSelectModule], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.spec.ts index 98fb399f79a..86f7c25f843 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/select/select.component.spec.ts @@ -36,7 +36,6 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { SelectComponent, VitamuiSelectOptions } from './select.component'; -import { NoopAnimationsModule } from '@angular/platform-browser/animations'; import { Component, ViewChild } from '@angular/core'; import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; @@ -92,7 +91,7 @@ describe('SelectComponent', () => { ) { return async () => { await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TestHostComponent], + imports: [TestHostComponent], }).compileComponents(); hostFixture = TestBed.createComponent(TestHostComponent); @@ -367,7 +366,7 @@ describe('SelectComponent', () => { describe('regression test for bug (Referential fields appear empty in edit mode despite a saved value)', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [NoopAnimationsModule, TestHostComponent], + imports: [TestHostComponent], }).compileComponents(); hostFixture = TestBed.createComponent(TestHostComponent); diff --git a/ui/ui-frontend/projects/vitamui-library/src/sass/_theme.scss b/ui/ui-frontend/projects/vitamui-library/src/sass/_theme.scss index 4107319e12f..c7f11f522ab 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/sass/_theme.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/sass/_theme.scss @@ -1,3 +1,4 @@ +@forward './animations'; @forward './bootstrap'; @forward './mixins'; @forward './material'; From b690ae8600971aa37015ad5dc79248a843a15066 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 26 Aug 2026 12:34:31 +0200 Subject: [PATCH 07/33] Story #16471: Clean code - manual fixes --- .../design-system/src/app/app.component.ts | 12 ++--- .../breadcrumbs/breadcrumbs.component.ts | 4 +- .../design-system/src/assets/config-dev.json | 53 +++++++++++++++++++ .../src/environments/environment.ts | 1 + .../projects/design-system/src/main.ts | 21 +++++++- 5 files changed, 80 insertions(+), 11 deletions(-) create mode 100644 ui/ui-frontend/projects/design-system/src/assets/config-dev.json diff --git a/ui/ui-frontend/projects/design-system/src/app/app.component.ts b/ui/ui-frontend/projects/design-system/src/app/app.component.ts index dcbd020db63..b67443303db 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.component.ts @@ -40,6 +40,7 @@ import { AppConfiguration, ApplicationApiService, AuthService, + ConfigService, SelectComponent, SelectLanguageComponent, ThemeService, @@ -95,22 +96,17 @@ export class AppComponent { constructor() { const authService = inject(AuthService); + const configService = inject(ConfigService); const themeService = inject(ThemeService); const applicationApiService = inject(ApplicationApiService); authService.userInfo = { id: '42', language: 'FRENCH' }; - applicationApiService.getLocalAsset('logo_USER.png').subscribe((userLogo) => { + applicationApiService.getLocalAsset(configService.config.USER_LOGO).subscribe((userLogo) => { themeService.init( { USER_LOGO: userLogo, - THEME_COLORS: { - 'vitamui-primary': '#9C31B5', - 'vitamui-secondary': '#296EBC', - 'vitamui-tertiary': '#C22A40', - 'vitamui-background': '#FCF7FD', - 'vitamui-header-footer': '#ffffff', - }, + THEME_COLORS: configService.config.THEME_COLORS, } as AppConfiguration, {}, ); diff --git a/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts index 368e05a3a17..0502e31db23 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/molecules/breadcrumbs/breadcrumbs.component.ts @@ -35,12 +35,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component } from '@angular/core'; -import { ApplicationId, VitamUICommonModule } from 'vitamui-library'; +import { ApplicationId, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; @Component({ templateUrl: './breadcrumbs.component.html', styleUrls: ['./breadcrumbs.component.scss'], - imports: [VitamUICommonModule], + imports: [VitamuiTitleBreadcrumbComponent], }) export class BreadcrumbsComponent { public breadCrumbData = [{ identifier: ApplicationId.PORTAL_APP }, { identifier: ApplicationId.CUSTOMERS_APP }, { label: 'Client n°1' }]; diff --git a/ui/ui-frontend/projects/design-system/src/assets/config-dev.json b/ui/ui-frontend/projects/design-system/src/assets/config-dev.json new file mode 100644 index 00000000000..b8d3cf49457 --- /dev/null +++ b/ui/ui-frontend/projects/design-system/src/assets/config-dev.json @@ -0,0 +1,53 @@ +{ + "GATEWAY_ENABLED": true, + "REFERENTIAL_URL": "https://dev.vitamui.com:4202", + "VERSION_RELEASE": "8.1-SNAPSHOT", + "PLATFORM_NAME": "VITAM-UI", + "INGEST_URL": "https://dev.vitamui.com:4208/ingest", + "PORTAL_TITLE": "Portail des applications de l'archivage", + "MAX_STREET_LENGTH": 250, + "THEME_COLORS": { + "vitamui-primary": "#9C31B5", + "vitamui-secondary": "#296EBC", + "vitamui-tertiary": "#C22A40", + "vitamui-header-footer": "#ffffff", + "vitamui-background": "#FCF7FD" + }, + "PORTAL_MESSAGE": "Profitez d'un portail unique pour rechercher dans les archives de vos coffres, pour déposer des éléments en toute sécurité et pour imprimer des étiquettes en quelques clics.", + "UI_URL": "https://dev.vitamui.com:4242", + "ARCHIVES_SEARCH_URL": "https://dev.vitamui.com:4209/archive-search", + "PORTAL_URL": "https://dev.vitamui.com:4200", + "USER_LOGO": "logo_USER.png", + "CATEGORY_CONFIGURATION": [ + { + "displayTitle": true, + "identifier": "ingest_and_consultation", + "title": "Versement & consultation", + "order": 1 + }, + { + "displayTitle": true, + "identifier": "referential", + "title": "Référentiels", + "order": 2 + }, + { + "displayTitle": true, + "identifier": "supervision_and_audits", + "title": "Supervision & Audits", + "order": 3 + }, + { + "displayTitle": true, + "identifier": "security_and_application_rights", + "title": "Sécurité & droits applicatifs", + "order": 4 + }, + { + "displayTitle": true, + "identifier": "organization_and_user_rights", + "title": "Organisation & droits utilisateurs", + "order": 5 + } + ] +} diff --git a/ui/ui-frontend/projects/design-system/src/environments/environment.ts b/ui/ui-frontend/projects/design-system/src/environments/environment.ts index 1bea6cc2602..a90f99a4c4e 100644 --- a/ui/ui-frontend/projects/design-system/src/environments/environment.ts +++ b/ui/ui-frontend/projects/design-system/src/environments/environment.ts @@ -41,4 +41,5 @@ export const environment = { production: false, + configUrls: ['./assets/config-dev.json'], }; diff --git a/ui/ui-frontend/projects/design-system/src/main.ts b/ui/ui-frontend/projects/design-system/src/main.ts index 64381ad7213..53a84ed672d 100644 --- a/ui/ui-frontend/projects/design-system/src/main.ts +++ b/ui/ui-frontend/projects/design-system/src/main.ts @@ -38,13 +38,23 @@ import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { BASE_URL, BaseUserInfoApiService, ENVIRONMENT, LoggerModule, provideI18n } from 'vitamui-library'; +import { + BASE_URL, + BaseUserInfoApiService, + ConfigService, + ENVIRONMENT, + loadConfigFactory, + LoggerModule, + provideI18n, + WINDOW_LOCATION, +} from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { of } from 'rxjs'; import { AppComponent } from './app/app.component'; import { ServiceWorkerModule } from '@angular/service-worker'; import { PreloadAllModules, provideRouter, withHashLocation, withPreloading } from '@angular/router'; import { routes } from './app/app.routes'; +import { inject, provideAppInitializer } from '@angular/core'; if (environment.production) { enableProdMode(); @@ -62,11 +72,20 @@ bootstrapApplication(AppComponent, { registrationStrategy: 'registerWhenStable:30000', }), ), + provideAppInitializer(async () => { + const configService = inject(ConfigService); + const environment = inject(ENVIRONMENT); + await loadConfigFactory(configService, environment)(); + }), provideI18n(), provideNativeDateAdapter(), { provide: LOCALE_ID, useValue: 'fr' }, { provide: ENVIRONMENT, useValue: environment }, { provide: BASE_URL, useValue: '/FAKE' }, + { + provide: WINDOW_LOCATION, + useValue: window.location, + }, { provide: BaseUserInfoApiService, useValue: { patchMyUserInfo: () => of(undefined) } }, // Make changing language work ], }).catch((err) => console.log(err)); From dd880de472e219a82dc29435848ec85d6b587b22 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 27 Aug 2026 10:42:21 +0200 Subject: [PATCH 08/33] Story #16471: Clean code - WIP --- .../archive-preview.component.spec.ts | 1 + ...ive-unit-information-tab.component.spec.ts | 1 + .../management-rules.component.spec.ts | 1 + .../search-criteria-list.component.spec.ts | 6 +- .../search-criteria-saver.component.spec.ts | 6 +- .../filing-holding-scheme.component.spec.ts | 6 +- .../filing-holding-scheme.component.spec.ts | 6 +- .../search-criteria-list.component.spec.ts | 6 +- .../search-criteria-saver.component.spec.ts | 6 +- .../transaction-list.component.spec.ts | 1 + .../src/app/app.component.spec.ts | 3 +- .../identity/src/app/app.component.spec.ts | 32 +++--- .../customer-list.component.spec.ts | 15 ++- .../customer-preview.component.spec.ts | 97 +++++++++++-------- .../app/customer/customer.component.spec.ts | 47 +++++++-- .../external-param-profile.component.spec.ts | 55 ++++++++++- .../group-create.component.spec.ts | 3 - .../src/app/group/group.component.spec.ts | 34 +++++-- .../hierarchy-create.component.spec.ts | 3 +- .../domains-input.component.spec.ts | 2 +- .../holding-filling-scheme.component.spec.ts | 6 +- .../src/app/ingest/ingest.component.spec.ts | 6 +- ...ct-authorizations-update.component.spec.ts | 2 + .../access-contract.component.spec.ts | 9 +- ...cession-register-preview.component.spec.ts | 1 + .../app/admin-dsl/admin-dsl.component.spec.ts | 1 + .../agency-information-tab.component.spec.ts | 6 +- .../src/app/agency/agency.component.spec.ts | 2 +- .../edit-agency/edit-agency.guard.spec.ts | 2 +- .../src/app/audit/audit.component.spec.ts | 1 + .../src/app/audit/audit.component.ts | 2 + .../context-preview.component.spec.ts | 24 ++++- .../src/app/context/context.component.spec.ts | 26 ++--- ...e-format-information-tab.component.spec.ts | 11 ++- .../file-format-preview.component.spec.ts | 28 +++++- .../ingest-contract.component.spec.ts | 53 +++++++++- .../logbook-operation.component.spec.ts | 5 +- ...management-contract-list.component.spec.ts | 6 -- ...agement-contract-preview.component.spec.ts | 33 +++++-- .../management-contract.component.spec.ts | 17 +++- .../app/ontology/ontology.component.spec.ts | 5 +- .../probative-value.component.spec.ts | 1 + .../rule-information-tab.component.spec.ts | 1 + .../src/app/rule/rule.component.spec.ts | 1 + .../securisation-preview.component.spec.ts | 5 +- .../securisation.component.spec.ts | 1 + ...security-profile-preview.component.spec.ts | 16 ++- .../account-information-tab.component.spec.ts | 3 +- .../search-bar/search-bar.component.spec.ts | 11 +-- .../table-filter-search.component.spec.ts | 15 +-- .../table-filter.component.spec.ts | 12 +-- .../table-filter.directive.spec.ts | 11 +-- .../testing/src/router-link-stub.directive.ts | 1 - .../testing/src/vitamui-common-test.module.ts | 30 +----- 54 files changed, 461 insertions(+), 224 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index 56ce6cc014d..6297690c72e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -85,6 +85,7 @@ describe('ArchivePreviewComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, }; const archiveServiceMock = { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts index aeb96b830b4..dcd7e340bdb 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts @@ -94,6 +94,7 @@ describe('ArchiveUnitInformationTabComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, }; const archiveServiceMock = { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index 8f7d2f50ff5..c9598658837 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -121,6 +121,7 @@ describe('ManagementRulesComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, }; const archiveServiceMock = { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts index 7c5787a4142..6e0cdf27593 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts @@ -92,7 +92,11 @@ describe('SearchCriteriaListComponent', () => { { provide: SearchCriteriaListService, useValue: SearchCriteriaListServiceStub }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, + }, }, { provide: environment, useValue: environment }, { provide: SnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts index 57b938d54e2..580bc03ff46 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -98,7 +98,11 @@ describe('SearchCriteriaSaverComponent', () => { { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, + }, }, { provide: environment, useValue: environment }, { provide: SnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts index 014513f8419..db7a6eb0e73 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -79,7 +79,11 @@ describe('FilingHoldingSchemeComponent', () => { { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, + }, }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts index 80e8c9541e5..3514cf547e0 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -133,7 +133,11 @@ describe('FilingHoldingSchemeComponent', () => { { provide: StartupService, useValue: StartupServiceMock }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'COLLECT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'COLLECT_APP' }), + snapshot: { data: { appId: 'COLLECT_APP' } }, + }, }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts index d186292e2e6..b03f4660d30 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts @@ -103,7 +103,11 @@ describe('SearchCriteriaListComponent', () => { { provide: SearchCriteriaSaverService, useValue: SearchCriteriaSaverServiceStub }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'COLLECT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'COLLECT_APP' }), + snapshot: { data: { appId: 'COLLECT_APP' } }, + }, }, { provide: environment, useValue: environment }, { provide: SnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts index 3d107b690aa..8528d1335e0 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -108,7 +108,11 @@ describe('SearchCriteriaSaverComponent', () => { { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'COLLECT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'COLLECT_APP' }), + snapshot: { data: { appId: 'COLLECT_APP' } }, + }, }, { provide: environment, useValue: environment }, { provide: SnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index d8fd699c368..969a86e7f8e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -133,6 +133,7 @@ describe('TransactionListComponent', () => { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'COLLECT_APP' }), snapshot: { + data: { appId: 'COLLECT_APP' }, queryParamMap: { get: () => 'project messageIdentifier', }, diff --git a/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts b/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts index 6df1deb4a73..1d40c1289a8 100644 --- a/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/design-system/src/app/app.component.spec.ts @@ -37,7 +37,7 @@ import { TestBed } from '@angular/core/testing'; import { AppComponent } from './app.component'; -import { ApplicationApiService } from 'vitamui-library'; +import { ApplicationApiService, ConfigService } from 'vitamui-library'; import { of } from 'rxjs'; describe('AppComponent', () => { @@ -47,6 +47,7 @@ describe('AppComponent', () => { providers: [{ provide: ApplicationApiService, useValue: { getLocalAsset: () => of('') } }], }) .overrideTemplate(AppComponent, '
') + .overrideProvider(ConfigService, { useValue: { config: { USER_LOGO: '', THEME_COLORS: [] } } }) .compileComponents(); }); diff --git a/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts index 283d6993375..4efe2fd0be2 100644 --- a/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/app.component.spec.ts @@ -36,38 +36,30 @@ */ import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { TestBed, waitForAsync } from '@angular/core/testing'; -import { MatSidenavModule } from '@angular/material/sidenav'; -import { Router } from '@angular/router'; import { of } from 'rxjs'; import { AuthService, StartupService } from 'vitamui-library'; import { AppComponent } from './app.component'; -@Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: 'router-outlet', - template: '', -}) -class RouterOutletStubComponent {} - -@Component({ - // eslint-disable-next-line @angular-eslint/component-selector - selector: 'vitamui-common-subrogation-banner', - template: '', -}) -class SubrogationBannerStubComponent {} - describe('AppComponent', () => { beforeEach(async () => { - const startupServiceStub = { configurationLoaded: () => true, printConfiguration: () => {}, getPlatformName: () => '' }; + const startupServiceStub = { + configurationLoaded: () => true, + printConfiguration: () => {}, + getPlatformName: () => '', + getPortalUrl: () => '', + getConfigStringValue: () => '', + getHasSiteSelection: () => false, + }; await TestBed.configureTestingModule({ - imports: [MatSidenavModule, SubrogationBannerStubComponent, RouterOutletStubComponent, AppComponent], + imports: [AppComponent], providers: [ { provide: StartupService, useValue: startupServiceStub }, { provide: AuthService, useValue: { userLoaded: of(null) } }, - { provide: Router, useValue: { navigate: () => {} } }, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents(); + }) + .overrideTemplate(AppComponent, '
') + .compileComponents(); }); it('should create the app', waitForAsync(() => { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts index c246fa6e6d5..10d3375c3ec 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.component.spec.ts @@ -48,9 +48,11 @@ import { InfiniteScrollStubDirective, VitamUICommonTestModule } from 'vitamui-li import { CustomerService } from '../../core/customer.service'; import { CustomerDataService } from '../customer.data.service'; import { OwnerCreateComponent } from '../owner-create/owner-create.component'; +import { OwnerService } from '../owner.service'; import { TenantService } from '../tenant.service'; import { CustomerListComponent } from './customer-list.component'; import { CustomerListService } from './customer-list.service'; +import { OwnerListComponent } from './owner-list/owner-list.component'; @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector @@ -267,6 +269,7 @@ describe('CustomerListComponent', () => { const tenantServiceSpy = { getTenantsByCustomerIds: () => of(tenants), + updated: new Subject(), }; const matDialogSpy = { open: vi.fn().mockName('MatDialog.open'), @@ -290,11 +293,21 @@ describe('CustomerListComponent', () => { { provide: CustomerListService, useValue: customerListServiceSpy }, { provide: CustomerService, useValue: { updated: new Subject() } }, { provide: TenantService, useValue: tenantServiceSpy }, + { provide: OwnerService, useValue: { updated: new Subject() } }, { provide: MatDialog, useValue: matDialogSpy }, { provide: Router, useValue: routerSpy }, CustomerDataService, ], - }).compileComponents(); + }) + .overrideComponent(CustomerListComponent, { + remove: { + imports: [OwnerListComponent], + }, + add: { + imports: [OwnerListStubComponent], + }, + }) + .compileComponents(); const customerListService = TestBed.inject(CustomerListService); vi.spyOn(customerListService, 'search'); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts index 518111d5acd..5c6775a43db 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts @@ -35,61 +35,72 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { Component, Input, NgModule, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; +import { Component, Input, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ReactiveFormsModule } from '@angular/forms'; -import { MatMenuModule } from '@angular/material/menu'; -import { MatTabsModule } from '@angular/material/tabs'; import { Subject } from 'rxjs'; import type { Customer } from 'vitamui-library'; -import { ENVIRONMENT, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; -import { VitamUICommonTestModule } from 'vitamui-library/testing'; +import { ENVIRONMENT, OperationHistoryTabComponent, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { CustomerService } from '../../core/customer.service'; import { environment } from './../../../environments/environment'; import { CustomerPreviewComponent } from './customer-preview.component'; +import { InformationTabComponent } from './information-tab/information-tab.component'; +import { SsoTabComponent } from './sso-tab/sso-tab.component'; +import { GraphicIdentityTabComponent } from './graphic-identity-tab/graphic-identity-tab.component'; +import { HomepageMessageTabComponent } from './homepage-message-tab/homepage-message-tab.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-information-tab', template: '', - standalone: false, }) export class InformationTabStubComponent { - @Input() - customer: Customer; - @Input() - readOnly: boolean; - @Input() - gdprReadOnlyStatus: boolean; + @Input() customer: Customer; + @Input() readOnly: boolean; + @Input() gdprReadOnlyStatus: boolean; } @Component({ selector: 'app-sso-tab', template: '', - standalone: false, }) export class SsoTabStubComponent { - @Input() - customer: Customer; - @Input() - readOnly: boolean; + @Input() customer: Customer; + @Input() readOnly: boolean; } @Component({ selector: 'app-graphic-identity-tab', template: '', - standalone: false, }) export class GraphicIdentityTabStubComponent { - @Input() - customer: Customer; - @Input() - readOnly: boolean; + @Input() customer: Customer; + @Input() readOnly: boolean; +} + +@Component({ + selector: 'app-homepage-message-tab', + template: '', +}) +export class HomepageMessageTabStubComponent { + @Input() customer: Customer; + @Input() readOnly: boolean; +} + +@Component({ + // eslint-disable-next-line @angular-eslint/component-selector + selector: 'vitamui-common-operation-history-tab', + template: '', +}) +export class OperationHistoryTabStubComponent { + @Input() id: string; + @Input() identifier: string; + @Input() collectionName: string; } @Component({ template: '', - standalone: false, + imports: [CustomerPreviewComponent], + schemas: [NO_ERRORS_SCHEMA], }) class TestHostComponent { customer: any; @@ -98,9 +109,6 @@ class TestHostComponent { component: CustomerPreviewComponent; } -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - describe('CustomerPreviewComponent', () => { let testhost: TestHostComponent; let fixture: ComponentFixture; @@ -112,18 +120,10 @@ describe('CustomerPreviewComponent', () => { const startupServiceStub = { getPortalUrl: () => 'https://dev.vitamui.com', getConfigStringValue: () => 'https://dev.vitamui.com/identity', + getConfigNumberValue: () => 0, }; await TestBed.configureTestingModule({ - declarations: [TestHostComponent, InformationTabStubComponent, SsoTabStubComponent, GraphicIdentityTabStubComponent], - schemas: [NO_ERRORS_SCHEMA], - imports: [ - MatMenuModule, - MatTabsModule, - ReactiveFormsModule, - VitamUICommonTestModule, - LoggerModule.forRoot(), - CustomerPreviewComponent, - ], + imports: [TestHostComponent], providers: [ { provide: CustomerService, useValue: customerServiceSpy }, { provide: StartupService, useValue: startupServiceStub }, @@ -132,7 +132,28 @@ describe('CustomerPreviewComponent', () => { provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideComponent(CustomerPreviewComponent, { + remove: { + imports: [ + InformationTabComponent, + SsoTabComponent, + GraphicIdentityTabComponent, + HomepageMessageTabComponent, + OperationHistoryTabComponent, + ], + }, + add: { + imports: [ + InformationTabStubComponent, + SsoTabStubComponent, + GraphicIdentityTabStubComponent, + HomepageMessageTabStubComponent, + OperationHistoryTabStubComponent, + ], + }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts index ad56561c347..c8055c4f319 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.spec.ts @@ -36,8 +36,8 @@ */ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { EMPTY, of } from 'rxjs'; -import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { EMPTY, of, Subject } from 'rxjs'; +import { ENVIRONMENT, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { MatDialog } from '@angular/material/dialog'; @@ -46,9 +46,15 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { ActivatedRoute } from '@angular/router'; import { CustomerCreateComponent } from './customer-create/customer-create.component'; import { CustomerComponent } from './customer.component'; +import { CustomerListComponent } from './customer-list/customer-list.component'; +import { CustomerPreviewComponent } from './customer-preview/customer-preview.component'; +import { OwnerPreviewComponent } from './owner-preview/owner-preview.component'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { CustomerService } from '../core/customer.service'; +import { CustomerDataService } from './customer.data.service'; +import { OwnerService } from './owner.service'; +import { TenantService } from './tenant.service'; let component: CustomerComponent; let fixture: ComponentFixture; @@ -58,7 +64,7 @@ class Page { return fixture.nativeElement.querySelector('app-customer-list'); } get createCustomer() { - return fixture.nativeElement.querySelector('.vitamui-heading button:first-child'); + return fixture.nativeElement.querySelector('.vitamui-heading vitamui-banner button.btn.primary'); } } @@ -67,7 +73,7 @@ let page: Page; @Component({ selector: 'app-customer-list', template: '', - imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule], }) class CustomerListStubComponent { search() {} @@ -76,7 +82,7 @@ class CustomerListStubComponent { @Component({ selector: 'app-customer-preview', template: '', - imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule], }) class CustomerPreviewStubComponent { @Input() @@ -90,7 +96,7 @@ class CustomerPreviewStubComponent { @Component({ selector: 'app-owner-preview', template: '', - imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule], }) class OwnerPreviewStubComponent { @Input() @@ -104,6 +110,18 @@ class OwnerPreviewStubComponent { describe('CustomerComponent', () => { const customerServiceSpy = { getGdprReadOnlySettingStatus: () => of(true), + updated: new Subject(), + }; + const tenantServiceSpy = { + updated: new Subject(), + }; + const ownerServiceSpy = { + updated: new Subject(), + }; + const startupServiceStub = { + getPortalUrl: () => 'https://dev.vitamui.com', + getConfigStringValue: () => 'https://dev.vitamui.com/identity', + getConfigNumberValue: () => 0, }; beforeEach(async () => { @@ -126,11 +144,24 @@ describe('CustomerComponent', () => { ], providers: [ { provide: CustomerService, useValue: customerServiceSpy }, + { provide: TenantService, useValue: tenantServiceSpy }, + { provide: OwnerService, useValue: ownerServiceSpy }, + { provide: CustomerDataService, useValue: {} }, + { provide: StartupService, useValue: startupServiceStub }, { provide: MatDialog, useValue: matDialogSpy }, - { provide: ActivatedRoute, useValue: { data: EMPTY } }, + { provide: ActivatedRoute, useValue: { data: EMPTY, snapshot: { data: { appId: 'CUSTOMERS_APP' } } } }, { provide: ENVIRONMENT, useValue: environment }, ], - }).compileComponents(); + }) + .overrideComponent(CustomerComponent, { + remove: { + imports: [CustomerListComponent, CustomerPreviewComponent, OwnerPreviewComponent], + }, + add: { + imports: [CustomerListStubComponent, CustomerPreviewStubComponent, OwnerPreviewStubComponent], + }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts index 0648cdf7c7a..a207eaf20b6 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.spec.ts @@ -35,15 +35,38 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; +import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; +import { ActivatedRoute } from '@angular/router'; +import { of, Subject } from 'rxjs'; import { InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ExternalParamProfileComponent } from './external-param-profile.component'; import { ExternalParamProfileService } from './external-param-profile.service'; +import { SharedService } from './shared.service'; +import { ExternalParamProfileDetailComponent } from './external-param-profile-detail/external-param-profile-detail.component'; +import { ExternalParamProfileListComponent } from './external-param-profile-list/external-param-profile-list.component'; + +@Component({ + selector: 'app-external-param-profile-detail', + template: '', +}) +class ExternalParamProfileDetailStubComponent { + @Input() externalParamProfile: any; + @Input() readOnly: boolean; + @Input() tenantIdentifier: string; +} + +@Component({ + selector: 'app-external-param-profile-list', + template: '', +}) +class ExternalParamProfileListStubComponent { + @Input() searchText: string; +} describe('ExternalParamProfileComponent', () => { let component: ExternalParamProfileComponent; @@ -53,17 +76,41 @@ describe('ExternalParamProfileComponent', () => { await TestBed.configureTestingModule({ imports: [ VitamUICommonTestModule, - RouterTestingModule, InjectorModule, LoggerModule.forRoot(), MatSidenavModule, MatDialogModule, MatMenuModule, ExternalParamProfileComponent, + ExternalParamProfileDetailStubComponent, + ExternalParamProfileListStubComponent, + ], + providers: [ + { + provide: ActivatedRoute, + useValue: { + data: of({ appId: 'EXTERNAL_PARAM_PROFILE_APP' }), + params: of({}), + snapshot: { data: { appId: 'EXTERNAL_PARAM_PROFILE_APP' } }, + }, + }, + { + provide: ExternalParamProfileService, + useValue: { updated: new Subject(), getOne: () => of(null), search: () => of([]), loadMore: () => of([]) }, + }, + { provide: SharedService, useValue: { getReadOnly: () => of(false) } }, ], - providers: [{ provide: ExternalParamProfileService, useValue: {} }], schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents(); + }) + .overrideComponent(ExternalParamProfileComponent, { + remove: { + imports: [ExternalParamProfileDetailComponent, ExternalParamProfileListComponent], + }, + add: { + imports: [ExternalParamProfileDetailStubComponent, ExternalParamProfileListStubComponent], + }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts index 642a3a10e44..2d5ba3db31c 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-create/group-create.component.spec.ts @@ -96,7 +96,6 @@ import { TranslatePipe } from '@ngx-translate/core'; multi: true, }, ], - standalone: false, }) class ProfilesFormStubComponent implements ControlValueAccessor { @Input() @@ -116,7 +115,6 @@ class ProfilesFormStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, }) class UnitsFormStubComponent implements ControlValueAccessor { writeValue() {} @@ -178,7 +176,6 @@ describe('GroupCreateComponent', () => { TranslatePipe, GroupCreateComponent, ], - declarations: [ProfilesFormStubComponent, UnitsFormStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts index 8bf4b62fc21..f558fb9f72c 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.component.spec.ts @@ -37,7 +37,7 @@ import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ActivatedRoute } from '@angular/router'; -import { EMPTY, of } from 'rxjs'; +import { EMPTY, of, Subject } from 'rxjs'; import { ENVIRONMENT, Group, InjectorModule, LoggerModule, SearchBarComponent, SnackBarService } from 'vitamui-library'; import { environment } from './../../environments/environment'; @@ -47,6 +47,8 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { GroupCreateComponent } from './group-create/group-create.component'; import { GroupComponent } from './group.component'; +import { GroupListComponent } from './group-list/group-list.component'; +import { GroupPreviewComponent } from './group-preview/group-preview.component'; import { DownloadSnackBarService } from 'projects/referential/src/app/core/service/download-snack-bar.service'; import { GroupService } from './group.service'; @@ -58,7 +60,7 @@ class Page { return fixture.nativeElement.querySelector('app-group-list'); } get createGroup() { - return fixture.nativeElement.querySelector('button'); + return fixture.nativeElement.querySelector('.vitamui-heading vitamui-banner button.btn.primary'); } } @@ -67,11 +69,10 @@ let page: Page; @Component({ selector: 'app-group-list', template: '', - imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule], }) class GroupListStubComponent { - // eslint-disable-next-line @angular-eslint/no-input-rename - @Input('search') + @Input() searchText: string; search() {} @@ -80,7 +81,7 @@ class GroupListStubComponent { @Component({ selector: 'app-group-preview', template: '', - imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule, InjectorModule], + imports: [MatMenuModule, MatSidenavModule, VitamUICommonTestModule], }) class GroupPreviewStubComponent { @Input() @@ -98,6 +99,12 @@ describe('GroupComponent', () => { const snackBarSpy = { open: vi.fn().mockName('SnackBarService.open'), }; + const groupServiceSpy = { + search: () => of([]), + loadMore: () => of([]), + updated: new Subject(), + getNonEmptyLevels: () => of([]), + }; await TestBed.configureTestingModule({ imports: [ @@ -113,13 +120,22 @@ describe('GroupComponent', () => { ], providers: [ { provide: MatDialog, useValue: matDialogSpy }, - { provide: ActivatedRoute, useValue: { data: EMPTY } }, + { provide: ActivatedRoute, useValue: { data: EMPTY, snapshot: { data: { appId: 'GROUPS_APP' } } } }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: DownloadSnackBarService, useValue: {} }, - { provide: GroupService, useValue: {} }, + { provide: GroupService, useValue: groupServiceSpy }, ], - }).compileComponents(); + }) + .overrideComponent(GroupComponent, { + remove: { + imports: [GroupListComponent, GroupPreviewComponent], + }, + add: { + imports: [GroupListStubComponent, GroupPreviewStubComponent], + }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts index ca56e26bde6..2f5d6219626 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-create/hierarchy-create.component.spec.ts @@ -57,7 +57,6 @@ import { TranslatePipe } from '@ngx-translate/core'; multi: true, }, ], - standalone: false, }) class ProfilesFormStubComponent implements ControlValueAccessor { @Input() @@ -91,8 +90,8 @@ describe('HierarchyCreateComponent', () => { LevelInputComponent, TranslatePipe, HierarchyCreateComponent, + ProfilesFormStubComponent, ], - declarations: [ProfilesFormStubComponent], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { tenantId: 10 } }, diff --git a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts index 0f4b8d2f84c..5850819ac23 100644 --- a/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/shared/domains-input/domains-input.component.spec.ts @@ -46,7 +46,7 @@ import { DomainsInputComponent } from './domains-input.component'; @Component({ template: '', - imports: [DomainsInputComponent], + imports: [DomainsInputComponent, FormsModule], schemas: [NO_ERRORS_SCHEMA], }) export class TestHostComponent { diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts index 7db5dd3c0a8..c427cf982f9 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts @@ -107,7 +107,11 @@ describe('HoldingFilingSchemeComponent', () => { { provide: IngestService, useValue: ingestServiceMock }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'HOLDING_FILLING_SCHEME_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'HOLDING_FILLING_SCHEME_APP' }), + snapshot: { data: { appId: 'HOLDING_FILLING_SCHEME_APP' } }, + }, }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts index c7eba6740cf..2e65bcc6b17 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.spec.ts @@ -99,7 +99,11 @@ describe('IngestComponent test:', () => { { provide: UploadService, useValue: uploadServiceSpy }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'INGEST_MANAGEMENT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'INGEST_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'INGEST_MANAGEMENT_APP' } }, + }, }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts index bdd6c79e731..82742b480ab 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts @@ -44,6 +44,7 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractAuthorizationsUpdateComponent } from './access-contract-authorizations-update.component'; import { of } from 'rxjs'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { CdkStepper } from '@angular/cdk/stepper'; describe('AccessContractAuthorizationsUpdateComponent', () => { let component: AccessContractAuthorizationsUpdateComponent; @@ -71,6 +72,7 @@ describe('AccessContractAuthorizationsUpdateComponent', () => { { provide: MAT_DIALOG_DATA, useValue: {} }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: CdkStepper, useValue: { steps: [] } }, ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index 23c6f59f7ba..476c239d135 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -44,7 +44,7 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractComponent } from './access-contract.component'; -import { of } from 'rxjs'; +import { EMPTY, of } from 'rxjs'; @Component({ selector: 'app-access-contract-preview', @@ -68,6 +68,8 @@ describe('AccessContractComponent', () => { let fixture: ComponentFixture; const accessContractServiceMock = { getAll: () => of([]), + search: () => of([]), + updated: EMPTY, }; const applicationServiceMock = { @@ -90,12 +92,13 @@ describe('AccessContractComponent', () => { ], providers: [ { provide: BASE_URL, useValue: '/fake-api' }, - { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: ApplicationService, useValue: applicationServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, ], schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); + }) + .overrideProvider(AccessContractService, { useValue: accessContractServiceMock }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts index f6776c5f8bb..e2f4161b3e6 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts @@ -73,6 +73,7 @@ describe('AccessionRegisterPreviewComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), + snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, }; const AccessionRegistersServiceMock = { diff --git a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts index 14077da8006..4bada51dcaa 100644 --- a/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/admin-dsl/admin-dsl.component.spec.ts @@ -74,6 +74,7 @@ describe('AdminDslComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'DSL_APP' }), + snapshot: { data: { appId: 'DSL_APP' } }, }; await TestBed.configureTestingModule({ diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.spec.ts index 4b2e3d0dd5e..1c5b3c1424b 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-preview/agency-information-tab/agency-information-tab.component.spec.ts @@ -60,7 +60,11 @@ describe('AgencyInformationTabComponent', () => { { provide: SecurityService, useValue: securityServiceMock }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'AGENCIES_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'AGENCIES_APP' }), + snapshot: { data: { appId: 'AGENCIES_APP' } }, + }, }, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index 1b1abf66109..c58e1a0cd93 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -98,7 +98,7 @@ describe('AgencyComponent', () => { queryParams: of({}), paramMap: of(), data: of({ appId: 'AGENCIES_APP' }), - snapshot: { data: {} }, + snapshot: { data: { appId: 'AGENCIES_APP' } }, }, }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.spec.ts index 6305bad19d0..3bd899953a7 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/edit-agency/edit-agency.guard.spec.ts @@ -56,7 +56,7 @@ describe('EditAgencyGuard', () => { getSelectedTenant: vi.fn().mockReturnValue({ identifier: 1 }), }; mockRouter = { - navigateByUrl: vi.fn(), + navigateByUrl: vi.fn().mockReturnValue(Promise.resolve()), }; // Configuration du TestBed diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts index 81aae1e81f9..534c1cf323a 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts @@ -63,6 +63,7 @@ describe('AuditComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'AUDIT_APP' }), + snapshot: { data: { appId: 'AUDIT_APP' } }, }; const routerSpy = { navigate: vi.fn().mockName('Router.navigate'), diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts index 79beaa42b49..35d4a13db36 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts @@ -45,6 +45,7 @@ import { SearchBarComponent, SidenavPage, VitamuiBannerComponent, + VitamuiMenuButtonComponent, VitamuiTitleBreadcrumbComponent, } from 'vitamui-library'; import { AuditChainCreateComponent } from './audit-chain-create/audit-chain-create.component'; @@ -70,6 +71,7 @@ import { TranslatePipe } from '@ngx-translate/core'; DatepickerComponent, AuditListComponent, TranslatePipe, + VitamuiMenuButtonComponent, ], }) export class AuditComponent extends SidenavPage { diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts index c87838ea9c9..69134529617 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-preview.component.spec.ts @@ -40,6 +40,8 @@ import { MatDialog } from '@angular/material/dialog'; import { ContextService } from '../context.service'; import { ContextPreviewComponent } from './context-preview.component'; +import { Context } from 'vitamui-library'; +import { of } from 'rxjs'; describe('ContextPreviewComponent', () => { let component: ContextPreviewComponent; @@ -48,17 +50,29 @@ describe('ContextPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ContextPreviewComponent], - providers: [ - { provide: MatDialog, useValue: {} }, - { provide: ContextService, useValue: {} }, - ], + providers: [{ provide: MatDialog, useValue: {} }], schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents(); + }) + .overrideProvider(ContextService, { useValue: { updated: of() } }) + .compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(ContextPreviewComponent); component = fixture.componentInstance; + component.context = { + id: 'aegqaaaaaahbzl4naaovqamcuzgxyjyaaaaq', + name: 'admin-context', + identifier: 'CT-000001', + status: 'ACTIVE', + creationDate: '2022-08-16T10:57:52.168', + lastUpdate: '2022-08-16T13:12:53.416', + enableControl: 'false', + securityProfile: 'admin-security-profile', + permissions: [], + activationDate: 'activationDate', + deactivationDate: 'deactivationDate', + } satisfies Context; fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts index 407c57b5b93..196ca7f7579 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts @@ -39,7 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { ApplicationService, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { Application, ApplicationService, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; @@ -47,6 +47,7 @@ import { ActivatedRoute } from '@angular/router'; import { EMPTY, of } from 'rxjs'; import { ContextComponent } from './context.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { ContextListComponent } from './context-list/context-list.component'; @Component({ selector: 'app-agency-preview', @@ -58,13 +59,6 @@ class ContextPreviewStub { accessContract: any; } -@Component({ - selector: 'app-agency-list', - template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], -}) -class ContextListStub {} - describe('ContextComponent', () => { let component: ContextComponent; let fixture: ComponentFixture; @@ -72,6 +66,10 @@ describe('ContextComponent', () => { const applicationServiceMock = { applications: new Array(), isApplicationExternalIdentifierEnabled: () => of(true), + getAppById: () => + of({ + name: 'App name', + } satisfies Partial), }; beforeEach(async () => { @@ -84,18 +82,20 @@ describe('ContextComponent', () => { LoggerModule.forRoot(), MatSidenavModule, MatDialogModule, - ContextComponent, - ContextListStub, ContextPreviewStub, ], providers: [ - { provide: ApplicationService, useValue: applicationServiceMock }, - { provide: ActivatedRoute, useValue: { params: EMPTY, data: EMPTY } }, + { provide: ActivatedRoute, useValue: { params: EMPTY, data: EMPTY, paramMap: EMPTY, snapshot: { data: { appId: 'App Id' } } } }, { provide: GlobalEventService, useValue: { pageEvent: EMPTY, customerEvent: EMPTY, tenantEvent: EMPTY } }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(ApplicationService, { useValue: applicationServiceMock }) + .overrideComponent(ContextListComponent, { + set: { template: '' }, + }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts index 8b9d00e61a9..7b5ef63e61f 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-information-tab/file-format-information-tab.component.spec.ts @@ -98,7 +98,11 @@ describe('FileFormatInformationTabComponent', () => { { provide: StartupService, useValue: startupServiceStub }, { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'MANAGEMENT_CONTRACT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'MANAGEMENT_CONTRACT_APP' }), + snapshot: { data: { appId: 'MANAGEMENT_CONTRACT_APP' } }, + }, }, { provide: SecurityService, @@ -107,10 +111,11 @@ describe('FileFormatInformationTabComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: FileFormatService, useValue: fileFormatServiceMock }, ], schemas: [NO_ERRORS_SCHEMA], - }).compileComponents(); + }) + .overrideProvider(FileFormatService, { useValue: fileFormatServiceMock }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts index 8f1687d211b..687e1baa305 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-preview/file-format-preview.component.spec.ts @@ -40,6 +40,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { FileFormatService } from '../file-format.service'; import { FileFormatPreviewComponent } from './file-format-preview.component'; +import { of } from 'rxjs'; +import { FileFormat } from 'vitamui-library'; describe('FileFormatPreviewComponent', () => { let component: FileFormatPreviewComponent; @@ -48,17 +50,33 @@ describe('FileFormatPreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [FileFormatPreviewComponent], - providers: [ - { provide: MatDialog, useValue: {} }, - { provide: FileFormatService, useValue: {} }, - ], + providers: [{ provide: MatDialog, useValue: {} }], schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents(); + }) + .overrideProvider(FileFormatService, { useValue: { getAllForTenant: () => of([]) } }) + .compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(FileFormatPreviewComponent); component = fixture.componentInstance; + component.fileFormat = { + id: 'vitam_id', + documentVersion: 0, + version: '1.0', + versionPronom: '3.0', + puid: 'EXTERNAL_puid', + name: 'Name', + description: 'Format de Fichier', + mimeType: 'application/puid', + hasPriorityOverFileFormatIDs: [], + group: 'test', + alert: false, + comment: 'No Comment', + extensions: ['.puid'], + createdDate: new Date().toISOString(), + updateDate: new Date().toISOString(), + } satisfies FileFormat; fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts index 835ee350ecd..9ebf73d915e 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts @@ -40,7 +40,16 @@ import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { ApplicationService, BASE_URL, GlobalEventService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { + Application, + ApplicationService, + BASE_URL, + GlobalEventService, + IngestContract, + InjectorModule, + LoggerModule, + WINDOW_LOCATION, +} from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; @@ -57,11 +66,16 @@ describe('IngestContractComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'INGEST_CONTRACT_APP' }), + snapshot: { data: { appId: 'INGEST_CONTRACT_APP' } }, }; const applicationServiceMock = { applications: new Array(), isApplicationExternalIdentifierEnabled: () => of(true), + getAppById: () => + of({ + name: 'App name', + } satisfies Partial), }; await TestBed.configureTestingModule({ @@ -69,18 +83,49 @@ describe('IngestContractComponent', () => { imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, LoggerModule.forRoot(), IngestContractComponent], providers: [ GlobalEventService, - { provide: ApplicationService, useValue: applicationServiceMock }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: Router, useValue: {} }, { provide: MatDialog, useValue: {} }, { provide: BASE_URL, useValue: '' }, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: IngestContractService, useValue: {} }, { provide: DownloadSnackBarService, useValue: {} }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(IngestContractService, { + useValue: { + search: () => of([]), + updated: of({ + tenant: 0, + version: 1, + description: 'desc', + status: 'ACTIVE', + id: 'vitam_id', + name: 'Name', + identifier: 'SP-000001', + everyDataObjectVersion: true, + dataObjectVersion: ['test'], + creationDate: '01-01-20', + lastUpdate: '01-01-20', + activationDate: '01-01-20', + deactivationDate: '01-01-20', + checkParentLink: '', + linkParentId: '', + checkParentId: [''], + masterMandatory: true, + formatUnidentifiedAuthorized: true, + everyFormatType: true, + formatType: [''], + archiveProfiles: [], + managementContractId: 'MC-000001', + computeInheritedRulesAtIngest: false, + signaturePolicy: undefined, + } satisfies IngestContract), + }, + }) + .overrideProvider(ApplicationService, { useValue: applicationServiceMock }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts index d2ba403351c..afc04566408 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.spec.ts @@ -71,7 +71,10 @@ describe('LogbookOperationComponent', () => { provideNativeDateAdapter(), DatePipe, { provide: MatDialog, useValue: matDialogSpy }, - { provide: ActivatedRoute, useValue: { paramMap: EMPTY, data: EMPTY, queryParams: of({}) } }, + { + provide: ActivatedRoute, + useValue: { paramMap: EMPTY, data: EMPTY, queryParams: of({}), snapshot: { data: { appId: 'App Id' } } }, + }, { provide: LogbookSearchService, useValue: { search: () => EMPTY } }, { provide: Router, useValue: { navigate: () => {} } }, GlobalEventService, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index 09e9da58308..7141b24694f 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -171,12 +171,6 @@ describe('ManagementContractListComponent', () => { }); describe('DOM', () => { - it('should have 1 button ', () => { - const nativeElement = fixture.nativeElement; - const elementBtn = nativeElement.querySelectorAll('button'); - expect(elementBtn.length).toBe(1); - }); - it('should have 5 vitamui order button', () => { const nativeElement = fixture.nativeElement; const vitamUiOrderBtn = nativeElement.querySelectorAll('vitamui-order-by-button'); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts index 7da6b13d735..45527071a7b 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts @@ -40,7 +40,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; -import { InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, IntermediaryVersionEnum, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractPreviewComponent } from './management-contract-preview.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -83,6 +83,29 @@ describe('ManagementContractPreviewComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(ManagementContractPreviewComponent); component = fixture.componentInstance; + component.inputManagementContract = { + id: 'contractId', + name: 'Contrat de gestion avec stockage', + identifier: 'MCDefaultStorageAll', + description: 'Contrat de gestion valide déclarant pas de surcharge pour le stockage avec la stratégie par défaut', + status: 'ACTIVE', + lastUpdate: '10/12/2016', + creationDate: '10/12/2016', + activationDate: '10/12/2016', + deactivationDate: '10/12/2016', + tenant: 10, + version: 2, + storage: { + unitStrategy: 'default', + objectGroupStrategy: 'default', + objectStrategy: 'default', + }, + versionRetentionPolicy: { + usages: null, + initialVersion: true, + intermediaryVersionEnum: IntermediaryVersionEnum.ALL, + }, + }; fixture.detectChanges(); }); @@ -102,12 +125,4 @@ describe('ManagementContractPreviewComponent', () => { expect(component.tabUpdated.length).toEqual(2); expect(component.tabUpdated).toEqual(expectedArray); }); - - describe('DOM', () => { - it('should have 4 angular mat tab', () => { - const nativeElement = fixture.nativeElement; - const elementMatTab = nativeElement.querySelectorAll('mat-tab'); - expect(elementMatTab.length).toBe(4); - }); - }); }); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts index 012da61e6b8..b748501d7b7 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts @@ -44,7 +44,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { ApplicationService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { Application, ApplicationService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractComponent } from './management-contract.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -55,6 +55,10 @@ describe('ManagementContractComponent', () => { const applicationServiceSpy = { isApplicationExternalIdentifierEnabled: vi.fn().mockName('ApplicationService.isApplicationExternalIdentifierEnabled'), + getAppById: () => + of({ + name: 'App name', + } satisfies Partial), }; applicationServiceSpy.isApplicationExternalIdentifierEnabled.mockReturnValue(of(true)); @@ -80,15 +84,20 @@ describe('ManagementContractComponent', () => { providers: [ { provide: ActivatedRoute, - useValue: { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'MANAGEMENT_CONTRACT_APP' }) }, + useValue: { + params: of({ tenantIdentifier: 1 }), + data: of({ appId: 'MANAGEMENT_CONTRACT_APP' }), + snapshot: { data: { appId: 'MANAGEMENT_CONTRACT_APP' } }, + }, }, { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: ApplicationService, useValue: applicationServiceSpy }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), ], - }).compileComponents(); + }) + .overrideProvider(ApplicationService, { useValue: applicationServiceSpy }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts index a44a0eee1e1..d03146bad4e 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts @@ -44,6 +44,7 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyComponent } from './ontology.component'; import { OntologyService } from './ontology.service'; +import { EMPTY } from 'rxjs'; @Component({ selector: 'app-ontology-preview', @@ -81,8 +82,8 @@ describe('OntologyComponent', () => { ], schemas: [NO_ERRORS_SCHEMA], providers: [ - { provide: OntologyService, useValue: {} }, - { provide: SchemaService, useValue: {} }, + { provide: OntologyService, useValue: { search: () => EMPTY, updated: EMPTY } }, + { provide: SchemaService, useValue: { getSchemaTreeByCategory: () => EMPTY } }, { provide: StartupService, useValue: { getConfigStringValue: (_param: string) => '' } }, { provide: SecurityService, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts index 765b40cabf3..e3967a7d0ab 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts @@ -58,6 +58,7 @@ describe('ProbativeValueComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'PROBATIVE_VALUE_APP' }), + snapshot: { data: { appId: 'PROBATIVE_VALUE_APP' } }, }; await TestBed.configureTestingModule({ imports: [ diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts index 07fbeb8c0ef..2e1ca1db880 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-preview/rule-information-tab/rule-information-tab.component.spec.ts @@ -83,6 +83,7 @@ describe('RuleInformationTabComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'RULES_APP' }), + snapshot: { data: { appId: 'RULES_APP' } }, }; await TestBed.configureTestingModule({ imports: [RuleInformationTabComponent], diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index 30c6d222af7..5343582cbee 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -134,6 +134,7 @@ describe('RuleComponent', () => { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'RULE_APP' }), paramMap: EMPTY, + snapshot: { data: { appId: 'RULE_APP' } }, }; const securityServiceMock = { diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts index dc899d298a3..e5acc832545 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-preview.component.spec.ts @@ -115,12 +115,13 @@ describe('SecurisationPreviewComponent', () => { await TestBed.configureTestingModule({ imports: [BrowserAnimationsModule, EventTypeBadgeColorPipe, SecurisationPreviewComponent, MockTruncatePipe], providers: [ - { provide: SecurisationService, useValue: {} }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: SnackBarService, useValue: snackBarSpy }, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents(); + }) + .overrideProvider(SecurisationService, { useValue: { getInfoFromTimestamp: () => of({}) } }) + .compileComponents(); }); beforeEach(() => { diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts index 415599b4acb..873c470f2c1 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts @@ -59,6 +59,7 @@ describe('SecurisationComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'SECURISATION_APP' }), + snapshot: { data: { appId: 'SECURISATION_APP' } }, }; await TestBed.configureTestingModule({ diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts index 3384e462247..fedbb8e183d 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-preview/security-profile-preview.component.spec.ts @@ -48,17 +48,23 @@ describe('SecurityProfilePreviewComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [SecurityProfilePreviewComponent], - providers: [ - { provide: MatDialog, useValue: {} }, - { provide: SecurityProfileService, useValue: {} }, - ], + providers: [{ provide: MatDialog, useValue: {} }], schemas: [CUSTOM_ELEMENTS_SCHEMA], - }).compileComponents(); + }) + .overrideProvider(SecurityProfileService, { useValue: {} }) + .compileComponents(); }); beforeEach(() => { fixture = TestBed.createComponent(SecurityProfilePreviewComponent); component = fixture.componentInstance; + component.securityProfile = { + id: 'vitam_id', + name: 'Name', + identifier: 'SP-000001', + fullAccess: true, + permissions: [], + }; fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts index 37e1467b2d9..c08c67e1a57 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.spec.ts @@ -54,8 +54,7 @@ describe('AccountInformationTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ReactiveFormsModule, SlideToggleComponent, AccountInformationTabComponent], - declarations: [VitamUIFieldErrorStubComponent], + imports: [ReactiveFormsModule, SlideToggleComponent, AccountInformationTabComponent, VitamUIFieldErrorStubComponent], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, { provide: AccountService, useValue: accountServiceSpy }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/search-bar/search-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/search-bar/search-bar.component.spec.ts index 3d2e27e4d2b..3948cb77518 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/search-bar/search-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/search-bar/search-bar.component.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; @@ -42,21 +42,18 @@ import { SearchBarComponent } from './search-bar.component'; @Component({ template: ` `, - standalone: false, + imports: [FormsModule, SearchBarComponent], + schemas: [NO_ERRORS_SCHEMA], }) export class TestHostComponent {} -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - describe('SearchBarComponent', () => { let testhost: TestHostComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [FormsModule, SearchBarComponent], - declarations: [TestHostComponent], + imports: [TestHostComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter-search.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter-search.component.spec.ts index ab95424154a..ddbf12e8e30 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter-search.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter-search.component.spec.ts @@ -35,22 +35,21 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormsModule } from '@angular/forms'; -import { MatPseudoCheckboxModule } from '@angular/material/core'; import { By } from '@angular/platform-browser'; +import { FormsModule } from '@angular/forms'; import { TableFilterOptionComponent } from './table-filter-option/table-filter-option.component'; import { TableFilterSearchComponent } from './table-filter-search.component'; -import { TableFilterComponent } from './table-filter.component'; @Component({ template: ` `, - standalone: false, + imports: [FormsModule, TableFilterSearchComponent], + schemas: [NO_ERRORS_SCHEMA], }) export class TestHostComponent { filter: any; @@ -64,17 +63,13 @@ export class TestHostComponent { onClose() {} } -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - describe('TableFilterSearchComponent', () => { let testhost: TestHostComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatPseudoCheckboxModule, FormsModule, TableFilterSearchComponent, TableFilterComponent, TableFilterOptionComponent], - declarations: [TestHostComponent], + imports: [TestHostComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.component.spec.ts index fa0399ab922..6adceed2449 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.component.spec.ts @@ -35,10 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; -import { MatPseudoCheckboxModule } from '@angular/material/core'; import { By } from '@angular/platform-browser'; import { TableFilterOptionComponent } from './table-filter-option/table-filter-option.component'; @@ -53,7 +52,8 @@ import { TableFilterComponent } from './table-filter.component'; Option 3 `, - standalone: false, + imports: [FormsModule, TableFilterComponent, TableFilterOptionComponent], + schemas: [NO_ERRORS_SCHEMA], }) export class TestHostComponent { filter: any; @@ -63,17 +63,13 @@ export class TestHostComponent { onClose() {} } -@NgModule({ declarations: [TestHostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - describe('TableFilterComponent', () => { let testhost: TestHostComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatPseudoCheckboxModule, FormsModule, TableFilterComponent, TableFilterOptionComponent], - declarations: [TestHostComponent], + imports: [TestHostComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.directive.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.directive.spec.ts index e4bf54d6ed7..50f9295491a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.directive.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/table-filter/table-filter.directive.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { OverlayModule } from '@angular/cdk/overlay'; -import { Component, NgModule, NO_ERRORS_SCHEMA } from '@angular/core'; +import { Component, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { TableFilterDirective } from './table-filter.directive'; @@ -45,21 +45,18 @@ import { TableFilterDirective } from './table-filter.directive'; Overlay content `, - standalone: false, + imports: [TableFilterDirective, OverlayModule], + schemas: [NO_ERRORS_SCHEMA], }) export class TesthostComponent {} -@NgModule({ declarations: [TesthostComponent], schemas: [NO_ERRORS_SCHEMA] }) -class TestHostModule {} - describe('TableFilterDirective', () => { let testhost: TesthostComponent; let fixture: ComponentFixture; beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [TableFilterDirective, OverlayModule], - declarations: [TesthostComponent], + imports: [TesthostComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/testing/src/router-link-stub.directive.ts b/ui/ui-frontend/projects/vitamui-library/testing/src/router-link-stub.directive.ts index 8688b95fbb4..e850d01e403 100644 --- a/ui/ui-frontend/projects/vitamui-library/testing/src/router-link-stub.directive.ts +++ b/ui/ui-frontend/projects/vitamui-library/testing/src/router-link-stub.directive.ts @@ -39,7 +39,6 @@ import { Directive, HostListener, Input } from '@angular/core'; @Directive({ // eslint-disable-next-line @angular-eslint/directive-selector selector: '[routerLink]', - standalone: false, }) export class RouterLinkStubDirective { @Input() routerLink: any; diff --git a/ui/ui-frontend/projects/vitamui-library/testing/src/vitamui-common-test.module.ts b/ui/ui-frontend/projects/vitamui-library/testing/src/vitamui-common-test.module.ts index b11f650f9a4..f05bb7d7ec6 100644 --- a/ui/ui-frontend/projects/vitamui-library/testing/src/vitamui-common-test.module.ts +++ b/ui/ui-frontend/projects/vitamui-library/testing/src/vitamui-common-test.module.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -/* eslint-disable max-classes-per-file */ import { Component, Directive, EventEmitter, forwardRef, Input, NgModule, Output, Pipe, PipeTransform, TemplateRef } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import type { AsyncValidatorFn, ValidatorFn } from '@angular/forms'; @@ -44,7 +43,6 @@ import { provideTranslateService } from '@ngx-translate/core'; @Component({ selector: 'vitamui-common-tenant-select', template: '', - standalone: false, }) export class VitamUITenantSelectStubComponent {} @@ -52,7 +50,6 @@ export class VitamUITenantSelectStubComponent {} selector: 'vitamui-stepper', template: '', providers: [{ provide: CdkStepper, useExisting: StepperStubComponent }], - standalone: false, }) export class StepperStubComponent { @Input() selectedIndex: number; @@ -69,7 +66,6 @@ export class StepperStubComponent { multi: true, }, ], - standalone: false, }) export class VitamUIInputStubComponent implements ControlValueAccessor { @Input() placeholder: any; @@ -91,7 +87,6 @@ export class VitamUIInputStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, }) export class InputStubComponent implements ControlValueAccessor { @Input() placeholder: any; @@ -114,7 +109,6 @@ export class InputStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, }) export class VitamUIInputPositiveNumberStubComponent implements ControlValueAccessor { @Input() placeholder: any; @@ -136,7 +130,6 @@ export class VitamUIInputPositiveNumberStubComponent implements ControlValueAcce multi: true, }, ], - standalone: false, }) export class VitamUITextareaStubComponent implements ControlValueAccessor { @Input() placeholder: any; @@ -158,7 +151,6 @@ export class VitamUITextareaStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, }) export class VitamUISlideToggleStubComponent implements ControlValueAccessor { @Input() disabled: boolean; @@ -177,7 +169,6 @@ export class VitamUISlideToggleStubComponent implements ControlValueAccessor { // Editable fields @Directive() -// eslint-disable-next-line @angular-eslint/directive-class-suffix export class EditableFieldStubComponent implements ControlValueAccessor { @Input() validator: ValidatorFn; @Input() asyncValidator: AsyncValidatorFn; @@ -202,7 +193,6 @@ export class EditableFieldStubComponent implements ControlValueAccessor { multi: true, }, ], - standalone: false, }) export class VitamUIEditableEmailInputStubComponent extends EditableFieldStubComponent { @Input() domains: string[]; @@ -211,7 +201,6 @@ export class VitamUIEditableEmailInputStubComponent extends EditableFieldStubCom @Component({ selector: 'vitamui-common-field-error', template: '', - standalone: false, }) export class VitamUIFieldErrorStubComponent {} @@ -225,7 +214,6 @@ export class VitamUIFieldErrorStubComponent {} multi: true, }, ], - standalone: false, }) export class VitamUIEditableFileStubComponent extends EditableFieldStubComponent {} @@ -239,7 +227,6 @@ export class VitamUIEditableFileStubComponent extends EditableFieldStubComponent multi: true, }, ], - standalone: false, }) export class VitamUIEditableInputStubComponent extends EditableFieldStubComponent {} @@ -253,7 +240,6 @@ export class VitamUIEditableInputStubComponent extends EditableFieldStubComponen multi: true, }, ], - standalone: false, }) export class VitamUIEditableTextareaStubComponent extends EditableFieldStubComponent {} @@ -267,7 +253,6 @@ export class VitamUIEditableTextareaStubComponent extends EditableFieldStubCompo multi: true, }, ], - standalone: false, }) export class VitamUIEditableSelectStubComponent extends EditableFieldStubComponent {} @@ -281,14 +266,12 @@ export class VitamUIEditableSelectStubComponent extends EditableFieldStubCompone multi: true, }, ], - standalone: false, }) export class VitamUIAutocompleteMultiSelectStubComponent extends EditableFieldStubComponent {} @Component({ selector: 'vitamui-common-editable-option', template: '', - standalone: false, }) export class VitamUIEditableOptionStubComponent { @Input() value: any; @@ -306,14 +289,12 @@ export class VitamUIEditableOptionStubComponent { multi: true, }, ], - standalone: false, }) export class VitamUIEditableToggleGroupStubComponent extends EditableFieldStubComponent {} @Component({ selector: 'vitamui-common-editable-button-toggle', template: '', - standalone: false, }) export class VitamUIEditableButtonToggleStubComponent { @Input() value: any; @@ -329,7 +310,6 @@ export class VitamUIEditableButtonToggleStubComponent { multi: true, }, ], - standalone: false, }) export class EditableLevelInputStubComponent implements ControlValueAccessor { @Input() validator: any; @@ -346,7 +326,6 @@ export class EditableLevelInputStubComponent implements ControlValueAccessor { @Pipe({ name: 'strongify', - standalone: false, }) export class StrongifyStubPipe implements PipeTransform { transform(value: any): any { @@ -356,7 +335,6 @@ export class StrongifyStubPipe implements PipeTransform { @Pipe({ name: 'truncate', - standalone: false, }) export class TruncateStubPipe implements PipeTransform { transform(value: string = ''): any { @@ -366,7 +344,6 @@ export class TruncateStubPipe implements PipeTransform { @Pipe({ name: 'dateTime', - standalone: false, }) export class DateTimeStubPipe implements PipeTransform { transform(value: string = ''): any { @@ -376,7 +353,6 @@ export class DateTimeStubPipe implements PipeTransform { @Directive({ selector: '[vitamuiCommonInfiniteScroll]', - standalone: false, }) export class InfiniteScrollStubDirective { @Input() vitamuiCommonInfiniteScrollThreshold: any; @@ -387,7 +363,6 @@ export class InfiniteScrollStubDirective { @Directive({ selector: '[vitamuiCommonTableFilter]', exportAs: 'vitamuiCommonTableFilter', - standalone: false, }) export class TableFilterStubDirective { @Input('vitamuiCommonTableFilter') templateRef: TemplateRef; @@ -397,7 +372,6 @@ export class TableFilterStubDirective { @Directive({ selector: '[vitamuiCommonRowCollapse]', exportAs: 'vitamuiRowCollapse', - standalone: false, }) export class RowCollapseStubDirective { @Input() vitamuiCommonCollapse: any; @@ -405,7 +379,6 @@ export class RowCollapseStubDirective { @Directive({ selector: '[vitamuiCommonRowCollapseTriggerFor]', - standalone: false, }) export class RowCollapseTriggerForStubDirective { @Input() vitamuiCommonRowCollapseTriggerFor: any; @@ -440,8 +413,7 @@ const components = [ ]; @NgModule({ - declarations: components, - imports: [], + imports: [...components], exports: [...components], providers: [provideTranslateService({ fallbackLang: 'fr' })], }) From 898bc8016a80c1693a0a5c23cb37aec233ed332d Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 27 Aug 2026 18:16:21 +0200 Subject: [PATCH 09/33] Story #16471: Clean code - WIP --- .../archive-preview.component.spec.ts | 2 + ...ive-unit-information-tab.component.spec.ts | 4 ++ ...e-unit-rules-details-tab.component.spec.ts | 2 + ...t-rules-informations-tab.component.spec.ts | 2 + .../dip-request-create.component.spec.ts | 2 + .../add-management-rules.component.spec.ts | 2 + .../add-update-property.component.spec.ts | 2 + .../archive-unit-rules.component.spec.ts | 2 + ...ock-category-inheritance.component.spec.ts | 2 + .../block-rules-inheritance.component.spec.ts | 2 + .../delete-unit-rules.component.spec.ts | 2 + ...ock-category-inheritance.component.spec.ts | 2 + ...unlock-rules-inheritance.component.spec.ts | 2 + .../update-unit-rules.component.spec.ts | 2 + .../management-rules.component.spec.ts | 2 + .../transfer-request-modal.component.spec.ts | 2 + .../archive-search.component.spec.ts | 2 + .../simple-criteria-search.component.spec.ts | 2 + .../transfer-acknowledgment.component.spec.ts | 2 + .../src/app/archive/archive.component.spec.ts | 2 + .../src/app/archive/archive.service.spec.ts | 2 + .../archive-facets.service.spec.ts | 2 + .../criteria-search.component.spec.ts | 2 + .../found-object-modal.component.spec.ts | 2 + .../app/core/api/archive-api.service.spec.ts | 2 + .../add-units/add-units.component.spec.ts | 2 + .../archive-preview.component.spec.ts | 4 ++ ...e-unit-rules-details-tab.component.spec.ts | 2 + ...t-rules-informations-tab.component.spec.ts | 2 + ...object-group-details-tab.component.spec.ts | 2 + .../archive-search-collect.component.spec.ts | 2 + ...-criteria-search-collect.component.spec.ts | 2 + .../update-units-metadata.component.spec.ts | 2 + .../core/api/project-api.service.spec.ts | 2 + .../create-project.component.spec.ts | 2 + .../project-preview.component.spec.ts | 43 +++++++++++-------- .../sip-import-tracking.service.spec.ts | 3 +- .../transaction-list.component.spec.ts | 2 + .../app/core/api/customer-api.service.spec.ts | 2 + .../src/app/core/customer.service.spec.ts | 2 + .../customer-create.component.spec.ts | 2 + .../customer-list.service.spec.ts | 2 + .../sso-tab/identity-provider.service.spec.ts | 2 + .../owner-preview.component.spec.ts | 2 + .../src/app/customer/owner.service.spec.ts | 2 + .../src/app/customer/tenant.service.spec.ts | 2 + ...nal-param-profile-detail.component.spec.ts | 2 + ...rnal-param-profile-service.service.spec.ts | 2 + .../units-edit/units-edit.component.spec.ts | 2 + .../profiles-edit.component.spec.ts | 2 + .../app/hierarchy/hierarchy.service.spec.ts | 2 + .../customer-select.service.spec.ts | 2 + .../subrogation/subrogation.service.spec.ts | 2 + .../app/core/api/ingest-api.service.spec.ts | 2 + .../app/core/common/upload.component.spec.ts | 2 + .../ingest-referential.service.spec.ts | 2 + .../ingest-preview.component.spec.ts | 2 + .../file-tree-metadata.component.spec.ts | 2 + .../portal/src/app/app.component.spec.ts | 2 + .../access-contract-create.component.spec.ts | 2 + ...ccess-contract-nodes-tab.component.spec.ts | 2 + ...ess-contract-node-update.component.spec.ts | 2 + .../access-contract.component.spec.ts | 4 ++ ...cession-register-preview.component.spec.ts | 4 ++ .../agency-list/agency-list.component.spec.ts | 3 +- .../src/app/agency/agency.component.spec.ts | 2 + .../audit-preview.component.spec.ts | 4 ++ .../context-permission-tab.component.spec.ts | 2 + .../app/core/api/context-api.service.spec.ts | 2 + .../api/ingest-contract-api.service.spec.ts | 2 + .../app/core/api/ontology-api.service.spec.ts | 2 + .../core/api/operation-api.service.spec.ts | 2 + .../api/security-profile-api.service.spec.ts | 2 + .../ingest-contract-create.component.spec.ts | 2 + ...-contract-attachment-tab.component.spec.ts | 2 + ...est-contract-node-update.component.spec.ts | 2 + ...gement-operation-preview.component.spec.ts | 2 + ...logbook-operation-detail.component.spec.ts | 3 ++ ...nagement-contract-create.component.spec.ts | 2 + ...management-contract-list.component.spec.ts | 2 + ...contract-information-tab.component.spec.ts | 2 + ...ent-contract-storage-tab.component.spec.ts | 2 + .../griffin-list.component.spec.ts | 2 + ...eservation-scenario-list.component.spec.ts | 2 + .../preservation.component.spec.ts | 2 + .../src/app/rule/rule.component.spec.ts | 2 + .../securisation-check-tab.component.spec.ts | 2 + .../referential-import-api.service.spec.ts | 2 + .../modules/account/account.component.spec.ts | 4 ++ .../agencies/agency-api.service.spec.ts | 2 + .../analytics-resolver.service.spec.ts | 2 + .../api/access-contract-api.service.spec.ts | 2 + .../api/subrogation-api.service.spec.ts | 2 + .../app/modules/api/user-api.service.spec.ts | 2 + .../app/modules/application.service.spec.ts | 2 + .../archive-unit-viewer.service.spec.ts | 2 + .../object-viewer.component.spec.ts | 2 + .../filing-plan/filing-plan.service.spec.ts | 2 + .../reclassification-dialog.component.spec.ts | 2 +- .../reclassification-dialog.service.spec.ts | 4 ++ 100 files changed, 237 insertions(+), 21 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index 6297690c72e..ce1dbc83be8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -115,6 +115,8 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts index dcd7e340bdb..8b003c86808 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts @@ -68,6 +68,8 @@ import { } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveUnitInformationTabComponent } from './archive-unit-information-tab.component'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('ArchiveUnitInformationTabComponent', () => { let component: ArchiveUnitInformationTabComponent; @@ -143,6 +145,8 @@ describe('ArchiveUnitInformationTabComponent', () => { providers: [ FormBuilder, { provide: ArchiveService, useValue: archiveServiceMock }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 790a07c5eb0..ef711c79e9b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -73,6 +73,8 @@ describe('ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, ArchiveUnitRulesDetailsTabComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 43e6b1d8423..26544bc019d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -129,6 +129,8 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { DateTimeStubPipe, ], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideI18n(), provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts index a538d07f7a8..695353fd2cb 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts @@ -102,6 +102,8 @@ describe('DipRequestCreateComponent', () => { selectedItemCountKnown: true, }, }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts index acf217abfbc..bf19d6508b0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts @@ -210,6 +210,8 @@ describe('AddManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, AddManagementRulesComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index 932c0d36112..3e9a505cc33 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -130,6 +130,8 @@ describe('AddUpdatePropertyComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, AddUpdatePropertyComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index a46787c8bc9..41987265ad7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -200,6 +200,8 @@ describe('ArchiveUnitRulesComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ArchiveUnitRulesComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index 7bb6d9cc4f2..6461335634e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -129,6 +129,8 @@ describe('BlockCategoryInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockCategoryInheritanceComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index 44f000f4e15..cd33766cfee 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -151,6 +151,8 @@ describe('BlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockRulesInheritanceComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts index 1bba10bfc3b..9d5800a1253 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts @@ -210,6 +210,8 @@ describe('DeleteUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, DeleteUnitRulesComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index 009969ddb30..d88fc3a6e41 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -245,6 +245,8 @@ describe('UnlockCategoryInheritanceComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, UnlockCategoryInheritanceComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts index 1546b530913..669199ced92 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts @@ -197,6 +197,8 @@ describe('UnlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UnlockRulesInheritanceComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts index c1e3e90b758..fb0a5ad338b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts @@ -210,6 +210,8 @@ describe('UpdateUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UpdateUnitRulesComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index c9598658837..a6b03695676 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -144,6 +144,8 @@ describe('ManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ManagementRulesComponent], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: startupServiceStub }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts index 0a5c9ca9ead..a85eac68914 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts @@ -88,6 +88,8 @@ describe('TransferRequestModalComponent tests', () => { selectedItemCountKnown: true, }, }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index fb738c304d4..be1858c0926 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -196,6 +196,8 @@ describe('ArchiveSearchComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts index 42919b7a8d1..a30d42e3ce4 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts @@ -100,6 +100,8 @@ describe('SimpleCriteriaSearchComponent', () => { { provide: MatDialog, useValue: matDialogSpy }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: SchemaService, useValue: schemaServiceMock }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, SnackBarService, { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index f439da9b07d..3f01f164654 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -88,6 +88,8 @@ describe('TransferAcknowledgmentComponent', () => { await TestBed.configureTestingModule({ imports: [TransferAcknowledgmentComponent, CdkStep, InjectorModule, LoggerModule.forRoot(), MockDateTimePipe], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts index 3d617c5f92f..f94097bb2d0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts @@ -123,6 +123,8 @@ describe('ArchiveComponent', () => { { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: SecurityService, useValue: securityServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts index 5f7df9aa461..9bba7e9fe2d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts @@ -54,6 +54,8 @@ describe('ArchiveService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts index af3ba9192a8..026334dbbf0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts @@ -131,6 +131,8 @@ describe('ArchiveFacetsService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ArchiveFacetsService, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts index 4b487df56d1..8f86faa63ad 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts @@ -71,6 +71,8 @@ describe('CriteriaSearchComponent', () => { providers: [ TranslateWithOptionalTypeSuffixPipe, { provide: WINDOW_LOCATION, useValue: window.location }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts index 16cc9b6b6ba..197fe60bb2a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts @@ -74,6 +74,8 @@ describe('ErrorResponseModalComponent', () => { provide: MatDialogRef, useValue: matDialogRefSpy, }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MAT_DIALOG_DATA, diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts index b8ee0288343..06218ab40be 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts @@ -46,6 +46,8 @@ describe('ArchiveApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index 025bb05efb0..567b0083799 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -97,6 +97,8 @@ describe('AddUnitsComponent', () => { imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), AddUnitsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts index b167825dc7f..7bc9dde1f2e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts @@ -60,6 +60,8 @@ import { import { environment } from '../../../../environments/environment'; import { ArchiveCollectService } from '../archive-collect.service'; import { ArchivePreviewComponent } from './archive-preview.component'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('ArchivePreviewComponent', () => { let component: ArchivePreviewComponent; @@ -103,6 +105,8 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 377ac497cb8..934eb78a574 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -51,6 +51,8 @@ describe('Collect ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, LoggerModule.forRoot(), ArchiveUnitRulesDetailsTabComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 148fb5ca1fe..b17e6252730 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -129,6 +129,8 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { DateTimeStubPipe, ], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideI18n(), provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts index 71e30aa3a18..7682fce802d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts @@ -131,6 +131,8 @@ describe('CollectObjectGroupDetailsTabComponent', () => { CollectObjectGroupDetailsTabComponent, ], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index f1881ea40af..f7edafec571 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -172,6 +172,8 @@ describe('ArchiveSearchCollectComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index 4fe1475abd3..fcd1399aedc 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -70,6 +70,8 @@ describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: matDialogSpy }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index 0a2576f6573..180e28f277f 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -72,6 +72,8 @@ describe('UpdateUaMetadataComponent', () => { await TestBed.configureTestingModule({ imports: [UpdateUnitsMetadataComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts index b7367808796..eb7b7ecd847 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts @@ -48,6 +48,8 @@ describe('ProjectService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts index 3144fe8e2d8..83196d4cedc 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts @@ -167,6 +167,8 @@ describe('CreateProjectComponent', () => { ], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts index 13e8541db11..2da2698f564 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts @@ -52,6 +52,7 @@ import { Project, ProjectStatus, SchemaService, + SnackBarService, TenantSelectionService, Transaction, TransactionStatus, @@ -59,6 +60,8 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProjectsApiService } from '../../core/api/project-api.service'; import { ProjectPreviewComponent } from './project-preview.component'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('ProjectPreviewComponent', () => { let component: ProjectPreviewComponent; @@ -112,6 +115,7 @@ describe('ProjectPreviewComponent', () => { updateProjectContext: () => of(projectAfterUpdate), updateProjectAttachments: () => of(projectAfterUpdate), updateProjectConfiguration: () => of(projectAfterUpdate), + nextUpdatedProject: () => {}, getLegalStatusList: () => [ { id: 'Public Archive', value: 'Public archives' }, { id: 'Private Archive', value: 'Private archives' }, @@ -155,30 +159,37 @@ describe('ProjectPreviewComponent', () => { ], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ProjectsService, useValue: projectServiceMock }, { provide: MatDialogRef, useValue: { close: () => {}, }, }, - { provide: ProjectsApiService, useValue: projectApiServiceMock }, { provide: ActivatedRoute, useValue: { params: of('11') } }, - { provide: TenantSelectionService, useValue: tenantSelectionServiceMock }, - { provide: SchemaService, useValue: { getDescriptiveSchemaTree: () => of(), getSchema: () => of([]) } }, - { - provide: FilingPlanService, - useValue: { - tree$: of([]), - expandChange$: EMPTY, - loadTree: () => of([]), - loadFilingPlan: () => of([]), - }, - }, { provide: Router, useValue: {} }, ], - }).compileComponents(); + }) + .overrideProvider(ProjectsService, { useValue: projectServiceMock }) + .overrideProvider(ProjectsApiService, { useValue: projectApiServiceMock }) + .overrideProvider(TenantSelectionService, { useValue: tenantSelectionServiceMock }) + .overrideProvider(SchemaService, { useValue: { getDescriptiveSchemaTree: () => of(), getSchema: () => of([]) } }) + .overrideProvider(FilingPlanService, { + useValue: { + tree$: of([]), + expandChange$: EMPTY, + loadTree: () => of([]), + loadFilingPlan: () => of([]), + }, + }) + .overrideProvider(SnackBarService, { + useValue: { + open: vi.fn(), + }, + }) + .compileComponents(); }); beforeEach(async () => { @@ -227,8 +238,6 @@ describe('ProjectPreviewComponent', () => { component.form.get('messageIdentifier').setValue(projectAfterUpdate.messageIdentifier); component.update(); component.updateProject(true); - fixture.whenStable().then(() => { - expect(projectServiceMock.updateProjectDescription).toHaveBeenCalled(); - }); + expect(projectServiceMock.updateProjectDescription).toHaveBeenCalled(); })); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/shared/sip-import-tracking.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/shared/sip-import-tracking.service.spec.ts index ca4485db4e3..65597f6d8b9 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/shared/sip-import-tracking.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/shared/sip-import-tracking.service.spec.ts @@ -50,8 +50,7 @@ describe('SipImportTrackingService', () => { transactionApiService = { getOperationStatus: vi.fn() }; TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [{ provide: TransactionApiService, useValue: transactionApiService }], - }); + }).overrideProvider(TransactionApiService, { useValue: transactionApiService }); service = TestBed.inject(SipImportTrackingService); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index 969a86e7f8e..ef9694c3509 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -140,6 +140,8 @@ describe('TransactionListComponent', () => { }, }, }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts index 1152ae3c22b..1726e85139c 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts @@ -46,6 +46,8 @@ describe('CustomerApiService Identity', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts index eb847a2cf0c..896aa15d134 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts @@ -101,6 +101,8 @@ describe('CustomerService', () => { imports: [LoggerModule.forRoot()], providers: [ CustomerService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: snackBarSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index 0e614bd4fb0..96cf08cf3eb 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -272,6 +272,8 @@ describe('CustomerCreateComponent', () => { { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: { getConfigNumberValue: () => 100 } }, { provide: CustomerService, useValue: customerServiceSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts index 2b2a391246e..756d0756c72 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts @@ -302,6 +302,8 @@ describe('CustomerListService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts index 110beb9ba59..df85d83ae07 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts @@ -98,6 +98,8 @@ describe('IdentityProviderService', () => { providers: [ IdentityProviderService, { provide: SnackBarService, useValue: snackBarSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 5b100a62cb9..1d2ca41106c 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -76,6 +76,8 @@ describe('OwnerPreviewComponent', () => { ], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index 713403eda1b..73d87a04ec5 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -70,6 +70,8 @@ describe('OwnerService', () => { providers: [ OwnerService, { provide: SnackBarService, useValue: snackBarSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts index d6f25f34f88..cb4d1ce4b19 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts @@ -132,6 +132,8 @@ describe('TenantService', () => { imports: [], providers: [ TenantService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index 12096992457..df8e681efc8 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -68,6 +68,8 @@ describe('ExternalParamProfilDetailComponent', () => { { provide: ExternalParamProfileService, useValue: { updated: new Subject(), getAllActiveAccessContracts: of() } }, { provide: AuthService, useValue: authServiceMock }, { provide: WINDOW_LOCATION, useValue: {} }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts index 94a42e3aebc..47bc241ddb5 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts @@ -51,6 +51,8 @@ describe('ExternalParamProfileService', () => { providers: [ ExternalParamProfileService, { provide: SnackBarService, useValue: snackBarSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts index 02b8f352fac..142ed02c481 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts @@ -83,6 +83,8 @@ describe('UnitsEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', units: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts index 170b413e78d..1f4cf84bc8a 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts @@ -88,6 +88,8 @@ describe('ProfilesEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', profileIds: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts index c85134e7e58..85ef0930e0c 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts @@ -53,6 +53,8 @@ describe('HierarchyService', () => { providers: [ HierarchyService, { provide: SnackBarService, useValue: snackBarSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts index 61da85ab597..c74f1780a18 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts @@ -56,6 +56,8 @@ describe('CustomerSelectService', () => { providers: [ CustomerSelectService, { provide: AuthService, useValue: authStubService }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts index 2c6a9dcc952..28617532e92 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts @@ -47,6 +47,8 @@ describe('SubrogationService', () => { imports: [], providers: [ SubrogationService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: SubrogationApiService, useValue: {} }, diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts index 76879423c30..c2bf1a5f350 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts @@ -47,6 +47,8 @@ describe('IngestApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts index 068155e3797..ad2e0601cd8 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts @@ -72,6 +72,8 @@ describe('UploadComponent', () => { { provide: StartupService, useValue: { getReferentialUrl: () => '' } }, DecimalPipe, BytesPipe, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts index 05ea3ea390a..4805f53a4dd 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts @@ -50,6 +50,8 @@ describe('IngestReferentialService', () => { imports: [], providers: [ IngestReferentialService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts index 32d705bcebd..5942a244990 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts @@ -77,6 +77,8 @@ describe('IngestPreviewComponent test:', () => { logbookOperationsReloaded: of([logbookOperation]), }, }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts index b1094f34c9f..b9d92086954 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts @@ -95,6 +95,8 @@ describe('FileTreeMetadataComponent', () => { FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: APP_BASE_HREF, useValue: '/' }, diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index a0ddcdb8cf3..54504878c8c 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -86,6 +86,8 @@ describe('AppComponent', () => { }, }, { provide: ENVIRONMENT, useValue: environment }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts index 77cc5c2f3f4..247dbeff793 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts @@ -136,6 +136,8 @@ describe('AccessContractCreateComponent', () => { ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: AgencyService, useValue: agencyServiceSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts index 48b869681dd..598691379d6 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts @@ -98,6 +98,8 @@ describe('AccessContractNodesTabComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), AccessContractNodesTabComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: SearchUnitApiService, useValue: unitValueMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts index 0971481d286..a5ba6a23412 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts @@ -123,6 +123,8 @@ describe.skip('AccessContractNodeUpdateComponent', () => { providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: expectedCustomer, logo: null } }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index 476c239d135..fa76f0cf9e4 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -45,6 +45,8 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractComponent } from './access-contract.component'; import { EMPTY, of } from 'rxjs'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; @Component({ selector: 'app-access-contract-preview', @@ -91,6 +93,8 @@ describe('AccessContractComponent', () => { AccessContractPreviewStub, ], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ApplicationService, useValue: applicationServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts index e2f4161b3e6..6c1d2359cc9 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts @@ -57,6 +57,8 @@ import { import { environment } from '../../../environments/environment.prod'; import { AccessionRegistersService } from '../accession-register.service'; import { AccessionRegisterPreviewComponent } from './accession-register-preview.component'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('AccessionRegisterPreviewComponent', () => { let component: AccessionRegisterPreviewComponent; @@ -98,6 +100,8 @@ describe('AccessionRegisterPreviewComponent', () => { ], providers: [ { provide: AccessionRegistersService, useValue: AccessionRegistersServiceMock }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index 0cceb984356..bfece87cd96 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -40,7 +40,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute } from '@angular/router'; -import { TranslateLoader } from '@ngx-translate/core'; import { EMPTY, of } from 'rxjs'; import { AgencyService, AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -59,6 +58,8 @@ describe('AgencyListComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), VitamUICommonTestModule, MatProgressSpinnerModule], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ActivatedRoute, useValue: activatedRouteMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index c58e1a0cd93..158b2367441 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -102,6 +102,8 @@ describe('AgencyComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: window.location }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts index eb86525141e..ef9c096dc4b 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts @@ -41,6 +41,8 @@ import { BASE_URL, ExternalParameters, ExternalParametersService, LoggerModule, import { AuditPreviewComponent } from './audit-preview.component'; import { AuditService } from '../audit.service'; import { ActivatedRoute } from '@angular/router'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { @@ -65,6 +67,8 @@ describe('AuditPreviewComponent', () => { await TestBed.configureTestingModule({ providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, { provide: AuditService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts index 58121c3e6e8..33f3ca9e1c4 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts @@ -165,6 +165,8 @@ describe('ContextPermissionTabComponent', () => { ], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts index d7aedf608af..86671af16bc 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts @@ -45,6 +45,8 @@ describe('AgencyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts index b2e9a38c26c..8da844e3e26 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts @@ -46,6 +46,8 @@ describe('IngestContractApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts index 633afc24727..8e55a89c0aa 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts @@ -46,6 +46,8 @@ describe('OntologyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts index 593dbe0014a..4aacf7fc675 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts @@ -46,6 +46,8 @@ describe('OperationApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts index d7aedf608af..86671af16bc 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts @@ -45,6 +45,8 @@ describe('AgencyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts index 3e5aab1057e..835a21e17e6 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts @@ -102,6 +102,8 @@ describe('IngestContractCreateComponent', () => { imports: [IngestContractCreateComponent, VitamUICommonTestModule, LoggerModule.forRoot(), MatButtonToggleModule], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: {} }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts index ed87e6a6259..325e7f761cb 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts @@ -96,6 +96,8 @@ describe('IngestContractAttachmentTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [LoggerModule.forRoot(), IngestContractAttachmentTabComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: {} }, { provide: SearchUnitApiService, useValue: unitValueMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts index 4ae330f1d79..f9c52924574 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts @@ -92,6 +92,8 @@ describe.skip('IngestContractNodeUpdateComponent', () => { provide: MAT_DIALOG_DATA, useValue: { data: { ingestContract: 'IC-000001', accessContractId: 'AC-000001', tenantIdentifier: 1 } }, }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts index 7399c0d88d5..e67b2a54686 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts @@ -78,6 +78,8 @@ describe('LogbookManagementOperationPreviewComponent', () => { { provide: LogbookManagementOperationService, useValue: logbookManagementOperationServiceMock }, { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: {} }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index bb91fd3f5a3..8f42846de1a 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -47,6 +47,7 @@ import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperationDetailComponent } from './logbook-operation-detail.component'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { @@ -80,6 +81,8 @@ describe('LogbookOperationDetailComponent', () => { ], providers: [ { provide: LogbookService, useValue: {} }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: LogbookDownloadService, useValue: { logbookOperationsReloaded: of([{ id: 'event-01' }]) } }, { provide: AuthService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts index 3151e84a677..4bf4459d8f2 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts @@ -111,6 +111,8 @@ describe('ManagementContractCreateComponent', () => { { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: MatDialogRef, useValue: matDialogRefSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: confirmDialogServiceMock }, ManagementContractToFormGroupConverterService, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index 7141b24694f..a9f861915cf 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -91,6 +91,8 @@ describe('ManagementContractListComponent', () => { providers: [ { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: SearchService, useValue: searchServiceeMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts index f77dad4e394..52d659a7049 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts @@ -117,6 +117,8 @@ describe('ManagementContractInformationTabComponent', () => { ], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts index 1af7f308ada..8dc5683a08f 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts @@ -108,6 +108,8 @@ describe('ManagementContractStorageTabComponent', () => { ], providers: [ FormBuilder, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts index 058b4f42a53..368b503abdc 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts @@ -106,6 +106,8 @@ describe('GriffinListComponent', () => { await TestBed.configureTestingModule({ imports: [GriffinListComponent, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts index baa91827816..72b39c18a68 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts @@ -84,6 +84,8 @@ describe('PreservationScenarioListComponent', () => { await TestBed.configureTestingModule({ imports: [PreservationScenarioListComponent, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts index 7596d7d919c..61b96780f99 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts @@ -58,6 +58,8 @@ describe('PreservationComponent', () => { providers: [ provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index 5343582cbee..031a8ef75aa 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -166,6 +166,8 @@ describe('RuleComponent', () => { { provide: AuthService, useValue: authServiceMock }, { provide: ENVIRONMENT, useValue: environment }, { provide: SecurityService, useValue: securityServiceMock }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index a8c78a678a8..aa7734135db 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -109,6 +109,8 @@ describe('SecurisationCheckTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [SecurisationCheckTabComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: SecurisationService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts index 7632cc9fa01..49bb8fc5900 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts @@ -48,6 +48,8 @@ describe('ReferentialImportService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts index 51b68bf03e7..e9ce285f314 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts @@ -49,6 +49,8 @@ import { BASE_URL, ENVIRONMENT, WINDOW_LOCATION } from '../injection-tokens'; import type { Account } from '../models/account/account.interface'; import { AccountComponent } from './account.component'; import { AccountService } from './account.service'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; @Component({ selector: 'vitamui-common-account-information-tab', @@ -86,6 +88,8 @@ describe('AccountComponent', () => { { provide: BaseUserInfoApiService, useValue: userInfoApiServiceSpy }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, { provide: ENVIRONMENT, useValue: environment }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: location }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts index 654f8718d0b..26d2c1fc1cf 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts @@ -48,6 +48,8 @@ describe('AgencyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts index 6fc88c6b876..1bcd11ce968 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts @@ -54,6 +54,8 @@ describe('AnalyticsResolver', () => { providers: [ { provide: Router, useValue: {} }, { provide: WINDOW_LOCATION, useValue: {} }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: UserApiService, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts index 49d594bf5f1..f3e400cf10c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts @@ -49,6 +49,8 @@ describe('AccessContractApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts index 935e31d0e01..dc238cdc794 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts @@ -47,6 +47,8 @@ describe('SubrogationApiService', () => { TestBed.configureTestingModule({ imports: [], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: AuthService, useValue: {} }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts index 31cd9ac7353..4d0361832a0 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts @@ -48,6 +48,8 @@ describe('UserApiService', () => { imports: [], providers: [ { provide: AuthService, useValue: {} }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts index 9524806e97c..222b3ac3bb5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts @@ -75,6 +75,8 @@ describe('ApplicationService', () => { { provide: AuthService, useValue: authStubService }, { provide: LOCALE_ID, useValue: 'fr' }, { provide: StartupService, useValue: startupServiceStub }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfigService, useValue: configServiceStub }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts index 544441c4e47..7fde82580a5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts @@ -65,6 +65,8 @@ describe('ArchiveUnitViewerService', () => { DisplayObjectHelperService, DisplayRuleHelperService, SchemaElementToDisplayRuleService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SchemaService, useClass: MockSchemaService }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts index b1e02415522..36ec0342087 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts @@ -103,6 +103,8 @@ describe('ObjectViewerComponent', () => { LayoutService, FavoriteEntryService, DatePipe, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: DisplayObjectService, useClass: PathStrategyDisplayObjectService }, provideHttpClient(withInterceptorsFromDi()), diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts index 405a7678095..906628f2060 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts @@ -63,6 +63,8 @@ describe('FilingPlanService', () => { imports: [VitamUICommonModule, InjectorModule, LoggerModule.forRoot()], providers: [ FilingPlanService, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, { provide: AccessContractService, useValue: accessContractServiceMock }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts index 703d87db4f5..145402d246a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts @@ -113,8 +113,8 @@ describe('ReclassificationDialogComponent', () => { providers: [ provideHttpClient(), provideHttpClientTesting(), - { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: BASE_URL, useValue: '/fake-api' }, + { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: MAT_DIALOG_DATA, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts index 4588502d972..65c5428ca4a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts @@ -46,6 +46,8 @@ import { PagedResult } from '../../../app/modules/models/criteria/search-criteri import { BaseReclassificationDialogService } from './reclassification-dialog.service'; import { VitamTenantConfigService } from '../../../app/modules/vitam-tenant-config.service'; import { tenantConfigServiceMock } from '../../../../testing/src/tenant-config.service.mock'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; const fakeArchiveUnits = (count: number): ArchiveUnit[] => { return [...Array(count).keys()].map((n): ArchiveUnit => ({ '#id': `${n}`, '#unitups': [] })); @@ -72,6 +74,8 @@ describe('ReclassificationDialogService', () => { BaseReclassificationDialogService, { provide: ReclassificationService, useValue: reclassificationServiceSpy }, { provide: TranslateService, useValue: translateServiceSpy }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: VitamTenantConfigService, From 8dc07a1086b2b853ef7ae636008d1a40a94f16eb Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 27 Aug 2026 18:54:09 +0200 Subject: [PATCH 10/33] Story #16471: Clean code - WIP --- .../archive-preview/archive-preview.component.spec.ts | 4 +--- .../archive-unit-rules-details-tab.component.spec.ts | 4 +--- ...archive-unit-rules-informations-tab.component.spec.ts | 4 +--- .../dip-request-create.component.spec.ts | 4 +--- .../add-management-rules.component.spec.ts | 4 +--- .../add-update-property.component.spec.ts | 4 +--- .../archive-unit-rules.component.spec.ts | 4 +--- .../block-category-inheritance.component.spec.ts | 4 +--- .../block-rules-inheritance.component.spec.ts | 4 +--- .../delete-unit-rules.component.spec.ts | 4 +--- .../unlock-category-inheritance.component.spec.ts | 4 +--- .../unlock-rules-inheritance.component.spec.ts | 4 +--- .../update-unit-rules.component.spec.ts | 4 +--- .../management-rules/management-rules.component.spec.ts | 4 +--- .../transfer-request-modal.component.spec.ts | 4 +--- .../archive-search/archive-search.component.spec.ts | 4 +--- .../search-criteria-saver.service.spec.ts | 9 +-------- .../simple-criteria-search.component.spec.ts | 4 +--- .../transfer-acknowledgment.component.spec.ts | 4 +--- .../src/app/archive/archive.component.spec.ts | 4 +--- .../src/app/archive/archive.service.spec.ts | 4 +--- .../common-services/archive-facets.service.spec.ts | 4 +--- .../criteria-search/criteria-search.component.spec.ts | 4 +--- .../found-object-modal.component.spec.ts | 4 +--- .../persistent-identifier-search.component.spec.ts | 9 +-------- .../src/app/core/api/archive-api.service.spec.ts | 4 +--- .../add-units/add-units.component.spec.ts | 4 +--- .../archive-unit-rules-details-tab.component.spec.ts | 4 +--- ...archive-unit-rules-informations-tab.component.spec.ts | 4 +--- .../collect-object-group-details-tab.component.spec.ts | 4 +--- .../archive-search-collect.component.spec.ts | 4 +--- .../search-criteria-saver.service.spec.ts | 9 +-------- ...description-criteria-search-collect.component.spec.ts | 4 +--- .../update-units-metadata.component.spec.ts | 4 +--- .../src/app/collect/core/api/project-api.service.spec.ts | 4 +--- .../create-project/create-project.component.spec.ts | 4 +--- .../transaction-list/transaction-list.component.spec.ts | 4 +--- .../src/app/core/api/customer-api.service.spec.ts | 4 +--- .../identity/src/app/core/api/group-api.service.spec.ts | 9 +-------- .../identity/src/app/core/api/user-api.service.spec.ts | 9 +-------- .../identity/src/app/core/customer.service.spec.ts | 4 +--- .../customer-create/customer-create.component.spec.ts | 4 +--- .../customer/customer-list/customer-list.service.spec.ts | 4 +--- .../sso-tab/identity-provider.service.spec.ts | 4 +--- .../sso-tab/provider-api.service.spec.ts | 9 +-------- .../identity/src/app/customer/owner-api.service.spec.ts | 9 +-------- .../owner-preview/owner-preview.component.spec.ts | 4 +--- .../identity/src/app/customer/owner.service.spec.ts | 4 +--- .../identity/src/app/customer/tenant-api.service.spec.ts | 9 +-------- .../identity/src/app/customer/tenant.service.spec.ts | 4 +--- .../external-param-profile-detail.component.spec.ts | 4 +--- .../external-param-profile-service.service.spec.ts | 4 +--- .../units-edit/units-edit.component.spec.ts | 4 +--- .../profiles-edit/profiles-edit.component.spec.ts | 4 +--- .../identity/src/app/group/group.service.spec.ts | 5 +---- .../identity/src/app/hierarchy/hierarchy.service.spec.ts | 4 +--- .../identity/src/app/profile/profile.service.spec.ts | 5 +---- .../src/app/subrogation/customer-select.service.spec.ts | 4 +--- .../src/app/subrogation/subrogation.service.spec.ts | 4 +--- .../src/app/subrogation/user-generic-api.service.spec.ts | 9 +-------- .../ingest/src/app/core/api/ingest-api.service.spec.ts | 4 +--- .../ingest/src/app/core/common/upload.component.spec.ts | 4 +--- .../app/core/service/ingest-referential.service.spec.ts | 4 +--- .../ingest-preview/ingest-preview.component.spec.ts | 4 +--- .../file-tree-metadata.component.spec.ts | 4 +--- .../pastis-popup-option.component.spec.ts | 4 ++-- .../save-profile/save-profile.component.spec.ts | 4 ++-- .../projects/portal/src/app/app.component.spec.ts | 4 +--- .../access-contract-create.component.spec.ts | 4 +--- .../access-contract-list.component.spec.ts | 4 ++-- .../access-contract-nodes-tab.component.spec.ts | 4 +--- .../access-contract-node-update.component.spec.ts | 4 +--- .../app/agency/agency-list/agency-list.component.spec.ts | 4 +--- .../referential/src/app/agency/agency.component.spec.ts | 4 +--- .../referential/src/app/audit/audit.component.spec.ts | 4 ++++ .../context/context-list/context-list.component.spec.ts | 4 ++-- .../context-permission-tab.component.spec.ts | 4 +--- .../src/app/core/api/context-api.service.spec.ts | 4 +--- .../src/app/core/api/customer-api.service.spec.ts | 9 +-------- .../src/app/core/api/ingest-contract-api.service.spec.ts | 4 +--- .../api/logbook-management-operation-api.service.spec.ts | 9 +-------- .../core/api/management-contracts-api.service.spec.ts | 9 +-------- .../src/app/core/api/ontology-api.service.spec.ts | 4 +--- .../src/app/core/api/operation-api.service.spec.ts | 4 +--- .../app/core/api/security-profile-api.service.spec.ts | 4 +--- .../src/app/core/api/tenant-api.service.spec.ts | 9 +-------- .../file-format-list/file-format-list.component.spec.ts | 4 ++-- .../ingest-contract-create.component.spec.ts | 4 +--- .../ingest-contract-attachment-tab.component.spec.ts | 4 +--- .../ingest-contract-node-update.component.spec.ts | 4 +--- .../ingest-contract/ingest-contract.component.spec.ts | 4 ++-- ...ogbook-management-operation-preview.component.spec.ts | 4 +--- .../logbook-management-operation.component.spec.ts | 4 ++++ .../logbook-operation-detail.component.spec.ts | 3 +-- .../management-contract-create.component.spec.ts | 4 +--- .../management-contract-list.component.spec.ts | 4 +--- ...management-contract-information-tab.component.spec.ts | 4 +--- .../management-contract-storage-tab.component.spec.ts | 4 +--- .../ontology-list/ontology-list.component.spec.ts | 4 ++++ .../schema-list/schema-list.component.spec.ts | 4 ++++ .../griffin-list/griffin-list.component.spec.ts | 4 +--- .../preservation-scenario-list.component.spec.ts | 4 +--- .../src/app/preservation/preservation.component.spec.ts | 2 -- .../probative-value/probative-value.component.spec.ts | 4 ++++ .../src/app/rule/rule-list/rule-list.component.spec.ts | 4 ++++ .../referential/src/app/rule/rule.component.spec.ts | 4 +--- .../securisation-check-tab.component.spec.ts | 4 +--- .../security-profile-list.component.spec.ts | 4 ++++ .../import-dialog/referential-import-api.service.spec.ts | 4 +--- .../src/app/modules/account/account.service.spec.ts | 4 ++-- .../src/app/modules/agencies/agency-api.service.spec.ts | 4 +--- .../src/app/modules/analytics-resolver.service.spec.ts | 4 +--- .../app/modules/api/access-contract-api.service.spec.ts | 4 +--- .../src/app/modules/api/application-api.service.spec.ts | 9 +-------- .../src/app/modules/api/logbook-api.service.spec.ts | 9 +-------- .../src/app/modules/api/ontology-api.service.spec.ts | 9 +-------- .../src/app/modules/api/profile-api.service.spec.ts | 9 +-------- .../src/app/modules/api/security-api.service.spec.ts | 9 +-------- .../src/app/modules/api/site-api.service.spec.ts | 9 +-------- .../src/app/modules/api/subrogation-api.service.spec.ts | 4 +--- .../src/app/modules/api/user-api.service.spec.ts | 4 +--- .../src/app/modules/application.service.spec.ts | 4 +--- .../archive-unit-viewer.component.spec.ts | 9 +-------- .../archive-unit-viewer.service.spec.ts | 4 +--- .../object-viewer/object-viewer.component.spec.ts | 4 +--- .../src/app/modules/ontology/ontology.service.spec.ts | 5 +---- .../scenarios/preservation-scenarios-api.service.spec.ts | 2 +- .../src/app/modules/services/profile.service.spec.ts | 5 +---- .../subrogation-snack-bar.component.spec.ts | 4 ++-- .../app/modules/subrogation/subrogation.service.spec.ts | 4 ++-- .../components/filing-plan/filing-plan.service.spec.ts | 4 +--- 131 files changed, 160 insertions(+), 463 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index ce1dbc83be8..4d15d5a7bb5 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -115,7 +115,7 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, @@ -128,8 +128,6 @@ describe('ArchivePreviewComponent', () => { setTenantIdentifier: () => {}, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(ArchiveService, { useValue: archiveServiceMock }) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index ef711c79e9b..2e79d9cb1ed 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -73,14 +73,12 @@ describe('ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, ArchiveUnitRulesDetailsTabComponent], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, { provide: ArchiveService, useValue: archiveServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 26544bc019d..cb4707725f1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -129,12 +129,10 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { DateTimeStubPipe, ], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideI18n(), - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts index 695353fd2cb..0e2e8eda243 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts @@ -102,7 +102,7 @@ describe('DipRequestCreateComponent', () => { selectedItemCountKnown: true, }, }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, @@ -110,8 +110,6 @@ describe('DipRequestCreateComponent', () => { { provide: ConfirmDialogService, useValue: confirmDialogServiceMock }, { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: StartupService, useValue: startupServiceStub }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts index bf19d6508b0..0b0e25d6bb6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts @@ -210,8 +210,8 @@ describe('AddManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, AddManagementRulesComponent], providers: [ FormBuilder, - provideHttpClient(), provideHttpClientTesting(), + provideHttpClient(withInterceptorsFromDi()), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, @@ -220,8 +220,6 @@ describe('AddManagementRulesComponent', () => { { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: ManagementRulesValidatorService, useValue: managementRulesValidatorServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index 3e9a505cc33..c6f9a8665f6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -130,7 +130,7 @@ describe('AddUpdatePropertyComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, AddUpdatePropertyComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -138,8 +138,6 @@ describe('AddUpdatePropertyComponent', () => { { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index 41987265ad7..635bac0dee8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -200,7 +200,7 @@ describe('ArchiveUnitRulesComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ArchiveUnitRulesComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -210,8 +210,6 @@ describe('ArchiveUnitRulesComponent', () => { { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, { provide: TenantSelectionService, useValue: tenantSelectionServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index 6461335634e..849db0490c6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -129,7 +129,7 @@ describe('BlockCategoryInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockCategoryInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -137,8 +137,6 @@ describe('BlockCategoryInheritanceComponent', () => { { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index cd33766cfee..3063a1d11fd 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -151,7 +151,7 @@ describe('BlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockRulesInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -160,8 +160,6 @@ describe('BlockRulesInheritanceComponent', () => { { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: ManagementRulesValidatorService, useValue: managementRulesValidatorServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts index 9d5800a1253..06a8f56398f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts @@ -210,7 +210,7 @@ describe('DeleteUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, DeleteUnitRulesComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -220,8 +220,6 @@ describe('DeleteUnitRulesComponent', () => { { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: ManagementRulesValidatorService, useValue: managementRulesValidatorServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index d88fc3a6e41..2adcb1a9a5b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -245,14 +245,12 @@ describe('UnlockCategoryInheritanceComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, UnlockCategoryInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(MatDialog, { useValue: matDialogSpy }) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts index 669199ced92..b8e3d6ae35e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts @@ -197,15 +197,13 @@ describe('UnlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UnlockRulesInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: ManagementRulesValidatorService, useValue: managementRulesValidatorServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts index fb0a5ad338b..47a427641b3 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts @@ -210,7 +210,7 @@ describe('UpdateUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UpdateUnitRulesComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -220,8 +220,6 @@ describe('UpdateUnitRulesComponent', () => { { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: ManagementRulesValidatorService, useValue: managementRulesValidatorServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index a6b03695676..a65334ecd7a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -144,7 +144,7 @@ describe('ManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ManagementRulesComponent], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: startupServiceStub }, @@ -154,8 +154,6 @@ describe('ManagementRulesComponent', () => { { provide: ArchiveService, useValue: archiveServiceMock }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts index a85eac68914..2a732f11c9c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts @@ -88,15 +88,13 @@ describe('TransferRequestModalComponent tests', () => { selectedItemCountKnown: true, }, }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: ConfirmDialogService, useValue: confirmDialogServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index be1858c0926..f67980cb0c8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -196,13 +196,11 @@ describe('ArchiveSearchComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(MatDialog, { useValue: matDialogSpy }) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts index e52b2f6e398..5487b8b8dc6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts @@ -49,14 +49,7 @@ describe('SearchCriteriaSaverService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); service = TestBed.inject(SearchCriteriaSaverService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts index a30d42e3ce4..eb3fccc66cf 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts @@ -100,7 +100,7 @@ describe('SimpleCriteriaSearchComponent', () => { { provide: MatDialog, useValue: matDialogSpy }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: SchemaService, useValue: schemaServiceMock }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, SnackBarService, @@ -110,8 +110,6 @@ describe('SimpleCriteriaSearchComponent', () => { queryParamMap: of(), }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index 3f01f164654..922db402a1a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -88,7 +88,7 @@ describe('TransferAcknowledgmentComponent', () => { await TestBed.configureTestingModule({ imports: [TransferAcknowledgmentComponent, CdkStep, InjectorModule, LoggerModule.forRoot(), MockDateTimePipe], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -99,8 +99,6 @@ describe('TransferAcknowledgmentComponent', () => { { provide: ArchiveService, useValue: archiveSearchServiceStub }, DecimalPipe, BytesPipe, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts index f94097bb2d0..17b1eddd016 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts @@ -123,12 +123,10 @@ describe('ArchiveComponent', () => { { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: SecurityService, useValue: securityServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(ActivatedRoute, { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts index 9bba7e9fe2d..95b4126bb97 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts @@ -54,11 +54,9 @@ describe('ArchiveService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, { provide: ArchiveApiService, useValue: archiveApiService }, ], }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts index 026334dbbf0..8ecdd114af7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts @@ -131,12 +131,10 @@ describe('ArchiveFacetsService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ArchiveFacetsService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts index 8f86faa63ad..0729b0783c4 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts @@ -71,12 +71,10 @@ describe('CriteriaSearchComponent', () => { providers: [ TranslateWithOptionalTypeSuffixPipe, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts index 197fe60bb2a..74cd1fdb9ec 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts @@ -74,7 +74,7 @@ describe('ErrorResponseModalComponent', () => { provide: MatDialogRef, useValue: matDialogRefSpy, }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { @@ -115,8 +115,6 @@ describe('ErrorResponseModalComponent', () => { }, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts index 81f7f360643..3da2e45c2e6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts @@ -50,14 +50,7 @@ describe('PersistentIdentifierSearchComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [MatDialogModule, RouterTestingModule, PersistentIdentifierSearchComponent], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts index 06218ab40be..518f9ce944a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts @@ -46,12 +46,10 @@ describe('ArchiveApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index 567b0083799..17a0a14c29c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -97,7 +97,7 @@ describe('AddUnitsComponent', () => { imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), AddUnitsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, @@ -108,8 +108,6 @@ describe('AddUnitsComponent', () => { { provide: ActivatedRoute, useValue: activatedRouteMock }, DecimalPipe, BytesPipe, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 934eb78a574..cae00573d7d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -51,13 +51,11 @@ describe('Collect ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, LoggerModule.forRoot(), ArchiveUnitRulesDetailsTabComponent], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index b17e6252730..f850964cf57 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -129,12 +129,10 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { DateTimeStubPipe, ], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, provideI18n(), - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts index 7682fce802d..287d7fdbb13 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts @@ -131,7 +131,7 @@ describe('CollectObjectGroupDetailsTabComponent', () => { CollectObjectGroupDetailsTabComponent, ], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, @@ -139,8 +139,6 @@ describe('CollectObjectGroupDetailsTabComponent', () => { { provide: ArchiveCollectService, useValue: archiveCollectServiceSpy }, { provide: Clipboard, useValue: clipboardSpy }, { provide: TenantSelectionService, useValue: tenantSelectionServiceSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index f7edafec571..05fb04646cf 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -172,13 +172,11 @@ describe('ArchiveSearchCollectComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(ConfigService, { useValue: { config$: of({ COLLECT: { OFFLINE_SERVICES: [] } }) } }) diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts index 89eb0a261c4..af69fbb2a0b 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts @@ -49,14 +49,7 @@ describe('SearchCriteriaSaverService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); service = TestBed.inject(SearchCriteriaSaverService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index fcd1399aedc..737a3794243 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -70,12 +70,10 @@ describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: matDialogSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index 180e28f277f..e03ff2ddeff 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -72,15 +72,13 @@ describe('UpdateUaMetadataComponent', () => { await TestBed.configureTestingModule({ imports: [UpdateUnitsMetadataComponent], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: { tenantIdentifier: '15', selectedTransaction } }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts index eb7b7ecd847..dd0477c60db 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts @@ -48,12 +48,10 @@ describe('ProjectService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts index 83196d4cedc..217fcdfd53c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts @@ -167,7 +167,7 @@ describe('CreateProjectComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, @@ -179,8 +179,6 @@ describe('CreateProjectComponent', () => { { provide: TenantSelectionService, useValue: tenantSelectionServiceMock }, { provide: TransactionsService, useValue: transactionServiceMock }, { provide: CollectUploadService, useValue: uploadServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index ef9694c3509..048dfd5e058 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -140,13 +140,11 @@ describe('TransactionListComponent', () => { }, }, }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts index 1726e85139c..92511fb0997 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts @@ -46,12 +46,10 @@ describe('CustomerApiService Identity', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts index 98f73f07a7c..fcdba42fbce 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts @@ -45,14 +45,7 @@ describe('GroupApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts index 733f6f5c2c3..f787e76224f 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts @@ -45,14 +45,7 @@ describe('UserApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts index 896aa15d134..9c02c1a5138 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts @@ -101,13 +101,11 @@ describe('CustomerService', () => { imports: [LoggerModule.forRoot()], providers: [ CustomerService, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index 96cf08cf3eb..9a9dcbf7358 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -272,7 +272,7 @@ describe('CustomerCreateComponent', () => { { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: { getConfigNumberValue: () => 100 } }, @@ -285,8 +285,6 @@ describe('CustomerCreateComponent', () => { { provide: TenantFormValidators, useValue: tenantFormValidatorsSpy }, { provide: CountryService, useValue: { getAvailableCountries: () => EMPTY } }, { provide: MatDialog, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideComponent(CustomerCreateComponent, { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts index 756d0756c72..1b2db967ae7 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts @@ -302,12 +302,10 @@ describe('CustomerListService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts index df85d83ae07..eca6657f8ab 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts @@ -98,13 +98,11 @@ describe('IdentityProviderService', () => { providers: [ IdentityProviderService, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts index 347e21a7fee..8dee4a8e75d 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts @@ -45,14 +45,7 @@ describe('ProviderApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts index 1666b9a1139..fd99fc9ad58 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts @@ -45,14 +45,7 @@ describe('OwnerApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 1d2ca41106c..2458f9241bf 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -76,13 +76,11 @@ describe('OwnerPreviewComponent', () => { ], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index 73d87a04ec5..4dcc05362e1 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -70,11 +70,9 @@ describe('OwnerService', () => { providers: [ OwnerService, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts index c4a9a79eff4..e82bbc1108d 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts @@ -45,14 +45,7 @@ describe('TenantApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts index cb4d1ce4b19..d5d979adaf6 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts @@ -132,12 +132,10 @@ describe('TenantService', () => { imports: [], providers: [ TenantService, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index df8e681efc8..da167a01751 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -68,12 +68,10 @@ describe('ExternalParamProfilDetailComponent', () => { { provide: ExternalParamProfileService, useValue: { updated: new Subject(), getAllActiveAccessContracts: of() } }, { provide: AuthService, useValue: authServiceMock }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideComponent(ExternalParamProfileDetailComponent, { diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts index 47bc241ddb5..1c0c46113f9 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts @@ -51,11 +51,9 @@ describe('ExternalParamProfileService', () => { providers: [ ExternalParamProfileService, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); service = TestBed.inject(ExternalParamProfileService); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts index 142ed02c481..0e18623d020 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts @@ -83,12 +83,10 @@ describe('UnitsEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', units: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts index 1f4cf84bc8a..719d31a4cce 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts @@ -88,12 +88,10 @@ describe('ProfilesEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', profileIds: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts index 1fd1a71a000..78f25381e71 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts @@ -57,12 +57,9 @@ describe('GroupService', () => { providers: [ GroupService, { provide: SnackBarService, useValue: snackBarSpy }, - { - provide: BASE_URL, - useValue: '/fake-api', - }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts index 85ef0930e0c..22895d38569 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts @@ -53,11 +53,9 @@ describe('HierarchyService', () => { providers: [ HierarchyService, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); }); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts index 94c0e3236ec..78989476b56 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts @@ -56,12 +56,9 @@ describe('ProfileService', () => { providers: [ ProfileService, { provide: SnackBarService, useValue: snackBarSpy }, - { - provide: BASE_URL, - useValue: '/fake-api', - }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts index c74f1780a18..0ef1159f92e 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts @@ -56,12 +56,10 @@ describe('CustomerSelectService', () => { providers: [ CustomerSelectService, { provide: AuthService, useValue: authStubService }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts index 28617532e92..9dadce6ce5a 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts @@ -47,13 +47,11 @@ describe('SubrogationService', () => { imports: [], providers: [ SubrogationService, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: SubrogationApiService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); }); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts index 7928c5ea497..10f536873b6 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts @@ -45,14 +45,7 @@ describe('UserGenericApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts index c2bf1a5f350..050f6997960 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts @@ -47,12 +47,10 @@ describe('IngestApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts index ad2e0601cd8..02628302770 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts @@ -72,11 +72,9 @@ describe('UploadComponent', () => { { provide: StartupService, useValue: { getReferentialUrl: () => '' } }, DecimalPipe, BytesPipe, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }) .overrideTemplate(UploadComponent, '
') diff --git a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts index 4805f53a4dd..62c26b95843 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts @@ -50,11 +50,9 @@ describe('IngestReferentialService', () => { imports: [], providers: [ IngestReferentialService, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts index 5942a244990..57bac23ca38 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts @@ -77,11 +77,9 @@ describe('IngestPreviewComponent test:', () => { logbookOperationsReloaded: of([logbookOperation]), }, }, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts index b9d92086954..d37dbf98ad4 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts @@ -95,13 +95,11 @@ describe('FileTreeMetadataComponent', () => { FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: APP_BASE_HREF, useValue: '/' }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideTemplate(FileTreeMetadataComponent, '
') diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts index f278497d3f2..1f024c70d12 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts @@ -59,10 +59,10 @@ describe('PastisPopupOptionComponent', () => { imports: [RouterTestingModule, PastisPopupOptionComponent], providers: [ PastisConfiguration, - { provide: BASE_URL, useValue: '/pastis-api' }, - { provide: MatDialog, useValue: matDialogSpy }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/pastis-api' }, + { provide: MatDialog, useValue: matDialogSpy }, { provide: SnackBarService, useValue: {} }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts index 188279d6d31..1187676b88d 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts @@ -114,12 +114,12 @@ describe('UserActionOpenProfileComponent', () => { ProfileService, FileTreeMetadataService, PastisConfiguration, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/pastis-api' }, { provide: MatDialog, useValue: matDialogSpy }, { provide: StartupService, useValue: startUpServiceMock }, { provide: PopupService, useValue: popupServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index 54504878c8c..347256d5da7 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -86,12 +86,10 @@ describe('AppComponent', () => { }, }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideTemplate(AppComponent, '
') diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts index 247dbeff793..96d5df7dfa5 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts @@ -136,7 +136,7 @@ describe('AccessContractCreateComponent', () => { ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MAT_DIALOG_DATA, useValue: {} }, @@ -145,8 +145,6 @@ describe('AccessContractCreateComponent', () => { { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: AccessContractCreateValidators, useValue: accessContractCreateValidatorsSpy }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts index b36721a8ea6..58bb69b7e91 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts @@ -62,11 +62,11 @@ describe('AccessContractListComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [VitamUICommonTestModule, MatProgressSpinnerModule, AccessContractListComponent], providers: [ + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts index 598691379d6..53a7656ec53 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts @@ -98,14 +98,12 @@ describe('AccessContractNodesTabComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), AccessContractNodesTabComponent], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: SearchUnitApiService, useValue: unitValueMock }, { provide: MatDialog, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts index a5ba6a23412..7b2fd626e52 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts @@ -123,14 +123,12 @@ describe.skip('AccessContractNodeUpdateComponent', () => { providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: expectedCustomer, logo: null } }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, { provide: AccessContractService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index bfece87cd96..00874406d6c 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -58,15 +58,13 @@ describe('AgencyListComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), VitamUICommonTestModule, MatProgressSpinnerModule], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: AuthService, useValue: authServiceMock }, { provide: MatDialog, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index 158b2367441..dd1d9f096b4 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -102,11 +102,9 @@ describe('AgencyComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts index 534c1cf323a..6ce3d36eda6 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts @@ -50,6 +50,8 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AuditComponent } from './audit.component'; import { DatePipe } from '@angular/common'; import { provideNativeDateAdapter } from '@angular/material/core'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('AuditComponent', () => { let component: AuditComponent; @@ -84,6 +86,8 @@ describe('AuditComponent', () => { ], providers: [ provideNativeDateAdapter(), + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/pastis-api' }, DatePipe, FormBuilder, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts index 2e6120f9fae..8b865a84f17 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts @@ -83,14 +83,14 @@ describe('ContextListComponent', () => { ContextListComponent, ], providers: [ + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: ContextService, useValue: contextServiceMock }, { provide: AuthService, useValue: authServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts index 33f3ca9e1c4..61c9bac72fd 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts @@ -165,15 +165,13 @@ describe('ContextPermissionTabComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: ContextService, useValue: { updated: EMPTY } }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts index 86671af16bc..3157b914c1d 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts @@ -45,12 +45,10 @@ describe('AgencyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts index d11ae75bd13..f17a08b7379 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts @@ -46,14 +46,7 @@ describe('CustomerApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - { - provide: BASE_URL, - useValue: '', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts index 8da844e3e26..ce883d768d0 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts @@ -46,12 +46,10 @@ describe('IngestContractApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts index b4aebb8669c..f7b5adb6c16 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts @@ -44,14 +44,7 @@ describe('LogbookManagementOperationApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - { - provide: BASE_URL, - useValue: '', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts index af5a18e1f5b..67562573082 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts @@ -74,14 +74,7 @@ describe('ManagementContractsApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - { - provide: BASE_URL, - useValue: '', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts index 8e55a89c0aa..c59e3918230 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts @@ -46,12 +46,10 @@ describe('OntologyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts index 4aacf7fc675..db669c3bea0 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts @@ -46,12 +46,10 @@ describe('OperationApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts index 86671af16bc..3157b914c1d 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts @@ -45,12 +45,10 @@ describe('AgencyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts index eeac08a5d50..8ff1a3e4c62 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts @@ -45,14 +45,7 @@ describe('TenantApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts index 3331f3cd885..280c5319684 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts @@ -52,14 +52,14 @@ describe('FileFormatListComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [FileFormatListComponent], providers: [ + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, FileFormatService, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, { provide: SnackBarService, useValue: {} }, { provide: MatDialog, useValue: {} }, { provide: StartupService, useValue: { getConfigStringValue: (_param: string) => '' } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts index 835a21e17e6..57322563581 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts @@ -102,7 +102,7 @@ describe('IngestContractCreateComponent', () => { imports: [IngestContractCreateComponent, VitamUICommonTestModule, LoggerModule.forRoot(), MatButtonToggleModule], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: {} }, @@ -115,8 +115,6 @@ describe('IngestContractCreateComponent', () => { { provide: ArchiveProfileApiService, useValue: archiveProfileApiServiceMock }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: AccessContractService, useValue: accessContractServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts index 325e7f761cb..5a69a8f1c07 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts @@ -96,14 +96,12 @@ describe('IngestContractAttachmentTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [LoggerModule.forRoot(), IngestContractAttachmentTabComponent], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: {} }, { provide: SearchUnitApiService, useValue: unitValueMock }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts index f9c52924574..d9559483cc5 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts @@ -92,13 +92,11 @@ describe.skip('IngestContractNodeUpdateComponent', () => { provide: MAT_DIALOG_DATA, useValue: { data: { ingestContract: 'IC-000001', accessContractId: 'AC-000001', tenantIdentifier: 1 } }, }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts index 9ebf73d915e..abf9472ff12 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts @@ -86,11 +86,11 @@ describe('IngestContractComponent', () => { { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: Router, useValue: {} }, { provide: MatDialog, useValue: {} }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: DownloadSnackBarService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(IngestContractService, { diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts index e67b2a54686..3e4f4e02616 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts @@ -78,11 +78,9 @@ describe('LogbookManagementOperationPreviewComponent', () => { { provide: LogbookManagementOperationService, useValue: logbookManagementOperationServiceMock }, { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts index 2678593314a..f40315b0b77 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts @@ -43,6 +43,8 @@ import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, VitamUICommonModul import { LogbookManagementOperationComponent } from './logbook-management-operation.component'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { provideNativeDateAdapter } from '@angular/material/core'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('LogbookManagementOperationComponent', () => { let component: LogbookManagementOperationComponent; @@ -76,6 +78,8 @@ describe('LogbookManagementOperationComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: {} }, + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: ENVIRONMENT, useValue: '' }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index 8f42846de1a..8d6060ae754 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -81,14 +81,13 @@ describe('LogbookOperationDetailComponent', () => { ], providers: [ { provide: LogbookService, useValue: {} }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: LogbookDownloadService, useValue: { logbookOperationsReloaded: of([{ id: 'event-01' }]) } }, { provide: AuthService, useValue: {} }, { provide: ActivatedRoute, useValue: {} }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, - provideHttpClient(withInterceptorsFromDi()), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts index 4bf4459d8f2..0924a0c2143 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts @@ -111,13 +111,11 @@ describe('ManagementContractCreateComponent', () => { { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: MatDialogRef, useValue: matDialogRefSpy }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: confirmDialogServiceMock }, ManagementContractToFormGroupConverterService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); managementContractToFormGroupConverterService = TestBed.inject(ManagementContractToFormGroupConverterService); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index a9f861915cf..80e16645f20 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -91,13 +91,11 @@ describe('ManagementContractListComponent', () => { providers: [ { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: SearchService, useValue: searchServiceeMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts index 52d659a7049..764a276dd06 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts @@ -117,15 +117,13 @@ describe('ManagementContractInformationTabComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: MatDialog, useValue: matDialogSpy }, { provide: ManagementContractService, useValue: managementContractServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts index 8dc5683a08f..ca3d33e61f9 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts @@ -108,15 +108,13 @@ describe('ManagementContractStorageTabComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: MatDialog, useValue: matDialogSpy }, { provide: ManagementContractService, useValue: managementContractServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts index 4e0860d0eb1..285943e940b 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts @@ -42,6 +42,8 @@ import { EMPTY, of } from 'rxjs'; import { AuthService, BASE_URL, Ontology, TenantSelectionService } from 'vitamui-library'; import { OntologyListComponent } from './ontology-list.component'; import { OntologyService } from '../../ontology.service'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('OntologyListComponent', () => { let component: OntologyListComponent; @@ -64,6 +66,8 @@ describe('OntologyListComponent', () => { declarations: [], imports: [OntologyListComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: MatDialog, useValue: {} }, { provide: OntologyService, useValue: ontologyServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts index e2395e0908f..c8ed5d2ac06 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts @@ -41,6 +41,8 @@ import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; import { AuthService, BASE_URL, SchemaService, TenantSelectionService } from 'vitamui-library'; import { SchemaListComponent } from './schema-list.component'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('SchemaListComponent', () => { let component: SchemaListComponent; @@ -61,6 +63,8 @@ describe('SchemaListComponent', () => { declarations: [], imports: [SchemaListComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: MatDialog, useValue: {} }, { provide: SchemaService, useValue: schemaServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts index 368b503abdc..794e1a7e724 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts @@ -106,11 +106,9 @@ describe('GriffinListComponent', () => { await TestBed.configureTestingModule({ imports: [GriffinListComponent, LoggerModule.forRoot()], providers: [ - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, { provide: GriffinsService, useValue: griffinsService }, { provide: SnackBarService, useValue: snackBarService }, { provide: StartupService, useValue: startupService }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts index 72b39c18a68..d45e895af6c 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts @@ -84,11 +84,9 @@ describe('PreservationScenarioListComponent', () => { await TestBed.configureTestingModule({ imports: [PreservationScenarioListComponent, LoggerModule.forRoot()], providers: [ - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, { provide: PreservationScenariosService, useValue: preservationScenariosService }, { provide: SnackBarService, useValue: snackBarService }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts index 61b96780f99..7596d7d919c 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts @@ -58,8 +58,6 @@ describe('PreservationComponent', () => { providers: [ provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts index e3967a7d0ab..ff5eb2284fb 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts @@ -49,6 +49,8 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProbativeValueComponent } from './probative-value.component'; import { DatePipe } from '@angular/common'; import { provideNativeDateAdapter } from '@angular/material/core'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('ProbativeValueComponent', () => { let component: ProbativeValueComponent; @@ -74,6 +76,8 @@ describe('ProbativeValueComponent', () => { ], providers: [ provideNativeDateAdapter(), + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/pastis-api' }, DatePipe, FormBuilder, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts index 134a9e82b09..39df2a74fa2 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts @@ -40,6 +40,8 @@ import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; import { AuthService, BASE_URL, Rule, RuleService, SnackBarService } from 'vitamui-library'; import { RuleListComponent } from './rule-list.component'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('RuleListComponent', () => { let component: RuleListComponent; @@ -54,6 +56,8 @@ describe('RuleListComponent', () => { await TestBed.configureTestingModule({ imports: [RuleListComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: RuleService, useValue: ruleServiceMock }, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index 031a8ef75aa..c05da954e57 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -166,11 +166,9 @@ describe('RuleComponent', () => { { provide: AuthService, useValue: authServiceMock }, { provide: ENVIRONMENT, useValue: environment }, { provide: SecurityService, useValue: securityServiceMock }, - provideHttpClient(), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index aa7734135db..3ebaeb17d5a 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -109,7 +109,7 @@ describe('SecurisationCheckTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [SecurisationCheckTabComponent], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: AccessContractService, useValue: accessContractServiceMock }, @@ -121,8 +121,6 @@ describe('SecurisationCheckTabComponent', () => { }, }, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts index 538d628db9c..58cb325aa56 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts @@ -40,6 +40,8 @@ import { of } from 'rxjs'; import { AuthService, BASE_URL, SecurityProfile } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { SecurityProfileListComponent } from './security-profile-list.component'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; describe('SecurityProfileListComponent', () => { let component: SecurityProfileListComponent; @@ -54,6 +56,8 @@ describe('SecurityProfileListComponent', () => { await TestBed.configureTestingModule({ imports: [SecurityProfileListComponent], providers: [ + provideHttpClient(), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: SecurityProfileService, useValue: securityProfileServiceMock }, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts index 49bb8fc5900..b4515d875bf 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts @@ -48,12 +48,10 @@ describe('ReferentialImportService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts index ad64fb4da60..6757bb754ba 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts @@ -49,10 +49,10 @@ describe('AccountService', () => { imports: [], providers: [ AccountService, - { provide: BASE_URL, useValue: {} }, - { provide: SnackBarService, useValue: { instant: () => EMPTY } }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: {} }, + { provide: SnackBarService, useValue: { instant: () => EMPTY } }, ], }); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts index 26d2c1fc1cf..be249996ea5 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts @@ -48,12 +48,10 @@ describe('AgencyApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts index 1bcd11ce968..378d7b79d1d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts @@ -54,7 +54,7 @@ describe('AnalyticsResolver', () => { providers: [ { provide: Router, useValue: {} }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { @@ -65,8 +65,6 @@ describe('AnalyticsResolver', () => { }, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts index f3e400cf10c..3ec5c6d305a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts @@ -49,12 +49,10 @@ describe('AccessContractApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); service = TestBed.inject(AccessContractApiService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts index 7052f2af853..47b265d80a3 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts @@ -45,14 +45,7 @@ describe('ApplicationApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts index b1603e33bc6..ada0dc1ec17 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts @@ -45,14 +45,7 @@ describe('LogbookApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts index 26fc1c71ef1..9c70303e311 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts @@ -46,14 +46,7 @@ describe('OntologyApiService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }); service = TestBed.inject(OntologyApiService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts index cf58beab1b5..5ae8732a7e7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts @@ -45,14 +45,7 @@ describe('ProfileApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts index 5e62d46047a..5c07af8532b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts @@ -45,14 +45,7 @@ describe('SecurityApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts index 9364bf68fc1..2f0df1b054f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts @@ -47,14 +47,7 @@ describe(SiteApiService.name, () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }); service = TestBed.inject(SiteApiService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts index dc238cdc794..0568c08f471 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts @@ -47,13 +47,11 @@ describe('SubrogationApiService', () => { TestBed.configureTestingModule({ imports: [], providers: [ - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: AuthService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts index 4d0361832a0..c9a761ddcde 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts @@ -48,12 +48,10 @@ describe('UserApiService', () => { imports: [], providers: [ { provide: AuthService, useValue: {} }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts index 222b3ac3bb5..4b2fd940ced 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts @@ -75,12 +75,10 @@ describe('ApplicationService', () => { { provide: AuthService, useValue: authStubService }, { provide: LOCALE_ID, useValue: 'fr' }, { provide: StartupService, useValue: startupServiceStub }, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfigService, useValue: configServiceStub }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts index 02ba5a53989..4c89814bbbd 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts @@ -99,14 +99,7 @@ describe('ArchiveUnitViewerComponent', () => { await TestBed.configureTestingModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [ObjectViewerModule, ObjectEditorModule, ReactiveFormsModule, LoggerModule.forRoot(), ArchiveUnitViewerComponent], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts index 7fde82580a5..c09137c0f68 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts @@ -65,12 +65,10 @@ describe('ArchiveUnitViewerService', () => { DisplayObjectHelperService, DisplayRuleHelperService, SchemaElementToDisplayRuleService, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SchemaService, useClass: MockSchemaService }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); service = TestBed.inject(ArchiveUnitViewerService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts index 36ec0342087..3c9c672025d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts @@ -103,12 +103,10 @@ describe('ObjectViewerComponent', () => { LayoutService, FavoriteEntryService, DatePipe, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: DisplayObjectService, useClass: PathStrategyDisplayObjectService }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideComponent(ObjectViewerComponent, { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts index 8fc12422335..9e8ff56b58d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts @@ -48,12 +48,9 @@ describe('OntologyService', () => { imports: [], providers: [ OntologyService, - { - provide: BASE_URL, - useValue: '/fake-api', - }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); service = TestBed.inject(OntologyService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts index 88998d1db32..3c6a0ea04d8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts @@ -70,9 +70,9 @@ describe('PreservationScenariosApiService', () => { TestBed.configureTestingModule({ providers: [ PreservationScenariosApiService, - { provide: BASE_URL, useValue: baseUrl }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: baseUrl }, ], }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts index 12a8faacc71..21662cbf0ca 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts @@ -51,12 +51,9 @@ describe('ProfileService', () => { imports: [], providers: [ ProfileService, - { - provide: BASE_URL, - useValue: '/fake-api', - }, provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, ], }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts index 6ad5ee13ed4..09fbdab31cf 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts @@ -55,6 +55,8 @@ describe('SubrogationSnackBarComponent', () => { imports: [VitamUICommonTestModule, SubrogationSnackBarComponent], providers: [ { provide: MAT_SNACK_BAR_DATA, useValue: {} }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fakeapi' }, { provide: MatSnackBarRef, @@ -73,8 +75,6 @@ describe('SubrogationSnackBarComponent', () => { { provide: WINDOW_LOCATION, useValue: {} }, { provide: SubrogationApiService, useValue: {} }, { provide: SnackBarService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts index 86cfb85e5d1..f97c21062d1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts @@ -65,13 +65,13 @@ describe('SubrogationService', () => { url: 'subrogations/customers/customerId', }, }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: 'fake-api' }, { provide: SUBROGRATION_REFRESH_RATE_MS, useValue: 100 }, { provide: AuthService, useValue: {} }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts index 906628f2060..feed068b377 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts @@ -63,13 +63,11 @@ describe('FilingPlanService', () => { imports: [VitamUICommonModule, InjectorModule, LoggerModule.forRoot()], providers: [ FilingPlanService, - provideHttpClient(), + provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, { provide: AccessContractService, useValue: accessContractServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); From 5614cdf00a1fce6327ed4dd1cbf1fbf8ad77c631 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 27 Aug 2026 19:01:07 +0200 Subject: [PATCH 11/33] Story #16471: Clean code - WIP --- ui/ui-frontend/test.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/ui/ui-frontend/test.ts b/ui/ui-frontend/test.ts index 63ed833ce21..6c59f0cab37 100644 --- a/ui/ui-frontend/test.ts +++ b/ui/ui-frontend/test.ts @@ -37,17 +37,18 @@ /// -import {CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA} from '@angular/core'; -import {TestBed} from '@angular/core/testing'; +import { CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core'; +import { TestBed } from '@angular/core/testing'; import '@angular/compiler'; import '@analogjs/vitest-angular/setup-zone'; import 'zone.js/testing'; -import {provideAnimations} from '@angular/platform-browser/animations'; -import {provideNativeDateAdapter} from '@angular/material/core'; -import {provideRouter} from '@angular/router'; -import {BASE_URL, LoggerModule, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION} from 'vitamui-library'; -import {provideTranslateService, TranslatePipe} from '@ngx-translate/core'; - +import { provideAnimations } from '@angular/platform-browser/animations'; +import { provideNativeDateAdapter } from '@angular/material/core'; +import { provideRouter } from '@angular/router'; +import { BASE_URL, LoggerModule, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION } from 'vitamui-library'; +import { provideTranslateService, TranslatePipe } from '@ngx-translate/core'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const configureTestingModule = TestBed.configureTestingModule.bind(TestBed); TestBed.configureTestingModule = ((moduleDef: any) => @@ -57,6 +58,8 @@ TestBed.configureTestingModule = ((moduleDef: any) => schemas: [...(moduleDef?.schemas ?? []), CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], providers: [ provideTranslateService({ fallbackLang: 'fr' }), + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SUBROGRATION_REFRESH_RATE_MS, useValue: 10000 }, { provide: WINDOW_LOCATION, useValue: typeof location !== 'undefined' ? location : ({} as Location) }, From 549bbf4a37a7b75fbff97dcce394a0e036169394 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 27 Aug 2026 19:10:16 +0200 Subject: [PATCH 12/33] Story #16471: Clean code - WIP --- .../archive-preview/archive-preview.component.spec.ts | 4 ---- .../archive-unit-information-tab.component.spec.ts | 4 ---- .../archive-unit-rules-details-tab.component.spec.ts | 4 ---- ...hive-unit-rules-informations-tab.component.spec.ts | 9 +-------- .../dip-request-create.component.spec.ts | 4 ---- .../add-management-rules.component.spec.ts | 4 ---- .../add-update-property.component.spec.ts | 4 ---- .../archive-unit-rules.component.spec.ts | 4 ---- .../block-category-inheritance.component.spec.ts | 4 ---- .../block-rules-inheritance.component.spec.ts | 4 ---- .../delete-unit-rules.component.spec.ts | 4 ---- .../unlock-category-inheritance.component.spec.ts | 4 ---- .../unlock-rules-inheritance.component.spec.ts | 4 ---- .../update-unit-rules.component.spec.ts | 4 ---- .../management-rules.component.spec.ts | 4 ---- .../transfer-request-modal.component.spec.ts | 4 ---- .../archive-search/archive-search.component.spec.ts | 4 ---- .../search-criteria-list.service.spec.ts | 4 ---- .../simple-criteria-search.component.spec.ts | 4 ---- .../transfer-acknowledgment.component.spec.ts | 4 ---- .../src/app/archive/archive.component.spec.ts | 4 ---- .../src/app/archive/archive.service.spec.ts | 4 ---- .../common-services/archive-facets.service.spec.ts | 8 +------- .../criteria-search/criteria-search.component.spec.ts | 4 ---- .../leaves-tree/leaves-tree.component.spec.ts | 4 ---- .../found-object-modal.component.spec.ts | 4 ---- ...rged-persistent-identifier-modal.component.spec.ts | 4 ---- .../src/app/core/api/archive-api.service.spec.ts | 4 ---- .../add-units/add-units.component.spec.ts | 4 ---- .../archive-preview/archive-preview.component.spec.ts | 4 ---- .../archive-unit-rules-details-tab.component.spec.ts | 4 ---- ...hive-unit-rules-informations-tab.component.spec.ts | 9 +-------- ...collect-object-group-details-tab.component.spec.ts | 4 ---- .../archive-search-collect.component.spec.ts | 4 ---- .../leaves-tree/leaves-tree.component.spec.ts | 2 -- ...cription-criteria-search-collect.component.spec.ts | 4 ---- .../update-units-metadata.component.spec.ts | 4 ---- .../app/collect/core/api/project-api.service.spec.ts | 4 ---- .../create-project/create-project.component.spec.ts | 4 ---- .../project-preview/project-preview.component.spec.ts | 4 ---- .../transaction-list.component.spec.ts | 4 ---- .../src/app/core/api/customer-api.service.spec.ts | 4 ---- .../identity/src/app/core/customer.service.spec.ts | 5 +---- .../customer-create/customer-create.component.spec.ts | 4 ---- .../customer-list/customer-list.service.spec.ts | 5 +---- .../customer-preview.component.spec.ts | 4 ---- .../sso-tab/identity-provider.service.spec.ts | 5 +---- .../owner-preview/owner-preview.component.spec.ts | 4 ---- .../identity/src/app/customer/owner.service.spec.ts | 11 ++--------- .../identity/src/app/customer/tenant.service.spec.ts | 11 ++--------- .../external-param-profile-create.component.spec.ts | 4 ---- .../external-param-profile-detail.component.spec.ts | 4 ---- .../external-param-profile-service.service.spec.ts | 4 ---- .../units-edit/units-edit.component.spec.ts | 4 ---- .../profiles-edit/profiles-edit.component.spec.ts | 5 ----- .../identity/src/app/group/group.service.spec.ts | 11 ++--------- .../src/app/hierarchy/hierarchy.service.spec.ts | 11 +---------- .../identity/src/app/profile/profile.service.spec.ts | 11 ++--------- .../app/subrogation/customer-select.service.spec.ts | 5 +---- .../src/app/subrogation/subrogation.service.spec.ts | 4 ---- .../src/app/core/api/ingest-api.service.spec.ts | 5 ----- .../src/app/core/common/upload.component.spec.ts | 4 ---- .../core/service/ingest-referential.service.spec.ts | 10 ++-------- .../ingest-errors-details-tab.component.spec.ts | 4 ---- .../ingest-preview/ingest-preview.component.spec.ts | 5 ----- .../file-tree-metadata.component.spec.ts | 4 ---- .../pastis-popup-option.component.spec.ts | 4 ---- .../save-profile/save-profile.component.spec.ts | 4 ---- .../projects/portal/src/app/app.component.spec.ts | 4 ---- .../access-contract-create.component.spec.ts | 4 ---- .../access-contract-list.component.spec.ts | 5 ----- ...s-contract-authorizations-update.component.spec.ts | 4 ---- .../access-contract-nodes-tab.component.spec.ts | 5 ----- .../access-contract-node-update.component.spec.ts | 4 ---- .../access-contract/access-contract.component.spec.ts | 4 ---- .../accession-register-list.component.spec.ts | 4 ---- .../accession-register-preview.component.spec.ts | 4 ---- .../agency/agency-list/agency-list.component.spec.ts | 4 ---- .../src/app/agency/agency.component.spec.ts | 4 ---- .../audit-preview/audit-preview.component.spec.ts | 4 ---- .../referential/src/app/audit/audit.component.spec.ts | 4 ---- .../context-list/context-list.component.spec.ts | 4 ---- .../context-permission-tab.component.spec.ts | 4 ---- .../src/app/context/context.component.spec.ts | 5 ----- .../src/app/core/api/context-api.service.spec.ts | 4 ---- .../app/core/api/ingest-contract-api.service.spec.ts | 4 ---- .../src/app/core/api/ontology-api.service.spec.ts | 4 ---- .../src/app/core/api/operation-api.service.spec.ts | 5 +---- .../app/core/api/security-profile-api.service.spec.ts | 4 ---- .../file-format-list.component.spec.ts | 4 ---- .../ingest-contract-create.component.spec.ts | 5 ----- .../ingest-contract-attachment-tab.component.spec.ts | 4 ---- .../ingest-contract-node-update.component.spec.ts | 4 ---- .../ingest-contract/ingest-contract.component.spec.ts | 5 ----- ...ogbook-management-operation-list.component.spec.ts | 4 ---- ...ook-management-operation-preview.component.spec.ts | 4 ---- .../logbook-management-operation.component.spec.ts | 4 ---- .../logbook-operation-detail.component.spec.ts | 4 ---- .../logbook-operation/logbook-search.service.spec.ts | 8 +------- .../management-contract-create.component.spec.ts | 4 ---- .../management-contract-list.component.spec.ts | 4 ---- ...agement-contract-information-tab.component.spec.ts | 4 ---- .../management-contract-preview.component.spec.ts | 4 ---- .../management-contract-storage-tab.component.spec.ts | 4 ---- .../management-contract.component.spec.ts | 4 ---- .../ontology-list/ontology-list.component.spec.ts | 4 ---- .../schema-list/schema-list.component.spec.ts | 4 ---- .../griffin-list/griffin-list.component.spec.ts | 5 +---- .../preservation-scenario-list.component.spec.ts | 5 +---- .../app/preservation/preservation.component.spec.ts | 4 ---- .../probative-value/probative-value.component.spec.ts | 4 ---- .../app/rule/rule-list/rule-list.component.spec.ts | 4 ---- .../referential/src/app/rule/rule.component.spec.ts | 5 ----- .../securisation-check-tab.component.spec.ts | 4 ---- .../app/securisation/securisation.component.spec.ts | 4 ---- .../security-profile-list.component.spec.ts | 4 ---- .../referential-import-api.service.spec.ts | 5 +---- .../src/app/modules/account/account.component.spec.ts | 4 ---- .../src/app/modules/account/account.service.spec.ts | 10 +--------- .../app/modules/agencies/agency-api.service.spec.ts | 4 ---- .../app/modules/analytics-resolver.service.spec.ts | 4 ---- .../modules/api/access-contract-api.service.spec.ts | 4 ---- .../app/modules/api/subrogation-api.service.spec.ts | 4 ---- .../src/app/modules/api/user-api.service.spec.ts | 4 ---- .../vitamui-library/src/app/modules/app.guard.spec.ts | 4 ---- .../src/app/modules/application.service.spec.ts | 5 +---- .../archive-unit-viewer.service.spec.ts | 4 ---- .../editable-field/editable-field.component.spec.ts | 10 +--------- .../editable-level-input.component.spec.ts | 4 ---- .../level-input/level-input.component.spec.ts | 4 ---- .../components/snack-bar/snack-bar.component.spec.ts | 4 ---- .../object-viewer/object-viewer.component.spec.ts | 4 ---- .../src/app/modules/ontology/ontology.service.spec.ts | 8 +------- .../preservation-scenarios-api.service.spec.ts | 10 ++-------- .../src/app/modules/services/profile.service.spec.ts | 10 ++-------- .../subrogation-snack-bar.component.spec.ts | 4 ---- .../modules/subrogation/subrogation.service.spec.ts | 4 ---- .../filing-plan/filing-plan.service.spec.ts | 5 +---- .../reclassification-dialog.component.spec.ts | 4 ---- .../reclassification-dialog.service.spec.ts | 4 ---- 140 files changed, 32 insertions(+), 632 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index 4d15d5a7bb5..296f99132e8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -60,8 +60,6 @@ import { import { environment } from '../../../environments/environment.prod'; import { ArchiveService } from '../archive.service'; import { ArchivePreviewComponent } from './archive-preview.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ArchivePreviewComponent', () => { let component: ArchivePreviewComponent; @@ -115,8 +113,6 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts index 8b003c86808..dcd7e340bdb 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts @@ -68,8 +68,6 @@ import { } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveUnitInformationTabComponent } from './archive-unit-information-tab.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('ArchiveUnitInformationTabComponent', () => { let component: ArchiveUnitInformationTabComponent; @@ -145,8 +143,6 @@ describe('ArchiveUnitInformationTabComponent', () => { providers: [ FormBuilder, { provide: ArchiveService, useValue: archiveServiceMock }, - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 2e79d9cb1ed..3b02eb3448e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; @@ -42,7 +41,6 @@ import { of } from 'rxjs'; import { BASE_URL, InjectorModule, Unit, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ArchiveUnitRulesDetailsTabComponent', () => { let component: ArchiveUnitRulesDetailsTabComponent; @@ -73,8 +71,6 @@ describe('ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, ArchiveUnitRulesDetailsTabComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index cb4707725f1..968581153b0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -34,8 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Directive, Input, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -128,12 +126,7 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe, ], - providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - provideI18n(), - ], + providers: [{ provide: BASE_URL, useValue: '/fake-api' }, provideI18n()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts index 0e2e8eda243..9866e8eeb4c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; @@ -52,7 +51,6 @@ import { } from 'vitamui-library'; import { ArchiveApiService } from '../../../../core/api/archive-api.service'; import { DipRequestCreateComponent } from './dip-request-create.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('DipRequestCreateComponent', () => { let component: DipRequestCreateComponent; @@ -102,8 +100,6 @@ describe('DipRequestCreateComponent', () => { selectedItemCountKnown: true, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts index 0b0e25d6bb6..e852d1b2f82 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -57,7 +56,6 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { AddManagementRulesComponent } from './add-management-rules.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -210,8 +208,6 @@ describe('AddManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, AddManagementRulesComponent], providers: [ FormBuilder, - provideHttpClientTesting(), - provideHttpClient(withInterceptorsFromDi()), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index c6f9a8665f6..92f5e8fede4 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -45,7 +44,6 @@ import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { AddUpdatePropertyComponent } from './add-update-property.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -130,8 +128,6 @@ describe('AddUpdatePropertyComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, AddUpdatePropertyComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index 635bac0dee8..f258bdd70d7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -55,7 +54,6 @@ import { UpdateUnitManagementRuleService } from '../../../../common-services/upd import { RuleTypeEnum } from '../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../models/ruleAction.interface'; import { ArchiveUnitRulesComponent } from './archive-unit-rules.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -200,8 +198,6 @@ describe('ArchiveUnitRulesComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ArchiveUnitRulesComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index 849db0490c6..016de90ed4a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -46,7 +45,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { BlockCategoryInheritanceComponent } from './block-category-inheritance.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -129,8 +127,6 @@ describe('BlockCategoryInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockCategoryInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index 3063a1d11fd..a49e74c77d9 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -46,7 +45,6 @@ import { BASE_URL, InjectorModule, LoggerModule, Rule, WINDOW_LOCATION } from 'v import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { BlockRulesInheritanceComponent } from './block-rules-inheritance.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -151,8 +149,6 @@ describe('BlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockRulesInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts index 06a8f56398f..f4293dc2c07 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -57,7 +56,6 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { DeleteUnitRulesComponent } from './delete-unit-rules.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -210,8 +208,6 @@ describe('DeleteUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, DeleteUnitRulesComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index 2adcb1a9a5b..cf692b8d5cc 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; @@ -47,7 +46,6 @@ import { UpdateUnitManagementRuleService } from '../../../../../common-services/ import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { UnlockCategoryInheritanceComponent } from './unlock-category-inheritance.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -245,8 +243,6 @@ describe('UnlockCategoryInheritanceComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, UnlockCategoryInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts index b8e3d6ae35e..1a7ba6970c8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; @@ -56,7 +55,6 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { UnlockRulesInheritanceComponent } from './unlock-rules-inheritance.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -197,8 +195,6 @@ describe('UnlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UnlockRulesInheritanceComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts index 47a427641b3..1b0fc024024 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -57,7 +56,6 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { UpdateUnitRulesComponent } from './update-unit-rules.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const accessContract = 'AccessContract'; @@ -210,8 +208,6 @@ describe('UpdateUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UpdateUnitRulesComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index a65334ecd7a..322e45d480e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -46,7 +45,6 @@ import { ManagementRulesSharedDataService } from '../../../../core/management-ru import { ArchiveService } from '../../../archive.service'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../models/ruleAction.interface'; import { ManagementRulesComponent } from './management-rules.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const ruleActions: ActionsRules[] = [ { @@ -144,8 +142,6 @@ describe('ManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ManagementRulesComponent], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: startupServiceStub }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts index 2a732f11c9c..455a07f8764 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; @@ -44,7 +43,6 @@ import { of } from 'rxjs'; import { BASE_URL, ConfirmDialogService, InjectorModule, LoggerModule, UsageVersionEnum, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveApiService } from '../../../../core/api/archive-api.service'; import { TransferRequestModalComponent } from './transfer-request-modal.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('TransferRequestModalComponent tests', () => { let component: TransferRequestModalComponent; @@ -88,8 +86,6 @@ describe('TransferRequestModalComponent tests', () => { selectedItemCountKnown: true, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index f67980cb0c8..ad64187a9c6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -36,7 +36,6 @@ import type { Mock } from 'vitest'; * knowledge of the CeCILL-C license and that you accept its terms. */ import { Location } from '@angular/common'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; @@ -74,7 +73,6 @@ import { UpdateUnitManagementRuleService } from '../common-services/update-unit- import { ArchiveSearchComponent } from './archive-search.component'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment/transfer-acknowledgment.component'; import { SimpleCriteriaSearchComponent } from './simple-criteria-search/simple-criteria-search.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NodeData } from '../models/nodedata.interface'; const arrayWithExactContents = (arr: T[]) => expect.arrayContaining(arr as any); @@ -196,8 +194,6 @@ describe('ArchiveSearchComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts index ec353a4cb42..a220c89582c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts @@ -34,14 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { InjectorModule } from 'vitamui-library'; import { ArchiveApiService } from '../../../core/api/archive-api.service'; import { SearchCriteriaListService } from './search-criteria-list.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SearchCriteriaListService', () => { let service: SearchCriteriaListService; @@ -77,8 +75,6 @@ describe('SearchCriteriaListService', () => { provide: ArchiveApiService, useValue: archiveApiServiceMock, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); service = TestBed.inject(SearchCriteriaListService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts index eb3fccc66cf..6975bc3de09 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; @@ -55,7 +54,6 @@ import { ManagementRulesSharedDataService } from '../../../core/management-rules import { SimpleCriteriaSearchComponent } from './simple-criteria-search.component'; import { ArchiveService } from '../../archive.service'; import { ActivatedRoute } from '@angular/router'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SimpleCriteriaSearchComponent', () => { let component: SimpleCriteriaSearchComponent; @@ -100,8 +98,6 @@ describe('SimpleCriteriaSearchComponent', () => { { provide: MatDialog, useValue: matDialogSpy }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: SchemaService, useValue: schemaServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, SnackBarService, { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index 922db402a1a..c3037d66fec 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -43,7 +42,6 @@ import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, StartupService, WIND import { ArchiveService } from '../../archive.service'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment.component'; import { DecimalPipe } from '@angular/common'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { CdkStep } from '@angular/cdk/stepper'; @Pipe({ name: 'dateTime' }) @@ -88,8 +86,6 @@ describe('TransferAcknowledgmentComponent', () => { await TestBed.configureTestingModule({ imports: [TransferAcknowledgmentComponent, CdkStep, InjectorModule, LoggerModule.forRoot(), MockDateTimePipe], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts index 17b1eddd016..dd7e1149f9f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; @@ -58,7 +57,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from '../../environments/environment'; import { ArchiveApiService } from '../core/api/archive-api.service'; import { ArchiveComponent } from './archive.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ArchiveComponent', () => { let component: ArchiveComponent; @@ -123,8 +121,6 @@ describe('ArchiveComponent', () => { { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: SecurityService, useValue: securityServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts index 95b4126bb97..de2cd1cd82b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts @@ -37,8 +37,6 @@ import { TestBed } from '@angular/core/testing'; import { ArchiveService } from './archive.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { BASE_URL, LoggerModule, Unit } from 'vitamui-library'; import { ArchiveApiService } from '../core/api/archive-api.service'; import { vi } from 'vitest'; @@ -54,8 +52,6 @@ describe('ArchiveService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ArchiveApiService, useValue: archiveApiService }, ], diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts index 8ecdd114af7..687bef28d60 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, LoggerModule, ResultFacet, ResultFacetList } from 'vitamui-library'; import { ArchiveFacetsService } from './archive-facets.service'; @@ -130,12 +129,7 @@ describe('ArchiveFacetsService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ArchiveFacetsService, - ], + providers: [provideHttpClient(withInterceptorsFromDi()), { provide: BASE_URL, useValue: '/fake-api' }, ArchiveFacetsService], }); archiveFacetsService = TestBed.inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts index 0729b0783c4..f50c5684070 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -50,7 +49,6 @@ import { } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { CriteriaSearchComponent } from './criteria-search.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('CriteriaSearchComponent', () => { let component: CriteriaSearchComponent; @@ -71,8 +69,6 @@ describe('CriteriaSearchComponent', () => { providers: [ TranslateWithOptionalTypeSuffixPipe, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts index 1683e074424..9d22b4d5e54 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatMenuModule } from '@angular/material/menu'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @@ -56,7 +55,6 @@ import { ArchiveSharedDataService } from '../../../core/archive-shared-data.serv import { ArchiveService } from '../../archive.service'; import { ArchiveFacetsService } from '../../common-services/archive-facets.service'; import { LeavesTreeComponent } from './leaves-tree.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; export function newNode( currentId: string, @@ -127,8 +125,6 @@ describe('LeavesTreeComponent', () => { { provide: ArchiveSharedDataService, useValue: archiveSharedDataServiceStub }, { provide: ArchiveFacetsService, useValue: archiveFacetsServicStube }, { provide: ConfigurationsApiService, useValue: configurationsApiServiceStube }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts index 74cd1fdb9ec..3956fdd2bc9 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts @@ -34,8 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; @@ -74,8 +72,6 @@ describe('ErrorResponseModalComponent', () => { provide: MatDialogRef, useValue: matDialogRefSpy, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MAT_DIALOG_DATA, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts index 63f0f33dac3..00cf09dca07 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/purged-persistent-identifier-modal/purged-persistent-identifier-modal.component.spec.ts @@ -34,8 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { TranslateLoader } from '@ngx-translate/core'; @@ -93,8 +91,6 @@ describe('ErrorResponseModalComponent', () => { }, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); fixture = TestBed.createComponent(PurgedPersistentIdentifierModalComponent); diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts index 518f9ce944a..fa9e64ef372 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts @@ -34,20 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { ArchiveApiService } from './archive-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ArchiveApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index 17a0a14c29c..576c160e0a6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -45,7 +44,6 @@ import { AddUnitsComponent } from './add-units.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DecimalPipe } from '@angular/common'; import { ArchiveCollectService } from '../archive-collect.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { ActivatedRoute } from '@angular/router'; const selectedTransaction: Transaction = { @@ -97,8 +95,6 @@ describe('AddUnitsComponent', () => { imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), AddUnitsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts index 7bc9dde1f2e..b167825dc7f 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts @@ -60,8 +60,6 @@ import { import { environment } from '../../../../environments/environment'; import { ArchiveCollectService } from '../archive-collect.service'; import { ArchivePreviewComponent } from './archive-preview.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('ArchivePreviewComponent', () => { let component: ArchivePreviewComponent; @@ -105,8 +103,6 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index cae00573d7d..7b3ec130991 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -34,13 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('Collect ArchiveUnitRulesDetailsTabComponent', () => { let component: ArchiveUnitRulesDetailsTabComponent; @@ -51,8 +49,6 @@ describe('Collect ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, LoggerModule.forRoot(), ArchiveUnitRulesDetailsTabComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index f850964cf57..817a9283c49 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -34,8 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Directive, Input, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -128,12 +126,7 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe, ], - providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - provideI18n(), - ], + providers: [{ provide: BASE_URL, useValue: '/fake-api' }, provideI18n()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts index 287d7fdbb13..7c1562153a6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts @@ -36,7 +36,6 @@ */ import { vi } from 'vitest'; import { Clipboard } from '@angular/cdk/clipboard'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; @@ -60,7 +59,6 @@ import { } from 'vitamui-library'; import { ArchiveCollectService } from '../../archive-collect.service'; import { CollectObjectGroupDetailsTabComponent } from './collect-object-group-details-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const createSpyObj = (name: string, methods: string[]): any => Object.fromEntries(methods.map((m) => [m, vi.fn()])); @@ -131,8 +129,6 @@ describe('CollectObjectGroupDetailsTabComponent', () => { CollectObjectGroupDetailsTabComponent, ], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index 05fb04646cf..807f614e662 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Location } from '@angular/common'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; @@ -72,7 +71,6 @@ import { ArchiveCollectService } from './archive-collect.service'; import { SimpleCriteriaSearchComponent } from './archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { MatMenuModule } from '@angular/material/menu'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NodeData } from '../../../../../archive-search/src/app/archive/models/nodedata.interface'; const arrayWithExactContents = (arr: T[]) => expect.arrayContaining(arr as any); @@ -172,8 +170,6 @@ describe('ArchiveSearchCollectComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts index ab2c21da5e7..ae9ba07923f 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts @@ -51,7 +51,6 @@ import { ArchiveCollectService } from '../../../../archive-collect.service'; import { ArchiveFacetsService } from '../../../services/archive-facets.service'; import { ArchiveSharedDataService } from '../../../../../core/archive-shared-data.service'; import { LeavesTreeComponent } from './leaves-tree.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; export function newNode( currentId: string, @@ -113,7 +112,6 @@ describe('LeavesTreeComponent', () => { { provide: ArchiveSharedDataService, useValue: archiveSharedDataServiceStub }, { provide: ArchiveFacetsService, useValue: archiveFacetsServicStube }, { provide: ConfigurationsApiService, useValue: configurationsApiServiceStube }, - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index 737a3794243..481a68358e3 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; @@ -44,7 +43,6 @@ import { BASE_URL, InjectorModule, LoggerModule } from 'vitamui-library'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TitleAndDescriptionCriteriaSearchCollectComponent } from './title-and-description-criteria-search-collect.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { const matDialogRefSpy = { @@ -70,8 +68,6 @@ describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: matDialogSpy }, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index e03ff2ddeff..d4b3784d433 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -34,12 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { BASE_URL, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { UpdateUnitsMetadataComponent } from './update-units-metadata.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const selectedTransaction: Transaction = { id: 'transactionId', @@ -72,8 +70,6 @@ describe('UpdateUaMetadataComponent', () => { await TestBed.configureTestingModule({ imports: [UpdateUnitsMetadataComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts index dd0477c60db..009e5778542 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts @@ -35,21 +35,17 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../../environments/environment'; import { ProjectsApiService } from './project-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ProjectService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts index 217fcdfd53c..284e2ef8115 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, fakeAsync, flush, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; @@ -62,7 +61,6 @@ import { CollectUploadService } from '../../shared/collect-upload/collect-upload import { ProjectsService } from '../projects.service'; import { TransactionsService } from '../transactions.service'; import { CreateProjectComponent } from './create-project.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Pipe({ name: 'fileSize' }) export class MockFileSizePipe implements PipeTransform { @@ -167,8 +165,6 @@ describe('CreateProjectComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts index 2da2698f564..88a3addc7ba 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts @@ -60,8 +60,6 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProjectsApiService } from '../../core/api/project-api.service'; import { ProjectPreviewComponent } from './project-preview.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('ProjectPreviewComponent', () => { let component: ProjectPreviewComponent; @@ -159,8 +157,6 @@ describe('ProjectPreviewComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index 048dfd5e058..a1d6c4e3a84 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -37,7 +37,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DatePipe } from '@angular/common'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; @@ -50,7 +49,6 @@ import { environment } from '../../../../../../archive-search/src/environments/e import { TransactionResolver } from '../transaction-resolver.service'; import { TransactionsService } from '../transactions.service'; import { TransactionListComponent } from './transaction-list.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('TransactionListComponent', () => { let component: TransactionListComponent; @@ -140,8 +138,6 @@ describe('TransactionListComponent', () => { }, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts index 92511fb0997..81935093e8a 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts @@ -34,20 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { CustomerApiService } from './customer-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('CustomerApiService Identity', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts index 9c02c1a5138..7c1d30959a5 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts @@ -37,12 +37,11 @@ import { BASE_URL, CriteriaSearchQuery, Customer, ENVIRONMENT, LoggerModule, Operators, OtpState, SnackBarService } from 'vitamui-library'; import { environment } from './../../environments/environment'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; import { CustomerService } from './customer.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedCustomer: Customer = { id: '42', @@ -101,8 +100,6 @@ describe('CustomerService', () => { imports: [LoggerModule.forRoot()], providers: [ CustomerService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: snackBarSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index 9a9dcbf7358..b9aec6409d1 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component, EventEmitter, forwardRef, Input, NO_ERRORS_SCHEMA, Output } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; @@ -55,7 +54,6 @@ import { TenantFormValidators } from '../tenant-create/tenant-form.validators'; import { TenantService } from '../tenant.service'; import { CustomerCreateComponent } from './customer-create.component'; import { CustomerCreateValidators } from './customer-create.validators'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-domains-input', @@ -272,8 +270,6 @@ describe('CustomerCreateComponent', () => { { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: { getConfigNumberValue: () => 100 } }, { provide: CustomerService, useValue: customerServiceSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts index 1b2db967ae7..29aedd94dc9 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, Customer, Direction, ENVIRONMENT, LoggerModule, OtpState, PageRequest } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { CustomerListService } from './customer-list.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedCustomersPage: { values: Customer[]; pageNum: number; pageSize: number; hasMore: boolean } = { values: [ @@ -302,8 +301,6 @@ describe('CustomerListService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts index 5c6775a43db..9b775e2a6cd 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/customer-preview.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component, Input, NO_ERRORS_SCHEMA, ViewChild } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { Subject } from 'rxjs'; @@ -47,7 +46,6 @@ import { InformationTabComponent } from './information-tab/information-tab.compo import { SsoTabComponent } from './sso-tab/sso-tab.component'; import { GraphicIdentityTabComponent } from './graphic-identity-tab/graphic-identity-tab.component'; import { HomepageMessageTabComponent } from './homepage-message-tab/homepage-message-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-information-tab', @@ -129,8 +127,6 @@ describe('CustomerPreviewComponent', () => { { provide: StartupService, useValue: startupServiceStub }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideComponent(CustomerPreviewComponent, { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts index eca6657f8ab..544c5325d4b 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { BASE_URL, @@ -50,7 +50,6 @@ import { environment } from './../../../../environments/environment'; import { Type } from '@angular/core'; import { IdentityProviderService } from './identity-provider.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('IdentityProviderService', () => { let httpTestingController: HttpTestingController; @@ -98,8 +97,6 @@ describe('IdentityProviderService', () => { providers: [ IdentityProviderService, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 2458f9241bf..882cf1ce8d2 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatMenuModule } from '@angular/material/menu'; @@ -46,7 +45,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../environments/environment'; import { OwnerPreviewComponent } from './owner-preview.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-information-tab', @@ -76,8 +74,6 @@ describe('OwnerPreviewComponent', () => { ], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index 4dcc05362e1..c07847c49ff 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; import { BASE_URL, Owner, SnackBarService } from 'vitamui-library'; import { OwnerService } from './owner.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedOwner: Owner = { id: '42', @@ -67,13 +66,7 @@ describe('OwnerService', () => { beforeEach(() => { TestBed.configureTestingModule({ - providers: [ - OwnerService, - { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [OwnerService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts index d5d979adaf6..d065c023d4b 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts @@ -36,13 +36,12 @@ */ import { BASE_URL, CriteriaSearchQuery, Operators, Owner, SnackBarService, Tenant } from 'vitamui-library'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { TenantService } from './tenant.service'; import { Type } from '@angular/core'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedTenant: Tenant = { id: '42', @@ -130,13 +129,7 @@ describe('TenantService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - TenantService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: SnackBarService, useValue: snackBarSpy }, - ], + providers: [TenantService, { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts index 16d4b4cb952..8451a6e1b4d 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-create/external-param-profile-create.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder, FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -50,7 +49,6 @@ import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileValidators } from '../external-param-profile.validators'; import { ExternalParamProfileCreateComponent } from './external-param-profile-create.component'; import { CommonModule, DecimalPipe } from '@angular/common'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ExternalParamProfileCreateComponent', () => { let component: ExternalParamProfileCreateComponent; @@ -103,8 +101,6 @@ describe('ExternalParamProfileCreateComponent', () => { }, { provide: ExternalParamProfileValidators, useValue: externalParamProfileValidators }, { provide: ExternalParamProfileService, useValue: externalParamProfileService }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideComponent(ExternalParamProfileCreateComponent, { diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index da167a01751..b231a01ef70 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of, Subject } from 'rxjs'; @@ -42,7 +41,6 @@ import { AuthService, BASE_URL, ExternalParamProfile, LoggerModule, WINDOW_LOCAT import { environment } from '../../../environments/environment.prod'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileDetailComponent } from './external-param-profile-detail.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { InformationTabComponent } from './information-tab/information-tab.component'; @Component({ @@ -68,8 +66,6 @@ describe('ExternalParamProfilDetailComponent', () => { { provide: ExternalParamProfileService, useValue: { updated: new Subject(), getAllActiveAccessContracts: of() } }, { provide: AuthService, useValue: authServiceMock }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts index 1c0c46113f9..03a7a197894 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts @@ -34,11 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, LoggerModule, SnackBarService } from 'vitamui-library'; import { ExternalParamProfileService } from './external-param-profile.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ExternalParamProfileService', () => { let service: ExternalParamProfileService; @@ -51,8 +49,6 @@ describe('ExternalParamProfileService', () => { providers: [ ExternalParamProfileService, { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts index 0e18623d020..dae1a6fde85 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component, forwardRef, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; @@ -45,7 +44,6 @@ import { BASE_URL, ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { GroupService } from '../../../group.service'; import { UnitsEditComponent } from './units-edit.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-units-form', @@ -83,8 +81,6 @@ describe('UnitsEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', units: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts index 719d31a4cce..85cbd40d732 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts @@ -36,8 +36,6 @@ */ import { EMPTY, of } from 'rxjs'; import { BASE_URL, ConfirmDialogService } from 'vitamui-library'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @@ -47,7 +45,6 @@ import { Component, forwardRef, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { GroupService } from '../../../group.service'; import { ProfilesEditComponent } from './profiles-edit.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-profiles-form', @@ -88,8 +85,6 @@ describe('ProfilesEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', profileIds: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts index 78f25381e71..9f11642892f 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts @@ -36,12 +36,11 @@ */ import { BASE_URL, CriteriaSearchQuery, Direction, Group, Operators, PageRequest, SnackBarService } from 'vitamui-library'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; import { GroupService } from './group.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('GroupService', () => { let httpTestingController: HttpTestingController; @@ -54,13 +53,7 @@ describe('GroupService', () => { TestBed.configureTestingModule({ imports: [], - providers: [ - GroupService, - { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [GroupService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts index 22895d38569..ba665f417f5 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts @@ -35,12 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { BASE_URL, SnackBarService } from 'vitamui-library'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { HierarchyService } from './hierarchy.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('HierarchyService', () => { beforeEach(() => { @@ -50,13 +47,7 @@ describe('HierarchyService', () => { TestBed.configureTestingModule({ imports: [], - providers: [ - HierarchyService, - { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [HierarchyService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], }); }); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts index 78989476b56..3c9076e6227 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; import { BASE_URL, Profile, SnackBarService } from 'vitamui-library'; import { ProfileService } from './profile.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ProfileService', () => { let httpTestingController: HttpTestingController; @@ -53,13 +52,7 @@ describe('ProfileService', () => { TestBed.configureTestingModule({ imports: [], - providers: [ - ProfileService, - { provide: SnackBarService, useValue: snackBarSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [ProfileService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts index 0ef1159f92e..ef69eb4ba34 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts @@ -37,12 +37,11 @@ import { AuthService, BASE_URL, CriteriaSearchQuery, ENVIRONMENT, LoggerModule, Operators } from 'vitamui-library'; import { environment } from './../../environments/environment'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; import { CustomerSelectService } from './customer-select.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('CustomerSelectService', () => { let httpTestingController: HttpTestingController; @@ -56,8 +55,6 @@ describe('CustomerSelectService', () => { providers: [ CustomerSelectService, { provide: AuthService, useValue: authStubService }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts index 9dadce6ce5a..475d762b5c5 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts @@ -34,12 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { BASE_URL, SubrogationApiService, WINDOW_LOCATION } from 'vitamui-library'; import { SubrogationService } from './subrogation.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SubrogationService', () => { beforeEach(() => { @@ -47,8 +45,6 @@ describe('SubrogationService', () => { imports: [], providers: [ SubrogationService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: SubrogationApiService, useValue: {} }, diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts index 050f6997960..d5721d666ee 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts @@ -35,20 +35,15 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { IngestApiService } from './ingest-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('IngestApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts index 02628302770..cf591c92bf7 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts @@ -44,8 +44,6 @@ import { BASE_URL, BytesPipe, ConfirmDialogService, LoggerModule, StartupService import { UploadComponent } from './upload.component'; import { UploadService } from './upload.service'; import { DecimalPipe } from '@angular/common'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('UploadComponent', () => { let component: UploadComponent; @@ -72,8 +70,6 @@ describe('UploadComponent', () => { { provide: StartupService, useValue: { getReferentialUrl: () => '' } }, DecimalPipe, BytesPipe, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ], }) diff --git a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts index 62c26b95843..63e6448b10a 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts @@ -34,8 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { inject, TestBed } from '@angular/core/testing'; import { BASE_URL } from 'vitamui-library'; @@ -48,12 +47,7 @@ describe('IngestReferentialService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - IngestReferentialService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [IngestReferentialService, { provide: BASE_URL, useValue: '/fake-api' }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts index 5f5034642f7..e6b0121adb7 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-errors-details-tab/ingest-errors-details-tab.component.spec.ts @@ -34,13 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { IngestService } from '../../ingest.service'; import { EventDisplayHelperService } from '../event-display-helper.service'; import { IngestErrorsDetailsTabComponent } from './ingest-errors-details-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('IngestErrorsDetailsTabComponent', () => { let component: IngestErrorsDetailsTabComponent; @@ -53,8 +51,6 @@ describe('IngestErrorsDetailsTabComponent', () => { providers: [ { provide: IngestService, useValue: {} }, { provide: EventDisplayHelperService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts index 57bac23ca38..40b275911d5 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts @@ -37,14 +37,11 @@ import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatMenuModule } from '@angular/material/menu'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { of } from 'rxjs'; import { BASE_URL, LogbookService } from 'vitamui-library'; import { LogbookOperation } from '../../models/logbook-event.interface'; import { IngestService } from '../ingest.service'; import { IngestPreviewComponent } from './ingest-preview.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { @@ -77,8 +74,6 @@ describe('IngestPreviewComponent test:', () => { logbookOperationsReloaded: of([logbookOperation]), }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts index d37dbf98ad4..c2ad7386a50 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { APP_BASE_HREF } from '@angular/common'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; @@ -47,7 +46,6 @@ import { FileService } from '../../../core/services/file.service'; import { MetadataHeaders } from '../../../models/models'; import { FileTreeMetadataComponent } from './file-tree-metadata.component'; import { FileTreeMetadataService } from './file-tree-metadata.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('FileTreeMetadataComponent', () => { let component: FileTreeMetadataComponent; @@ -95,8 +93,6 @@ describe('FileTreeMetadataComponent', () => { FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: APP_BASE_HREF, useValue: '/' }, diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts index 1f024c70d12..921748a7459 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; @@ -43,7 +42,6 @@ import { BASE_URL, SnackBarService } from 'vitamui-library'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { PastisPopupOptionComponent } from './pastis-popup-option.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const matDialogSpy = { open: vi.fn().mockName('MatDialog.open'), @@ -59,8 +57,6 @@ describe('PastisPopupOptionComponent', () => { imports: [RouterTestingModule, PastisPopupOptionComponent], providers: [ PastisConfiguration, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/pastis-api' }, { provide: MatDialog, useValue: matDialogSpy }, { provide: SnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts index 1187676b88d..f29b6c7cdf6 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts @@ -71,7 +71,6 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { RouterTestingModule } from '@angular/router/testing'; @@ -83,7 +82,6 @@ import { FileTreeMetadataService } from '../../profile/edit-profile/file-tree-me import { PopupService } from '../../core/services/popup.service'; import { UserActionSaveProfileComponent } from './save-profile.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const matDialogSpy = { open: vi.fn().mockName('MatDialog.open'), @@ -114,8 +112,6 @@ describe('UserActionOpenProfileComponent', () => { ProfileService, FileTreeMetadataService, PastisConfiguration, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/pastis-api' }, { provide: MatDialog, useValue: matDialogSpy }, { provide: StartupService, useValue: startUpServiceMock }, diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index 347256d5da7..5a5886378ea 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ /* eslint-disable @angular-eslint/component-selector */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { ActivatedRoute, Router } from '@angular/router'; @@ -46,7 +45,6 @@ import { environment } from './../environments/environment.prod'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { AppComponent } from './app.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'router-outlet', @@ -86,8 +84,6 @@ describe('AppComponent', () => { }, }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts index 96d5df7dfa5..2b2a8d15b2f 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts @@ -56,8 +56,6 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractCreateComponent } from './access-contract-create.component'; import { AccessContractCreateValidators } from './access-contract-create.validators'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedAccessContract = { identifier: 'AC_ID', @@ -136,8 +134,6 @@ describe('AccessContractCreateComponent', () => { ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: AgencyService, useValue: agencyServiceSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts index 58bb69b7e91..77c60c9bc13 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts @@ -37,14 +37,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { AccessContractService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; import { AccessContractListComponent } from './access-contract-list.component'; import { EMPTY, of } from 'rxjs'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AccessContractListComponent', () => { let component: AccessContractListComponent; @@ -62,8 +59,6 @@ describe('AccessContractListComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [VitamUICommonTestModule, MatProgressSpinnerModule, AccessContractListComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts index 82742b480ab..4d9b3aec5f5 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-authorizations-tab/access-contract-authorizations-update/access-contract-authorizations-update.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @@ -43,7 +42,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractAuthorizationsUpdateComponent } from './access-contract-authorizations-update.component'; import { of } from 'rxjs'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { CdkStepper } from '@angular/cdk/stepper'; describe('AccessContractAuthorizationsUpdateComponent', () => { @@ -70,8 +68,6 @@ describe('AccessContractAuthorizationsUpdateComponent', () => { { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: AgencyService, useValue: agencyServiceMock }, { provide: MAT_DIALOG_DATA, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: CdkStepper, useValue: { steps: [] } }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts index 53a7656ec53..4b5ebfa4b26 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts @@ -35,8 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; @@ -50,7 +48,6 @@ import { Status, } from 'vitamui-library'; import { AccessContractNodesTabComponent } from './access-contract-nodes-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AccessContractNodesTabComponent', () => { let component: AccessContractNodesTabComponent; @@ -98,8 +95,6 @@ describe('AccessContractNodesTabComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), AccessContractNodesTabComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: SearchUnitApiService, useValue: unitValueMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts index 7b2fd626e52..a76e99cd898 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; @@ -52,7 +51,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from '../../../../../environments/environment'; import { AccessContractNodeUpdateComponent } from './access-contract-node-update.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedCustomer: Customer = { id: 'idCustomer', @@ -123,8 +121,6 @@ describe.skip('AccessContractNodeUpdateComponent', () => { providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: expectedCustomer, logo: null } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index fa76f0cf9e4..476c239d135 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -45,8 +45,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractComponent } from './access-contract.component'; import { EMPTY, of } from 'rxjs'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; @Component({ selector: 'app-access-contract-preview', @@ -93,8 +91,6 @@ describe('AccessContractComponent', () => { AccessContractPreviewStub, ], providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ApplicationService, useValue: applicationServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts index c266e871f1c..5ab29c32dc9 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @@ -43,7 +42,6 @@ import { Direction, InfiniteScrollTable, PageRequest, SearchService } from 'vita import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessionRegistersService } from '../accession-register.service'; import { AccessionRegisterListComponent } from './accession-register-list.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AccessionRegisterListComponent', () => { let fixture: ComponentFixture; @@ -82,8 +80,6 @@ describe('AccessionRegisterListComponent', () => { providers: [ { provide: AccessionRegistersService, useValue: accessionRegistersService }, { provide: SearchService, useValue: searchService }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); fixture = TestBed.createComponent(AccessionRegisterListComponent); diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts index 6c1d2359cc9..e2f4161b3e6 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts @@ -57,8 +57,6 @@ import { import { environment } from '../../../environments/environment.prod'; import { AccessionRegistersService } from '../accession-register.service'; import { AccessionRegisterPreviewComponent } from './accession-register-preview.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('AccessionRegisterPreviewComponent', () => { let component: AccessionRegisterPreviewComponent; @@ -100,8 +98,6 @@ describe('AccessionRegisterPreviewComponent', () => { ], providers: [ { provide: AccessionRegistersService, useValue: AccessionRegistersServiceMock }, - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index 00874406d6c..8b02e133696 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; @@ -44,7 +43,6 @@ import { EMPTY, of } from 'rxjs'; import { AgencyService, AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AgencyListComponent } from './agency-list.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const authServiceMock = { user: { proofTenantIdentifier: '1' } }; const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), paramMap: EMPTY }; @@ -58,8 +56,6 @@ describe('AgencyListComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), VitamUICommonTestModule, MatProgressSpinnerModule], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ActivatedRoute, useValue: activatedRouteMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index dd1d9f096b4..1f44b8681a9 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -46,8 +46,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; import { AgencyComponent } from './agency.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-agency-preview', @@ -102,8 +100,6 @@ describe('AgencyComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts index ef9c096dc4b..eb86525141e 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts @@ -41,8 +41,6 @@ import { BASE_URL, ExternalParameters, ExternalParametersService, LoggerModule, import { AuditPreviewComponent } from './audit-preview.component'; import { AuditService } from '../audit.service'; import { ActivatedRoute } from '@angular/router'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { @@ -67,8 +65,6 @@ describe('AuditPreviewComponent', () => { await TestBed.configureTestingModule({ providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, { provide: AuditService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts index 6ce3d36eda6..534c1cf323a 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts @@ -50,8 +50,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AuditComponent } from './audit.component'; import { DatePipe } from '@angular/common'; import { provideNativeDateAdapter } from '@angular/material/core'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('AuditComponent', () => { let component: AuditComponent; @@ -86,8 +84,6 @@ describe('AuditComponent', () => { ], providers: [ provideNativeDateAdapter(), - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/pastis-api' }, DatePipe, FormBuilder, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts index 8b865a84f17..66df6de3048 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; @@ -46,7 +45,6 @@ import { AuthService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../context.service'; import { ContextListComponent } from './context-list.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ContextListComponent', () => { let component: ContextListComponent; @@ -83,8 +81,6 @@ describe('ContextListComponent', () => { ContextListComponent, ], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts index 61c9bac72fd..e93c5148082 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; @@ -46,7 +45,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../../context.service'; import { ContextPermissionTabComponent } from './context-permission-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const permissions: ContextPermission[] = [ { @@ -165,8 +163,6 @@ describe('ContextPermissionTabComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts index 196ca7f7579..0ed917246fa 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts @@ -41,12 +41,9 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { RouterTestingModule } from '@angular/router/testing'; import { Application, ApplicationService, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ActivatedRoute } from '@angular/router'; import { EMPTY, of } from 'rxjs'; import { ContextComponent } from './context.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { ContextListComponent } from './context-list/context-list.component'; @Component({ @@ -87,8 +84,6 @@ describe('ContextComponent', () => { providers: [ { provide: ActivatedRoute, useValue: { params: EMPTY, data: EMPTY, paramMap: EMPTY, snapshot: { data: { appId: 'App Id' } } } }, { provide: GlobalEventService, useValue: { pageEvent: EMPTY, customerEvent: EMPTY, tenantEvent: EMPTY } }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(ApplicationService, { useValue: applicationServiceMock }) diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts index 3157b914c1d..89aa58f8497 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts @@ -34,19 +34,15 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AgencyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts index ce883d768d0..9d7b45790c7 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts @@ -34,20 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { IngestContractApiService } from './ingest-contract-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('IngestContractApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts index c59e3918230..8f82c754ef5 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts @@ -34,20 +34,16 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OntologyApiService } from './ontology-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('OntologyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts index db669c3bea0..5f0823e423c 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts @@ -34,20 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OperationApiService } from './operation-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('OperationApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts index 3157b914c1d..89aa58f8497 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts @@ -34,19 +34,15 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AgencyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts index 280c5319684..bc484a7baec 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts @@ -34,14 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { AuthService, BASE_URL, SnackBarService, StartupService } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { FileFormatListComponent } from './file-format-list.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('FileFormatListComponent', () => { let component: FileFormatListComponent; @@ -52,8 +50,6 @@ describe('FileFormatListComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [FileFormatListComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, FileFormatService, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts index 57322563581..9603f0bdd4e 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts @@ -35,8 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { FormBuilder } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; @@ -57,7 +55,6 @@ import { FileFormatService } from '../../file-format/file-format.service'; import { IngestContractService } from '../ingest-contract.service'; import { IngestContractCreateComponent } from './ingest-contract-create.component'; import { IngestContractCreateValidators } from './ingest-contract-create.validators'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('IngestContractCreateComponent', () => { let component: IngestContractCreateComponent; @@ -102,8 +99,6 @@ describe('IngestContractCreateComponent', () => { imports: [IngestContractCreateComponent, VitamUICommonTestModule, LoggerModule.forRoot(), MatButtonToggleModule], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: {} }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts index 5a69a8f1c07..26ad193a6f8 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; @@ -48,7 +47,6 @@ import { SearchUnitApiService, } from 'vitamui-library'; import { IngestContractAttachmentTabComponent } from './ingest-contract-attachment-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('IngestContractAttachmentTabComponent', () => { let component: IngestContractAttachmentTabComponent; @@ -96,8 +94,6 @@ describe('IngestContractAttachmentTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [LoggerModule.forRoot(), IngestContractAttachmentTabComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: {} }, { provide: SearchUnitApiService, useValue: unitValueMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts index d9559483cc5..befc4395c24 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; @@ -44,7 +43,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../../../environments/environment'; import { IngestContractNodeUpdateComponent } from './ingest-contract-node-update.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatButtonModule } from '@angular/material/button'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; @@ -92,8 +90,6 @@ describe.skip('IngestContractNodeUpdateComponent', () => { provide: MAT_DIALOG_DATA, useValue: { data: { ingestContract: 'IC-000001', accessContractId: 'AC-000001', tenantIdentifier: 1 } }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts index abf9472ff12..57f0840d9e2 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts @@ -51,12 +51,9 @@ import { WINDOW_LOCATION, } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { IngestContractComponent } from './ingest-contract.component'; import { IngestContractService } from './ingest-contract.service'; import { DownloadSnackBarService } from '../core/service/download-snack-bar.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('IngestContractComponent', () => { let component: IngestContractComponent; @@ -86,8 +83,6 @@ describe('IngestContractComponent', () => { { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: Router, useValue: {} }, { provide: MatDialog, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: DownloadSnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts index 464e5f45203..5a17a054d4f 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-list/logbook-management-operation-list.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; @@ -42,7 +41,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OperationsResults } from '../../models/operation-response.interface'; import { LogbookManagementOperationService } from '../logbook-management-operation.service'; import { LogbookManagementOperationListComponent } from './logbook-management-operation-list.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { @@ -117,8 +115,6 @@ describe('LogbookManagementOperationListComponent', () => { provide: LogbookManagementOperationService, useValue: logbookManagementOperationServiceMock, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts index 3e4f4e02616..03f61c5f0ee 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; @@ -43,7 +42,6 @@ import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; import { OperationsResults } from '../../models/operation-response.interface'; import { LogbookManagementOperationService } from '../logbook-management-operation.service'; import { LogbookManagementOperationPreviewComponent } from './logbook-management-operation-preview.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('LogbookManagementOperationPreviewComponent', () => { let component: LogbookManagementOperationPreviewComponent; @@ -78,8 +76,6 @@ describe('LogbookManagementOperationPreviewComponent', () => { { provide: LogbookManagementOperationService, useValue: logbookManagementOperationServiceMock }, { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts index f40315b0b77..2678593314a 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts @@ -43,8 +43,6 @@ import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, VitamUICommonModul import { LogbookManagementOperationComponent } from './logbook-management-operation.component'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { provideNativeDateAdapter } from '@angular/material/core'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('LogbookManagementOperationComponent', () => { let component: LogbookManagementOperationComponent; @@ -78,8 +76,6 @@ describe('LogbookManagementOperationComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: ENVIRONMENT, useValue: '' }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index 8d6060ae754..a18cfddbf0e 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -47,7 +46,6 @@ import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperationDetailComponent } from './logbook-operation-detail.component'; import { LastEventPipe } from '../../shared/pipes/last-event.pipe'; import { EventTypeBadgeColorPipe } from '../../shared/pipes/event-type-badge-color.pipe'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; @Pipe({ name: 'truncate' }) class MockTruncatePipe implements PipeTransform { @@ -81,8 +79,6 @@ describe('LogbookOperationDetailComponent', () => { ], providers: [ { provide: LogbookService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: LogbookDownloadService, useValue: { logbookOperationsReloaded: of([{ id: 'event-01' }]) } }, { provide: AuthService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-search.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-search.service.spec.ts index 60f5f2f8122..9f2a14b1161 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-search.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-search.service.spec.ts @@ -40,18 +40,12 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { LogbookSearchService } from './logbook-search.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('LogbookSearchService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [ - { provide: LogbookService, useValue: {} }, - { provide: LogbookApiService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [{ provide: LogbookService, useValue: {} }, { provide: LogbookApiService, useValue: {} }, provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts index 0924a0c2143..fcebc3a915e 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; @@ -58,7 +57,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractToFormGroupConverterService } from '../components/management-contract-to-form-group-converter.service'; import { ManagementContractService } from '../management-contract.service'; import { ManagementContractCreateComponent } from './management-contract-create.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ManagementContractCreateComponent', () => { let managementContractToFormGroupConverterService: ManagementContractToFormGroupConverterService; @@ -111,8 +109,6 @@ describe('ManagementContractCreateComponent', () => { { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: MatDialogRef, useValue: matDialogRefSpy }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: confirmDialogServiceMock }, ManagementContractToFormGroupConverterService, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index 80e16645f20..f3c5044aaf6 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; @@ -47,7 +46,6 @@ import { BASE_URL, InjectorModule, LoggerModule, ManagementContract, SearchServi import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../management-contract.service'; import { ManagementContractListComponent } from './management-contract-list.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ManagementContractListComponent', () => { let component: ManagementContractListComponent; @@ -91,8 +89,6 @@ describe('ManagementContractListComponent', () => { providers: [ { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: SearchService, useValue: searchServiceeMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts index 764a276dd06..fd2abd7a055 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; @@ -46,7 +45,6 @@ import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, Manage import { InputStubComponent, VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractInformationTabComponent } from './management-contract-information-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { By } from '@angular/platform-browser'; describe('ManagementContractInformationTabComponent', () => { @@ -117,8 +115,6 @@ describe('ManagementContractInformationTabComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts index 45527071a7b..364ac159126 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; @@ -43,7 +42,6 @@ import { RouterTestingModule } from '@angular/router/testing'; import { InjectorModule, IntermediaryVersionEnum, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractPreviewComponent } from './management-contract-preview.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ManagementContractPreviewComponent', () => { let component: ManagementContractPreviewComponent; @@ -74,8 +72,6 @@ describe('ManagementContractPreviewComponent', () => { provide: WINDOW_LOCATION, useValue: window.location, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts index ca3d33e61f9..df31acf4abc 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; @@ -46,7 +45,6 @@ import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, Manage import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractStorageTabComponent } from './management-contract-storage-tab.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ManagementContractStorageTabComponent', () => { let component: ManagementContractStorageTabComponent; @@ -108,8 +106,6 @@ describe('ManagementContractStorageTabComponent', () => { ], providers: [ FormBuilder, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts index b748501d7b7..6a9c403dd8d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; @@ -47,7 +46,6 @@ import { of } from 'rxjs'; import { Application, ApplicationService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractComponent } from './management-contract.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ManagementContractComponent', () => { let component: ManagementContractComponent; @@ -92,8 +90,6 @@ describe('ManagementContractComponent', () => { }, { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }) .overrideProvider(ApplicationService, { useValue: applicationServiceSpy }) diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts index 285943e940b..4e0860d0eb1 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts @@ -42,8 +42,6 @@ import { EMPTY, of } from 'rxjs'; import { AuthService, BASE_URL, Ontology, TenantSelectionService } from 'vitamui-library'; import { OntologyListComponent } from './ontology-list.component'; import { OntologyService } from '../../ontology.service'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('OntologyListComponent', () => { let component: OntologyListComponent; @@ -66,8 +64,6 @@ describe('OntologyListComponent', () => { declarations: [], imports: [OntologyListComponent], providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: MatDialog, useValue: {} }, { provide: OntologyService, useValue: ontologyServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts index c8ed5d2ac06..e2395e0908f 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts @@ -41,8 +41,6 @@ import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; import { AuthService, BASE_URL, SchemaService, TenantSelectionService } from 'vitamui-library'; import { SchemaListComponent } from './schema-list.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('SchemaListComponent', () => { let component: SchemaListComponent; @@ -63,8 +61,6 @@ describe('SchemaListComponent', () => { declarations: [], imports: [SchemaListComponent], providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: MatDialog, useValue: {} }, { provide: SchemaService, useValue: schemaServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts index 794e1a7e724..400bdea07f4 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts @@ -35,8 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpErrorResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpErrorResponse } from '@angular/common/http'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; @@ -106,8 +105,6 @@ describe('GriffinListComponent', () => { await TestBed.configureTestingModule({ imports: [GriffinListComponent, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: GriffinsService, useValue: griffinsService }, { provide: SnackBarService, useValue: snackBarService }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts index d45e895af6c..7416242fcda 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts @@ -35,8 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpErrorResponse, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpErrorResponse } from '@angular/common/http'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; @@ -84,8 +83,6 @@ describe('PreservationScenarioListComponent', () => { await TestBed.configureTestingModule({ imports: [PreservationScenarioListComponent, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: PreservationScenariosService, useValue: preservationScenariosService }, { provide: SnackBarService, useValue: snackBarService }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts index 7596d7d919c..7b063fdb34d 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts @@ -38,8 +38,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { PreservationComponent } from './preservation.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { BASE_URL, InjectorModule, LoggerModule, SecurityService, VitamUICommonModule } from 'vitamui-library'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; @@ -56,8 +54,6 @@ describe('PreservationComponent', () => { await TestBed.configureTestingModule({ imports: [PreservationComponent, LoggerModule.forRoot(), VitamUICommonModule, InjectorModule], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts index ff5eb2284fb..e3967a7d0ab 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts @@ -49,8 +49,6 @@ import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProbativeValueComponent } from './probative-value.component'; import { DatePipe } from '@angular/common'; import { provideNativeDateAdapter } from '@angular/material/core'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('ProbativeValueComponent', () => { let component: ProbativeValueComponent; @@ -76,8 +74,6 @@ describe('ProbativeValueComponent', () => { ], providers: [ provideNativeDateAdapter(), - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/pastis-api' }, DatePipe, FormBuilder, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts index 39df2a74fa2..134a9e82b09 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts @@ -40,8 +40,6 @@ import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; import { AuthService, BASE_URL, Rule, RuleService, SnackBarService } from 'vitamui-library'; import { RuleListComponent } from './rule-list.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('RuleListComponent', () => { let component: RuleListComponent; @@ -56,8 +54,6 @@ describe('RuleListComponent', () => { await TestBed.configureTestingModule({ imports: [RuleListComponent], providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: RuleService, useValue: ruleServiceMock }, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index c05da954e57..f8aa93034ea 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -35,8 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { ComponentFixture, TestBed } from '@angular/core/testing'; - -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component, Input } from '@angular/core'; import { ReactiveFormsModule } from '@angular/forms'; import { MatOptionModule } from '@angular/material/core'; @@ -62,7 +60,6 @@ import { import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from '../../environments/environment'; import { RuleComponent } from './rule.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'app-rule-preview', @@ -166,8 +163,6 @@ describe('RuleComponent', () => { { provide: AuthService, useValue: authServiceMock }, { provide: ENVIRONMENT, useValue: environment }, { provide: SecurityService, useValue: securityServiceMock }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index 3ebaeb17d5a..1ff03ab867e 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -40,8 +40,6 @@ import { of } from 'rxjs'; import { AccessContractService, BASE_URL, ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; import { SecurisationCheckTabComponent } from './securisation-check-tab.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SecurisationCheckTabComponent', () => { let component: SecurisationCheckTabComponent; @@ -109,8 +107,6 @@ describe('SecurisationCheckTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [SecurisationCheckTabComponent], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: SecurisationService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts index 873c470f2c1..3dcb10291c0 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; @@ -48,7 +47,6 @@ import { DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { SecurisationComponent } from './securisation.component'; import { DatePipe } from '@angular/common'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { provideNativeDateAdapter } from '@angular/material/core'; describe('SecurisationComponent', () => { @@ -86,8 +84,6 @@ describe('SecurisationComponent', () => { navigate: () => {}, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts index 58cb325aa56..538d628db9c 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts @@ -40,8 +40,6 @@ import { of } from 'rxjs'; import { AuthService, BASE_URL, SecurityProfile } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { SecurityProfileListComponent } from './security-profile-list.component'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; describe('SecurityProfileListComponent', () => { let component: SecurityProfileListComponent; @@ -56,8 +54,6 @@ describe('SecurityProfileListComponent', () => { await TestBed.configureTestingModule({ imports: [SecurityProfileListComponent], providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }, { provide: SecurityProfileService, useValue: securityProfileServiceMock }, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts index b4515d875bf..0ce2848f90e 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { ReferentialImportService } from './referential-import.service'; import { ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { firstValueFrom } from 'rxjs'; describe('ReferentialImportService', () => { @@ -48,8 +47,6 @@ describe('ReferentialImportService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts index e9ce285f314..51b68bf03e7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts @@ -49,8 +49,6 @@ import { BASE_URL, ENVIRONMENT, WINDOW_LOCATION } from '../injection-tokens'; import type { Account } from '../models/account/account.interface'; import { AccountComponent } from './account.component'; import { AccountService } from './account.service'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; @Component({ selector: 'vitamui-common-account-information-tab', @@ -88,8 +86,6 @@ describe('AccountComponent', () => { { provide: BaseUserInfoApiService, useValue: userInfoApiServiceSpy }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, { provide: ENVIRONMENT, useValue: environment }, - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: location }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts index 6757bb754ba..e59249dcfa2 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts @@ -34,26 +34,18 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { EMPTY } from 'rxjs'; import { SnackBarService } from '../components/snack-bar/snack-bar.service'; import { BASE_URL } from '../injection-tokens'; import { AccountService } from './account.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AccountService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - AccountService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: {} }, - { provide: SnackBarService, useValue: { instant: () => EMPTY } }, - ], + providers: [AccountService, { provide: BASE_URL, useValue: {} }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }], }); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts index be249996ea5..7b514ed8d93 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts @@ -34,22 +34,18 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { AgencyApiService } from './agency-api.service'; import { InjectorModule } from '../helper/injector.module'; import { LoggerModule } from '../logger/logger.module'; import { BASE_URL, ENVIRONMENT } from '../injection-tokens'; import { environment } from '../../../environments/environment'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AgencyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts index 378d7b79d1d..c161e12e63b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; import { UserApiService } from './api/user-api.service'; @@ -43,7 +42,6 @@ import { Router, RouterModule } from '@angular/router'; import { AnalyticsResolver } from './analytics-resolver.service'; import { BASE_URL, WINDOW_LOCATION } from './injection-tokens'; import { LoggerModule } from './logger/logger.module'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedUser = { id: 10 }; @@ -54,8 +52,6 @@ describe('AnalyticsResolver', () => { providers: [ { provide: Router, useValue: {} }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: UserApiService, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts index 3ec5c6d305a..19f5bbdab6d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts @@ -34,14 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { LoggerModule } from '../logger/logger.module'; import { InjectorModule } from '../helper/injector.module'; import { BASE_URL, ENVIRONMENT } from '../injection-tokens'; import { environment } from '../../../environments/environment'; import { AccessContractApiService } from './access-contract-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AccessContractApiService', () => { let service: AccessContractApiService; @@ -49,8 +47,6 @@ describe('AccessContractApiService', () => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts index 0568c08f471..b768bb446e7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts @@ -34,21 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { AuthService } from '../auth.service'; import { BASE_URL, WINDOW_LOCATION } from '../injection-tokens'; import { SubrogationApiService } from './subrogation-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SubrogationApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], providers: [ - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: AuthService, useValue: {} }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts index c9a761ddcde..83cf51a3a6f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts @@ -34,13 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { AuthService } from '../auth.service'; import { BASE_URL, WINDOW_LOCATION } from './../injection-tokens'; import { UserApiService } from './user-api.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('UserApiService', () => { beforeEach(() => @@ -48,8 +46,6 @@ describe('UserApiService', () => { imports: [], providers: [ { provide: AuthService, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/app.guard.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/app.guard.spec.ts index 6d7c9c6c627..13d1b6d7ed7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/app.guard.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/app.guard.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { ActivatedRouteSnapshot } from '@angular/router'; @@ -43,7 +42,6 @@ import { ApplicationService } from './application.service'; import { AuthService } from './auth.service'; import { WINDOW_LOCATION } from './injection-tokens'; import { StartupService } from './startup.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; const expectedApp = [ { @@ -91,8 +89,6 @@ describe('AppGuard', () => { }, { provide: ApplicationService, useValue: { applications: expectedApp } }, { provide: WINDOW_LOCATION, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts index 4b2fd940ced..b26136aa705 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { LOCALE_ID, Type } from '@angular/core'; import { inject, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; @@ -45,7 +45,6 @@ import { ConfigService } from './config.service'; import { BASE_URL } from './injection-tokens'; import { Application } from './models/application/application.interface'; import { StartupService } from './startup.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { Category } from './models/application/category.interface'; describe('ApplicationService', () => { @@ -75,8 +74,6 @@ describe('ApplicationService', () => { { provide: AuthService, useValue: authStubService }, { provide: LOCALE_ID, useValue: 'fr' }, { provide: StartupService, useValue: startupServiceStub }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfigService, useValue: configServiceStub }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts index c09137c0f68..17c47de7742 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed, waitForAsync } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { BASE_URL } from '../../../injection-tokens'; @@ -50,7 +49,6 @@ import { SchemaService } from '../../../schema/schema.service'; import { MockSchemaService } from '../../../schema/mock-schema.service'; import { ArchiveUnitViewerService } from './archive-unit-viewer.service'; import { ObjectEditorModule } from '../../../object-editor/object-editor.module'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ArchiveUnitViewerService', () => { let service: ArchiveUnitViewerService; @@ -65,8 +63,6 @@ describe('ArchiveUnitViewerService', () => { DisplayObjectHelperService, DisplayRuleHelperService, SchemaElementToDisplayRuleService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SchemaService, useClass: MockSchemaService }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts index f635c00fe05..92ad8c91759 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts @@ -41,7 +41,6 @@ import { VitamUICommonTestModule } from '../../../../../testing/src/vitamui-comm import { BASE_URL } from '../../injection-tokens'; import { EditableFieldComponent } from './editable-field.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('EditableFieldComponent', () => { let component: EditableFieldComponent; @@ -49,14 +48,7 @@ describe('EditableFieldComponent', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [VitamUICommonTestModule], - providers: [ - { - provide: BASE_URL, - useValue: '/fake-api', - }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - ], + providers: [{ provide: BASE_URL, useValue: '/fake-api' }, provideHttpClientTesting()], }), ); beforeEach(() => { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts index 14e66c707da..822646fc812 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-level-input/editable-level-input.component.spec.ts @@ -35,14 +35,12 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { OverlayModule } from '@angular/cdk/overlay'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { Component, forwardRef, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { WINDOW_LOCATION } from '../../../injection-tokens'; import { EditableLevelInputComponent } from './editable-level-input.component'; import { SubLevelPipe } from './sub-level.pipe'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @Component({ selector: 'vitamui-common-level-input', @@ -77,8 +75,6 @@ describe('EditableLevelInputComponent', () => { provide: WINDOW_LOCATION, useValue: {}, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts index d9637f7d156..cf3b01491d8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/level-input/level-input.component.spec.ts @@ -34,12 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { WINDOW_LOCATION } from '../../../injection-tokens'; import { LevelInputComponent } from './level-input.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('LevelInputComponent', () => { let component: LevelInputComponent; @@ -53,8 +51,6 @@ describe('LevelInputComponent', () => { provide: WINDOW_LOCATION, useValue: {}, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/snack-bar/snack-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/snack-bar/snack-bar.component.spec.ts index e8f85a575ba..2654b1fdd96 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/snack-bar/snack-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/snack-bar/snack-bar.component.spec.ts @@ -34,12 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar'; import { WINDOW_LOCATION } from '../../injection-tokens'; import { SnackBarComponent } from './snack-bar.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SnackbarComponent', () => { let component: SnackBarComponent; @@ -57,8 +55,6 @@ describe('SnackbarComponent', () => { dismiss: () => {}, }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts index 3c9c672025d..e37bcb520df 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts @@ -35,8 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { DatePipe } from '@angular/common'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { TranslateLoader } from '@ngx-translate/core'; @@ -103,8 +101,6 @@ describe('ObjectViewerComponent', () => { LayoutService, FavoriteEntryService, DatePipe, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: DisplayObjectService, useClass: PathStrategyDisplayObjectService }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts index 9e8ff56b58d..17b2f8eaa44 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { BASE_URL } from '../injection-tokens'; import { OntologyService } from './ontology.service'; @@ -46,12 +45,7 @@ describe('OntologyService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - OntologyService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [OntologyService, provideHttpClient(withInterceptorsFromDi()), { provide: BASE_URL, useValue: '/fake-api' }], }); service = TestBed.inject(OntologyService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts index 3c6a0ea04d8..0ddb67ffe35 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts @@ -35,8 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { HttpTestingController } from '@angular/common/http/testing'; import { PreservationScenariosApiService } from './preservation-scenarios-api.service'; import { BASE_URL } from '../../injection-tokens'; @@ -68,12 +67,7 @@ describe('PreservationScenariosApiService', () => { beforeEach(() => { TestBed.configureTestingModule({ - providers: [ - PreservationScenariosApiService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: baseUrl }, - ], + providers: [PreservationScenariosApiService, { provide: BASE_URL, useValue: baseUrl }], }); service = TestBed.inject(PreservationScenariosApiService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts index 21662cbf0ca..35224bf9ac9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts @@ -34,13 +34,12 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { inject, TestBed } from '@angular/core/testing'; import { BASE_URL } from '../injection-tokens'; import { ProfileService } from './profile.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('ProfileService', () => { let httpTestingController: HttpTestingController; @@ -49,12 +48,7 @@ describe('ProfileService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - ProfileService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [ProfileService, { provide: BASE_URL, useValue: '/fake-api' }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts index 09fbdab31cf..168a68568be 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_SNACK_BAR_DATA, MatSnackBarRef } from '@angular/material/snack-bar'; import { Router } from '@angular/router'; @@ -44,7 +43,6 @@ import { SubrogationApiService } from '../../api/subrogation-api.service'; import { SnackBarService } from '../../components/snack-bar/snack-bar.service'; import { BASE_URL, WINDOW_LOCATION } from '../../injection-tokens'; import { SubrogationSnackBarComponent } from './subrogation-snack-bar.component'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SubrogationSnackBarComponent', () => { let component: SubrogationSnackBarComponent; @@ -55,8 +53,6 @@ describe('SubrogationSnackBarComponent', () => { imports: [VitamUICommonTestModule, SubrogationSnackBarComponent], providers: [ { provide: MAT_SNACK_BAR_DATA, useValue: {} }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fakeapi' }, { provide: MatSnackBarRef, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts index f97c21062d1..36064f6f226 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts @@ -34,7 +34,6 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Router } from '@angular/router'; @@ -48,7 +47,6 @@ import { LoggerModule } from '../logger/logger.module'; import { environment } from './../../../environments/environment'; import { ENVIRONMENT, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION } from './../injection-tokens'; import { SubrogationService } from './subrogation.service'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('SubrogationService', () => { beforeEach(() => { @@ -65,8 +63,6 @@ describe('SubrogationService', () => { url: 'subrogations/customers/customerId', }, }, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: 'fake-api' }, { provide: SUBROGRATION_REFRESH_RATE_MS, useValue: 100 }, { provide: AuthService, useValue: {} }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts index feed068b377..e2893230111 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { inject, TestBed } from '@angular/core/testing'; import { SnackBarService } from '../../../app/modules/components/snack-bar/snack-bar.service'; @@ -50,7 +50,6 @@ import { FilingPlanService } from './filing-plan.service'; import { Node } from '../../models/node.interface'; import { DescriptionLevel } from '../../models/description-level.enum'; import { EMPTY, firstValueFrom, of } from 'rxjs'; -import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('FilingPlanService', () => { let httpTestingController: HttpTestingController; @@ -63,8 +62,6 @@ describe('FilingPlanService', () => { imports: [VitamUICommonModule, InjectorModule, LoggerModule.forRoot()], providers: [ FilingPlanService, - provideHttpClient(withInterceptorsFromDi()), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, { provide: AccessContractService, useValue: accessContractServiceMock }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts index 145402d246a..6fc796df7e0 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts @@ -38,7 +38,6 @@ import { ReclassificationDialogComponent } from './reclassification-dialog.component'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ConfirmDialogService } from '../../../app/modules/components/common-confirm-dialog/confirm-dialog.service'; import { BASE_URL, WINDOW_LOCATION } from '../../../app/modules/injection-tokens'; import { LoggerModule } from '../../../app/modules/logger/logger.module'; @@ -47,7 +46,6 @@ import { PagedResult, SearchCriteriaDto, SearchCriteriaTypeEnum } from '../../.. import { MatSnackBarModule } from '@angular/material/snack-bar'; import { Observable, of } from 'rxjs'; import { ReclassificationService } from '../../../app/modules/services/reclassification.service'; -import { provideHttpClient } from '@angular/common/http'; const matDialogRefSpy = { close: vi.fn().mockName('MatDialogRef.close'), @@ -111,8 +109,6 @@ describe('ReclassificationDialogComponent', () => { await TestBed.configureTestingModule({ imports: [MatSnackBarModule, LoggerModule.forRoot()], providers: [ - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts index 65c5428ca4a..4588502d972 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts @@ -46,8 +46,6 @@ import { PagedResult } from '../../../app/modules/models/criteria/search-criteri import { BaseReclassificationDialogService } from './reclassification-dialog.service'; import { VitamTenantConfigService } from '../../../app/modules/vitam-tenant-config.service'; import { tenantConfigServiceMock } from '../../../../testing/src/tenant-config.service.mock'; -import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { provideHttpClient } from '@angular/common/http'; const fakeArchiveUnits = (count: number): ArchiveUnit[] => { return [...Array(count).keys()].map((n): ArchiveUnit => ({ '#id': `${n}`, '#unitups': [] })); @@ -74,8 +72,6 @@ describe('ReclassificationDialogService', () => { BaseReclassificationDialogService, { provide: ReclassificationService, useValue: reclassificationServiceSpy }, { provide: TranslateService, useValue: translateServiceSpy }, - provideHttpClient(), - provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }, { provide: VitamTenantConfigService, From 111d26a77c639dbbd9a90e0debcecd01fa34e0fa Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 27 Aug 2026 19:20:58 +0200 Subject: [PATCH 13/33] Story #16471: Clean code - WIP --- .../archive-preview/archive-preview.component.spec.ts | 1 - .../archive-unit-information-tab.component.spec.ts | 1 - .../archive-unit-rules-details-tab.component.spec.ts | 1 - .../archive-unit-rules-informations-tab.component.spec.ts | 2 +- .../dip-request-create.component.spec.ts | 1 - .../add-management-rules.component.spec.ts | 1 - .../add-update-property.component.spec.ts | 1 - .../archive-unit-rules.component.spec.ts | 1 - .../block-category-inheritance.component.spec.ts | 1 - .../block-rules-inheritance.component.spec.ts | 1 - .../delete-unit-rules/delete-unit-rules.component.spec.ts | 1 - .../unlock-category-inheritance.component.spec.ts | 1 - .../unlock-rules-inheritance.component.spec.ts | 1 - .../update-unit-rules/update-unit-rules.component.spec.ts | 1 - .../management-rules/management-rules.component.spec.ts | 1 - .../transfer-request-modal.component.spec.ts | 1 - .../archive-search/archive-search.component.spec.ts | 3 +-- .../search-criteria-saver.service.spec.ts | 2 +- .../simple-criteria-search.component.spec.ts | 1 - .../transfer-acknowledgment.component.spec.ts | 1 - .../src/app/archive/archive.component.spec.ts | 1 - .../archive-search/src/app/archive/archive.service.spec.ts | 5 +---- .../archive/common-services/archive-facets.service.spec.ts | 2 +- .../criteria-search/criteria-search.component.spec.ts | 1 - .../found-object-modal.component.spec.ts | 1 - .../persistent-identifier-search.component.spec.ts | 2 +- .../src/app/core/api/archive-api.service.spec.ts | 5 +---- .../add-units/add-units.component.spec.ts | 1 - .../archive-preview/archive-preview.component.spec.ts | 1 - .../archive-unit-rules-details-tab.component.spec.ts | 1 - .../archive-unit-rules-informations-tab.component.spec.ts | 2 +- .../collect-object-group-details-tab.component.spec.ts | 1 - .../archive-search-collect.component.spec.ts | 1 - .../search-criteria-saver.service.spec.ts | 2 +- ...d-description-criteria-search-collect.component.spec.ts | 7 +------ .../update-units-metadata.component.spec.ts | 1 - .../src/app/collect/core/api/project-api.service.spec.ts | 5 +---- .../create-project/create-project.component.spec.ts | 1 - .../project-preview/project-preview.component.spec.ts | 1 - .../transaction-list/transaction-list.component.spec.ts | 1 - .../identity/src/app/core/api/customer-api.service.spec.ts | 5 +---- .../identity/src/app/core/api/group-api.service.spec.ts | 2 +- .../identity/src/app/core/api/user-api.service.spec.ts | 2 +- .../identity/src/app/core/customer.service.spec.ts | 7 +------ .../customer-create/customer-create.component.spec.ts | 1 - .../customer/customer-list/customer-list.service.spec.ts | 5 +---- .../sso-tab/identity-provider.service.spec.ts | 1 - .../customer-preview/sso-tab/provider-api.service.spec.ts | 2 +- .../identity/src/app/customer/owner-api.service.spec.ts | 2 +- .../customer/owner-preview/owner-preview.component.spec.ts | 1 - .../identity/src/app/customer/owner.service.spec.ts | 2 +- .../identity/src/app/customer/tenant-api.service.spec.ts | 2 +- .../identity/src/app/customer/tenant.service.spec.ts | 2 +- .../external-param-profile-detail.component.spec.ts | 1 - .../external-param-profile-service.service.spec.ts | 6 +----- .../units-edit/units-edit.component.spec.ts | 1 - .../profiles-edit/profiles-edit.component.spec.ts | 1 - .../projects/identity/src/app/group/group.service.spec.ts | 2 +- .../identity/src/app/hierarchy/hierarchy.service.spec.ts | 2 +- .../identity/src/app/profile/profile.service.spec.ts | 2 +- .../src/app/subrogation/customer-select.service.spec.ts | 1 - .../src/app/subrogation/subrogation.service.spec.ts | 7 +------ .../src/app/subrogation/user-generic-api.service.spec.ts | 2 +- .../ingest/src/app/core/api/ingest-api.service.spec.ts | 5 +---- .../ingest/src/app/core/common/upload.component.spec.ts | 1 - .../app/core/service/ingest-referential.service.spec.ts | 2 +- .../ingest/ingest-preview/ingest-preview.component.spec.ts | 1 - .../file-tree-metadata.component.spec.ts | 1 - .../projects/portal/src/app/app.component.spec.ts | 1 - .../access-contract-create.component.spec.ts | 1 - .../access-contract-nodes-tab.component.spec.ts | 1 - .../access-contract-node-update.component.spec.ts | 1 - .../app/access-contract/access-contract.component.spec.ts | 1 - .../accession-register-preview.component.spec.ts | 1 - .../app/agency/agency-list/agency-list.component.spec.ts | 1 - .../referential/src/app/agency/agency.component.spec.ts | 1 - .../audit/audit-preview/audit-preview.component.spec.ts | 1 - .../context-permission-tab.component.spec.ts | 1 - .../src/app/core/api/context-api.service.spec.ts | 5 +---- .../src/app/core/api/ingest-contract-api.service.spec.ts | 5 +---- .../src/app/core/api/ontology-api.service.spec.ts | 5 +---- .../src/app/core/api/operation-api.service.spec.ts | 5 +---- .../src/app/core/api/security-profile-api.service.spec.ts | 5 +---- .../ingest-contract-create.component.spec.ts | 1 - .../ingest-contract-attachment-tab.component.spec.ts | 1 - .../ingest-contract-node-update.component.spec.ts | 1 - .../logbook-management-operation-preview.component.spec.ts | 1 - .../logbook-operation-detail.component.spec.ts | 1 - .../management-contract-create.component.spec.ts | 1 - .../management-contract-list.component.spec.ts | 1 - .../management-contract-information-tab.component.spec.ts | 1 - .../management-contract-storage-tab.component.spec.ts | 1 - .../griffin-list/griffin-list.component.spec.ts | 1 - .../preservation-scenario-list.component.spec.ts | 1 - .../src/app/preservation/preservation.component.spec.ts | 1 - .../referential/src/app/rule/rule.component.spec.ts | 1 - .../securisation-check-tab.component.spec.ts | 1 - .../import-dialog/referential-import-api.service.spec.ts | 5 +---- .../src/app/modules/account/account.component.spec.ts | 1 - .../src/app/modules/agencies/agency-api.service.spec.ts | 5 +---- .../src/app/modules/analytics-resolver.service.spec.ts | 1 - .../app/modules/api/access-contract-api.service.spec.ts | 5 +---- .../src/app/modules/api/application-api.service.spec.ts | 2 +- .../src/app/modules/api/logbook-api.service.spec.ts | 2 +- .../src/app/modules/api/ontology-api.service.spec.ts | 2 +- .../src/app/modules/api/profile-api.service.spec.ts | 2 +- .../src/app/modules/api/security-api.service.spec.ts | 2 +- .../src/app/modules/api/site-api.service.spec.ts | 2 +- .../src/app/modules/api/subrogation-api.service.spec.ts | 1 - .../src/app/modules/api/user-api.service.spec.ts | 1 - .../src/app/modules/application.service.spec.ts | 1 - .../archive-unit-viewer.component.spec.ts | 2 +- .../archive-unit-viewer.service.spec.ts | 1 - .../editable-field/editable-field.component.spec.ts | 2 +- .../modules/object-viewer/object-viewer.component.spec.ts | 1 - .../src/app/modules/ontology/ontology.service.spec.ts | 2 +- .../modules/preservation/griffins/griffins.service.spec.ts | 2 +- .../src/app/modules/services/profile.service.spec.ts | 2 +- .../lib/components/filing-plan/filing-plan.service.spec.ts | 1 - .../reclassification-dialog.component.spec.ts | 1 - .../reclassification-dialog.service.spec.ts | 1 - 121 files changed, 48 insertions(+), 183 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index 296f99132e8..ef99607c6aa 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -113,7 +113,6 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts index dcd7e340bdb..88aa0ae706c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts @@ -143,7 +143,6 @@ describe('ArchiveUnitInformationTabComponent', () => { providers: [ FormBuilder, { provide: ArchiveService, useValue: archiveServiceMock }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 3b02eb3448e..b3dabade9d3 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -71,7 +71,6 @@ describe('ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, ArchiveUnitRulesDetailsTabComponent], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, { provide: ArchiveService, useValue: archiveServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 968581153b0..3112fec8b15 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -126,7 +126,7 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe, ], - providers: [{ provide: BASE_URL, useValue: '/fake-api' }, provideI18n()], + providers: [provideI18n()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts index 9866e8eeb4c..643b4bdaf4d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts @@ -100,7 +100,6 @@ describe('DipRequestCreateComponent', () => { selectedItemCountKnown: true, }, }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ConfirmDialogService, useValue: confirmDialogServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts index e852d1b2f82..4a27ddeeed7 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts @@ -208,7 +208,6 @@ describe('AddManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, AddManagementRulesComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index 92f5e8fede4..d6c44aa057f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -128,7 +128,6 @@ describe('AddUpdatePropertyComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, AddUpdatePropertyComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index f258bdd70d7..b943ca88677 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -198,7 +198,6 @@ describe('ArchiveUnitRulesComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ArchiveUnitRulesComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index 016de90ed4a..3fe216bdf61 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -127,7 +127,6 @@ describe('BlockCategoryInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockCategoryInheritanceComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index a49e74c77d9..ec2e7b4f4c2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -149,7 +149,6 @@ describe('BlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockRulesInheritanceComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts index f4293dc2c07..be5a866e246 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts @@ -208,7 +208,6 @@ describe('DeleteUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, DeleteUnitRulesComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index cf692b8d5cc..9d4f47670ad 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -243,7 +243,6 @@ describe('UnlockCategoryInheritanceComponent', () => { imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, UnlockCategoryInheritanceComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: UpdateUnitManagementRuleService, useValue: updateUnitManagementRuleServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts index 1a7ba6970c8..3e1b000d8aa 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts @@ -195,7 +195,6 @@ describe('UnlockRulesInheritanceComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UnlockRulesInheritanceComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: ManagementRulesValidatorService, useValue: managementRulesValidatorServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts index 1b0fc024024..b5bcc1a4dac 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts @@ -208,7 +208,6 @@ describe('UpdateUnitRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UpdateUnitRulesComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index 322e45d480e..7a6bf6917f2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -142,7 +142,6 @@ describe('ManagementRulesComponent', () => { imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ManagementRulesComponent], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: startupServiceStub }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts index 455a07f8764..39047e53a05 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts @@ -86,7 +86,6 @@ describe('TransferRequestModalComponent tests', () => { selectedItemCountKnown: true, }, }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ArchiveApiService, useValue: archiveServiceMock }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index ad64187a9c6..b27968af92f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -194,9 +194,8 @@ describe('ArchiveSearchComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, + { provide: environment, useValue: environment }, ], }) .overrideProvider(MatDialog, { useValue: matDialogSpy }) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts index 5487b8b8dc6..19a8cee35a0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts @@ -49,7 +49,7 @@ describe('SearchCriteriaSaverService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }); httpTestingController = TestBed.inject(HttpTestingController as Type); service = TestBed.inject(SearchCriteriaSaverService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts index 6975bc3de09..a92eb0d4029 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts @@ -98,7 +98,6 @@ describe('SimpleCriteriaSearchComponent', () => { { provide: MatDialog, useValue: matDialogSpy }, { provide: ManagementRulesSharedDataService, useValue: managementRulesSharedDataServiceMock }, { provide: SchemaService, useValue: schemaServiceMock }, - { provide: BASE_URL, useValue: '/fake-api' }, SnackBarService, { provide: ActivatedRoute, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index c3037d66fec..3c07d50fc5c 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -86,7 +86,6 @@ describe('TransferAcknowledgmentComponent', () => { await TestBed.configureTestingModule({ imports: [TransferAcknowledgmentComponent, CdkStep, InjectorModule, LoggerModule.forRoot(), MockDateTimePipe], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts index dd7e1149f9f..cb7caba09dd 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts @@ -121,7 +121,6 @@ describe('ArchiveComponent', () => { { provide: ArchiveApiService, useValue: archiveServiceMock }, { provide: SecurityService, useValue: securityServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, ], }) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts index de2cd1cd82b..1ddb1de865b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts @@ -51,10 +51,7 @@ describe('ArchiveService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ArchiveApiService, useValue: archiveApiService }, - ], + providers: [{ provide: ArchiveApiService, useValue: archiveApiService }], }); service = TestBed.inject(ArchiveService); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts index 687bef28d60..10b02a46e3a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts @@ -129,7 +129,7 @@ describe('ArchiveFacetsService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [provideHttpClient(withInterceptorsFromDi()), { provide: BASE_URL, useValue: '/fake-api' }, ArchiveFacetsService], + providers: [provideHttpClient(withInterceptorsFromDi()), ArchiveFacetsService], }); archiveFacetsService = TestBed.inject(ArchiveFacetsService); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts index f50c5684070..6260dc6c8f2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts @@ -69,7 +69,6 @@ describe('CriteriaSearchComponent', () => { providers: [ TranslateWithOptionalTypeSuffixPipe, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts index 3956fdd2bc9..0d4588a42ac 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts @@ -72,7 +72,6 @@ describe('ErrorResponseModalComponent', () => { provide: MatDialogRef, useValue: matDialogRefSpy, }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MAT_DIALOG_DATA, useValue: { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts index 3da2e45c2e6..4a9f28657dd 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts @@ -50,7 +50,7 @@ describe('PersistentIdentifierSearchComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [MatDialogModule, RouterTestingModule, PersistentIdentifierSearchComponent], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts index fa9e64ef372..15278315b83 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts @@ -43,10 +43,7 @@ describe('ArchiveApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); it('should be created', () => { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index 576c160e0a6..720ab41bc1a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -95,7 +95,6 @@ describe('AddUnitsComponent', () => { imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), AddUnitsComponent], schemas: [NO_ERRORS_SCHEMA], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: { tenantIdentifier: '15', selectedTransaction } }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts index b167825dc7f..22936649e60 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts @@ -103,7 +103,6 @@ describe('ArchivePreviewComponent', () => { MockUnitI18nPipe, ], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: StartupService, useValue: { getPortalUrl: () => '', setTenantIdentifier: () => {} } }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 7b3ec130991..9e189aec3c6 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -49,7 +49,6 @@ describe('Collect ArchiveUnitRulesDetailsTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [InjectorModule, LoggerModule.forRoot(), ArchiveUnitRulesDetailsTabComponent], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 817a9283c49..931b950cf3c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -126,7 +126,7 @@ describe('ArchiveUnitRulesInformationsTabComponent', () => { ArchiveUnitRulesInformationsTabComponent, DateTimeStubPipe, ], - providers: [{ provide: BASE_URL, useValue: '/fake-api' }, provideI18n()], + providers: [provideI18n()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts index 7c1562153a6..006c6a36bbd 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts @@ -129,7 +129,6 @@ describe('CollectObjectGroupDetailsTabComponent', () => { CollectObjectGroupDetailsTabComponent, ], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ArchiveCollectService, useValue: archiveCollectServiceSpy }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index 807f614e662..5be313f8e64 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -170,7 +170,6 @@ describe('ArchiveSearchCollectComponent', () => { providers: [ ArchiveSearchHelperService, ArchiveSharedDataService, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts index af69fbb2a0b..d81aa793b5d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts @@ -49,7 +49,7 @@ describe('SearchCriteriaSaverService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }); httpTestingController = TestBed.inject(HttpTestingController as Type); service = TestBed.inject(SearchCriteriaSaverService); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index 481a68358e3..4f8581dd558 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -65,12 +65,7 @@ describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { TitleAndDescriptionCriteriaSearchCollectComponent, ], schemas: [NO_ERRORS_SCHEMA], - providers: [ - FormBuilder, - { provide: MatDialogRef, useValue: matDialogRefSpy }, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: MatDialog, useValue: matDialogSpy }, - ], + providers: [FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index d4b3784d433..08d16e4d8de 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -70,7 +70,6 @@ describe('UpdateUaMetadataComponent', () => { await TestBed.configureTestingModule({ imports: [UpdateUnitsMetadataComponent], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: MAT_DIALOG_DATA, useValue: { tenantIdentifier: '15', selectedTransaction } }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts index 009e5778542..15ce618e7cf 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts @@ -45,10 +45,7 @@ describe('ProjectService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); it('should be created', () => { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts index 284e2ef8115..4cd52db0692 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts @@ -165,7 +165,6 @@ describe('CreateProjectComponent', () => { ], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts index 88a3addc7ba..11a6d1901c9 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts @@ -157,7 +157,6 @@ describe('ProjectPreviewComponent', () => { ], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index a1d6c4e3a84..599db0b6541 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -138,7 +138,6 @@ describe('TransactionListComponent', () => { }, }, }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: environment, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts index 81935093e8a..20210c66fb6 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts @@ -43,10 +43,7 @@ describe('CustomerApiService Identity', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts index fcdba42fbce..b903a030aaf 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts @@ -45,7 +45,7 @@ describe('GroupApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts index f787e76224f..47260a6c187 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts @@ -45,7 +45,7 @@ describe('UserApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts index 7c1d30959a5..d3de1280736 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts @@ -98,12 +98,7 @@ describe('CustomerService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - CustomerService, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - { provide: SnackBarService, useValue: snackBarSpy }, - ], + providers: [CustomerService, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: snackBarSpy }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index b9aec6409d1..26e811ce1e2 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -270,7 +270,6 @@ describe('CustomerCreateComponent', () => { { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: StartupService, useValue: { getConfigNumberValue: () => 100 } }, { provide: CustomerService, useValue: customerServiceSpy }, { provide: CustomerCreateValidators, useValue: customerCreateValidatorsSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts index 29aedd94dc9..dafdf4a2287 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts @@ -300,10 +300,7 @@ describe('CustomerListService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts index 544c5325d4b..115a6a71d27 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts @@ -97,7 +97,6 @@ describe('IdentityProviderService', () => { providers: [ IdentityProviderService, { provide: SnackBarService, useValue: snackBarSpy }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts index 8dee4a8e75d..eb40d1af5c3 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts @@ -45,7 +45,7 @@ describe('ProviderApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts index fd99fc9ad58..b77f749d480 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts @@ -45,7 +45,7 @@ describe('OwnerApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 882cf1ce8d2..0a7317b1c91 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -74,7 +74,6 @@ describe('OwnerPreviewComponent', () => { ], providers: [ { provide: WINDOW_LOCATION, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, ], diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index c07847c49ff..4e0972aff9e 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -66,7 +66,7 @@ describe('OwnerService', () => { beforeEach(() => { TestBed.configureTestingModule({ - providers: [OwnerService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], + providers: [OwnerService, { provide: SnackBarService, useValue: snackBarSpy }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts index e82bbc1108d..a1e1a4e3967 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts @@ -45,7 +45,7 @@ describe('TenantApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts index d065c023d4b..e5e63eac997 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts @@ -129,7 +129,7 @@ describe('TenantService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [TenantService, { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }], + providers: [TenantService, { provide: SnackBarService, useValue: snackBarSpy }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index b231a01ef70..c0035548051 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -66,7 +66,6 @@ describe('ExternalParamProfilDetailComponent', () => { { provide: ExternalParamProfileService, useValue: { updated: new Subject(), getAllActiveAccessContracts: of() } }, { provide: AuthService, useValue: authServiceMock }, { provide: WINDOW_LOCATION, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: environment, useValue: environment }, ], }) diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts index 03a7a197894..176cea41ce8 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts @@ -46,11 +46,7 @@ describe('ExternalParamProfileService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [ - ExternalParamProfileService, - { provide: SnackBarService, useValue: snackBarSpy }, - { provide: BASE_URL, useValue: '/fake-api' }, - ], + providers: [ExternalParamProfileService, { provide: SnackBarService, useValue: snackBarSpy }], }); service = TestBed.inject(ExternalParamProfileService); }); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts index dae1a6fde85..34e63800d76 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts @@ -81,7 +81,6 @@ describe('UnitsEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', units: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts index 85cbd40d732..0f1e6cb8225 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts @@ -85,7 +85,6 @@ describe('ProfilesEditComponent', () => { { provide: MAT_DIALOG_DATA, useValue: { group: { id: '42', name: 'Test', profileIds: [] } } }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: GroupService, useValue: { patch: () => of({ result: 'test' }) } }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: { listenToEscapeKeyPress: () => EMPTY } }, ], }).compileComponents(); diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts index 9f11642892f..ceb90db35f0 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts @@ -53,7 +53,7 @@ describe('GroupService', () => { TestBed.configureTestingModule({ imports: [], - providers: [GroupService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], + providers: [GroupService, { provide: SnackBarService, useValue: snackBarSpy }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts index ba665f417f5..51d8d4275ab 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts @@ -47,7 +47,7 @@ describe('HierarchyService', () => { TestBed.configureTestingModule({ imports: [], - providers: [HierarchyService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], + providers: [HierarchyService, { provide: SnackBarService, useValue: snackBarSpy }], }); }); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts index 3c9076e6227..06650f20b0b 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts @@ -52,7 +52,7 @@ describe('ProfileService', () => { TestBed.configureTestingModule({ imports: [], - providers: [ProfileService, { provide: SnackBarService, useValue: snackBarSpy }, { provide: BASE_URL, useValue: '/fake-api' }], + providers: [ProfileService, { provide: SnackBarService, useValue: snackBarSpy }], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts index ef69eb4ba34..183e6cba8b6 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts @@ -55,7 +55,6 @@ describe('CustomerSelectService', () => { providers: [ CustomerSelectService, { provide: AuthService, useValue: authStubService }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ENVIRONMENT, useValue: environment }, ], }); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts index 475d762b5c5..0be364e46e7 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts @@ -43,12 +43,7 @@ describe('SubrogationService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ - SubrogationService, - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: WINDOW_LOCATION, useValue: {} }, - { provide: SubrogationApiService, useValue: {} }, - ], + providers: [SubrogationService, { provide: WINDOW_LOCATION, useValue: {} }, { provide: SubrogationApiService, useValue: {} }], }); }); diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts index 10f536873b6..d7d14131a84 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts @@ -45,7 +45,7 @@ describe('UserGenericApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts index d5721d666ee..be51ec70e6d 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts @@ -43,10 +43,7 @@ describe('IngestApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); it('should be created', () => { diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts index cf591c92bf7..ef974227b6a 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts @@ -70,7 +70,6 @@ describe('UploadComponent', () => { { provide: StartupService, useValue: { getReferentialUrl: () => '' } }, DecimalPipe, BytesPipe, - { provide: BASE_URL, useValue: '/fake-api' }, ], }) .overrideTemplate(UploadComponent, '
') diff --git a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts index 63e6448b10a..c6a181e9b74 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts @@ -47,7 +47,7 @@ describe('IngestReferentialService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [IngestReferentialService, { provide: BASE_URL, useValue: '/fake-api' }], + providers: [IngestReferentialService], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts index 40b275911d5..d8b2d03666c 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts @@ -74,7 +74,6 @@ describe('IngestPreviewComponent test:', () => { logbookOperationsReloaded: of([logbookOperation]), }, }, - { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts index c2ad7386a50..e371c3a2041 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts @@ -93,7 +93,6 @@ describe('FileTreeMetadataComponent', () => { FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: APP_BASE_HREF, useValue: '/' }, ], diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index 5a5886378ea..6166ad332c6 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -84,7 +84,6 @@ describe('AppComponent', () => { }, }, { provide: ENVIRONMENT, useValue: environment }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, ], }) diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts index 2b2a8d15b2f..fa4e99149f2 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts @@ -134,7 +134,6 @@ describe('AccessContractCreateComponent', () => { ], providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: AgencyService, useValue: agencyServiceSpy }, { provide: AccessContractService, useValue: accessContractServiceSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts index 4b5ebfa4b26..0e4280a5648 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts @@ -95,7 +95,6 @@ describe('AccessContractNodesTabComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), AccessContractNodesTabComponent], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, { provide: SearchUnitApiService, useValue: unitValueMock }, { provide: MatDialog, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts index a76e99cd898..1b95b66220b 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts @@ -121,7 +121,6 @@ describe.skip('AccessContractNodeUpdateComponent', () => { providers: [ { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MAT_DIALOG_DATA, useValue: { customer: expectedCustomer, logo: null } }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, { provide: AccessContractService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index 476c239d135..25113aa6fd9 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -91,7 +91,6 @@ describe('AccessContractComponent', () => { AccessContractPreviewStub, ], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ApplicationService, useValue: applicationServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts index e2f4161b3e6..74967222a67 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts @@ -98,7 +98,6 @@ describe('AccessionRegisterPreviewComponent', () => { ], providers: [ { provide: AccessionRegistersService, useValue: AccessionRegistersServiceMock }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index 8b02e133696..791baf229ed 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -56,7 +56,6 @@ describe('AgencyListComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [LoggerModule.forRoot(), VitamUICommonTestModule, MatProgressSpinnerModule], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: AuthService, useValue: authServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index 1f44b8681a9..798bb8d28e8 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -100,7 +100,6 @@ describe('AgencyComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, ], schemas: [CUSTOM_ELEMENTS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts index eb86525141e..fe56dfec335 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts @@ -65,7 +65,6 @@ describe('AuditPreviewComponent', () => { await TestBed.configureTestingModule({ providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, { provide: AuditService, useValue: {} }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts index e93c5148082..a5d75b2a384 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts @@ -163,7 +163,6 @@ describe('ContextPermissionTabComponent', () => { ], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: ContextService, useValue: { updated: EMPTY } }, diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts index 89aa58f8497..9cbec1a74a6 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts @@ -42,10 +42,7 @@ describe('AgencyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts index 9d7b45790c7..1f56d0d3f6f 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts @@ -43,10 +43,7 @@ describe('IngestContractApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts index 8f82c754ef5..80b9acdf998 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts @@ -43,10 +43,7 @@ describe('OntologyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts index 5f0823e423c..e5d5cc9536d 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts @@ -44,10 +44,7 @@ describe('OperationApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts index 89aa58f8497..9cbec1a74a6 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts @@ -42,10 +42,7 @@ describe('AgencyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts index 9603f0bdd4e..804b60a4dd2 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts @@ -99,7 +99,6 @@ describe('IngestContractCreateComponent', () => { imports: [IngestContractCreateComponent, VitamUICommonTestModule, LoggerModule.forRoot(), MatButtonToggleModule], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: {} }, { provide: MAT_DIALOG_DATA, useValue: {} }, { provide: IngestContractService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts index 26ad193a6f8..1a392006668 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts @@ -94,7 +94,6 @@ describe('IngestContractAttachmentTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [LoggerModule.forRoot(), IngestContractAttachmentTabComponent], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialog, useValue: {} }, { provide: SearchUnitApiService, useValue: unitValueMock }, { provide: ExternalParametersService, useValue: externalParametersServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts index befc4395c24..3370bd45629 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts @@ -90,7 +90,6 @@ describe.skip('IngestContractNodeUpdateComponent', () => { provide: MAT_DIALOG_DATA, useValue: { data: { ingestContract: 'IC-000001', accessContractId: 'AC-000001', tenantIdentifier: 1 } }, }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: snackBarSpy }, { provide: ENVIRONMENT, useValue: environment }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts index 03f61c5f0ee..395753bf32d 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts @@ -76,7 +76,6 @@ describe('LogbookManagementOperationPreviewComponent', () => { { provide: LogbookManagementOperationService, useValue: logbookManagementOperationServiceMock }, { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index a18cfddbf0e..eeab9c6ba85 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -79,7 +79,6 @@ describe('LogbookOperationDetailComponent', () => { ], providers: [ { provide: LogbookService, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: LogbookDownloadService, useValue: { logbookOperationsReloaded: of([{ id: 'event-01' }]) } }, { provide: AuthService, useValue: {} }, { provide: ActivatedRoute, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts index fcebc3a915e..8a045814a0d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts @@ -109,7 +109,6 @@ describe('ManagementContractCreateComponent', () => { { provide: WINDOW_LOCATION, useValue: window.location }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: MatDialogRef, useValue: matDialogRefSpy }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfirmDialogService, useValue: confirmDialogServiceMock }, ManagementContractToFormGroupConverterService, ], diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index f3c5044aaf6..0355d8b7f0d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -89,7 +89,6 @@ describe('ManagementContractListComponent', () => { providers: [ { provide: MatDialog, useValue: matDialogSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ManagementContractService, useValue: managementContractServiceMock }, { provide: SearchService, useValue: searchServiceeMock }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts index fd2abd7a055..5b51c520d84 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts @@ -115,7 +115,6 @@ describe('ManagementContractInformationTabComponent', () => { ], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts index df31acf4abc..9dde29004db 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts @@ -106,7 +106,6 @@ describe('ManagementContractStorageTabComponent', () => { ], providers: [ FormBuilder, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: MatDialog, useValue: matDialogSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts index 400bdea07f4..79282c27230 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts @@ -105,7 +105,6 @@ describe('GriffinListComponent', () => { await TestBed.configureTestingModule({ imports: [GriffinListComponent, LoggerModule.forRoot()], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: GriffinsService, useValue: griffinsService }, { provide: SnackBarService, useValue: snackBarService }, { provide: StartupService, useValue: startupService }, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts index 7416242fcda..0ea7de08802 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts @@ -83,7 +83,6 @@ describe('PreservationScenarioListComponent', () => { await TestBed.configureTestingModule({ imports: [PreservationScenarioListComponent, LoggerModule.forRoot()], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: PreservationScenariosService, useValue: preservationScenariosService }, { provide: SnackBarService, useValue: snackBarService }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts index 7b063fdb34d..d0fbf195c64 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts @@ -54,7 +54,6 @@ describe('PreservationComponent', () => { await TestBed.configureTestingModule({ imports: [PreservationComponent, LoggerModule.forRoot(), VitamUICommonModule, InjectorModule], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ActivatedRoute, useValue: { diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index f8aa93034ea..93ecca475ba 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -163,7 +163,6 @@ describe('RuleComponent', () => { { provide: AuthService, useValue: authServiceMock }, { provide: ENVIRONMENT, useValue: environment }, { provide: SecurityService, useValue: securityServiceMock }, - { provide: BASE_URL, useValue: '/fake-api' }, ], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index 1ff03ab867e..2bbc62c8b3d 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -107,7 +107,6 @@ describe('SecurisationCheckTabComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [SecurisationCheckTabComponent], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: SecurisationService, useValue: {} }, { diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts index 0ce2848f90e..a69b860c9a8 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts @@ -46,10 +46,7 @@ describe('ReferentialImportService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts index 51b68bf03e7..018f7cbefda 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts @@ -86,7 +86,6 @@ describe('AccountComponent', () => { { provide: BaseUserInfoApiService, useValue: userInfoApiServiceSpy }, { provide: ActivatedRoute, useValue: { data: EMPTY } }, { provide: ENVIRONMENT, useValue: environment }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: location }, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts index 7b514ed8d93..b7c7e663310 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts @@ -45,10 +45,7 @@ describe('AgencyApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts index c161e12e63b..7039d4a69ba 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts @@ -52,7 +52,6 @@ describe('AnalyticsResolver', () => { providers: [ { provide: Router, useValue: {} }, { provide: WINDOW_LOCATION, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: UserApiService, useValue: { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts index 19f5bbdab6d..c8592a7f474 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts @@ -46,10 +46,7 @@ describe('AccessContractApiService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, - { provide: ENVIRONMENT, useValue: environment }, - ], + providers: [{ provide: ENVIRONMENT, useValue: environment }], }); service = TestBed.inject(AccessContractApiService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts index 47b265d80a3..a525700bd2b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts @@ -45,7 +45,7 @@ describe('ApplicationApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts index ada0dc1ec17..051d10de967 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts @@ -45,7 +45,7 @@ describe('LogbookApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts index 9c70303e311..a50cf3bf7cd 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts @@ -46,7 +46,7 @@ describe('OntologyApiService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }); service = TestBed.inject(OntologyApiService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts index 5ae8732a7e7..4c539a2e173 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts @@ -45,7 +45,7 @@ describe('ProfileApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts index 5c07af8532b..b30d2360730 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts @@ -45,7 +45,7 @@ describe('SecurityApiService', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts index 2f0df1b054f..b41daf504ea 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts @@ -47,7 +47,7 @@ describe(SiteApiService.name, () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }); service = TestBed.inject(SiteApiService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts index b768bb446e7..32f6284b329 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts @@ -45,7 +45,6 @@ describe('SubrogationApiService', () => { TestBed.configureTestingModule({ imports: [], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, { provide: AuthService, useValue: {} }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts index 83cf51a3a6f..27deb418ec2 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts @@ -46,7 +46,6 @@ describe('UserApiService', () => { imports: [], providers: [ { provide: AuthService, useValue: {} }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: WINDOW_LOCATION, useValue: {} }, ], }), diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts index b26136aa705..c2c13b11aeb 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts @@ -74,7 +74,6 @@ describe('ApplicationService', () => { { provide: AuthService, useValue: authStubService }, { provide: LOCALE_ID, useValue: 'fr' }, { provide: StartupService, useValue: startupServiceStub }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: ConfigService, useValue: configServiceStub }, ], }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts index 4c89814bbbd..9480cd9e161 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts @@ -99,7 +99,7 @@ describe('ArchiveUnitViewerComponent', () => { await TestBed.configureTestingModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [ObjectViewerModule, ObjectEditorModule, ReactiveFormsModule, LoggerModule.forRoot(), ArchiveUnitViewerComponent], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts index 17c47de7742..efe1fec2fd1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts @@ -63,7 +63,6 @@ describe('ArchiveUnitViewerService', () => { DisplayObjectHelperService, DisplayRuleHelperService, SchemaElementToDisplayRuleService, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: SchemaService, useClass: MockSchemaService }, ], }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts index 92ad8c91759..e99987610f7 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts @@ -48,7 +48,7 @@ describe('EditableFieldComponent', () => { beforeEach(() => TestBed.configureTestingModule({ imports: [VitamUICommonTestModule], - providers: [{ provide: BASE_URL, useValue: '/fake-api' }, provideHttpClientTesting()], + providers: [provideHttpClientTesting()], }), ); beforeEach(() => { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts index e37bcb520df..8fe2081312b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts @@ -101,7 +101,6 @@ describe('ObjectViewerComponent', () => { LayoutService, FavoriteEntryService, DatePipe, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: DisplayObjectService, useClass: PathStrategyDisplayObjectService }, ], }) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts index 17b2f8eaa44..bf1e3cd02ab 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts @@ -45,7 +45,7 @@ describe('OntologyService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [OntologyService, provideHttpClient(withInterceptorsFromDi()), { provide: BASE_URL, useValue: '/fake-api' }], + providers: [OntologyService, provideHttpClient(withInterceptorsFromDi())], }); service = TestBed.inject(OntologyService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts index 7574b29d1d8..4f4246b2c4f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts @@ -71,7 +71,7 @@ describe('GriffinsService', () => { TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [GriffinsService, { provide: GriffinsApiService, useValue: spy }, { provide: BASE_URL, useValue: '/fake-api' }], + providers: [GriffinsService, { provide: GriffinsApiService, useValue: spy }], }); service = TestBed.inject(GriffinsService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts index 35224bf9ac9..9d0a3e4b91a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts @@ -48,7 +48,7 @@ describe('ProfileService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [ProfileService, { provide: BASE_URL, useValue: '/fake-api' }], + providers: [ProfileService], }); httpTestingController = TestBed.inject(HttpTestingController as Type); diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts index e2893230111..619d79b52f3 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts @@ -62,7 +62,6 @@ describe('FilingPlanService', () => { imports: [VitamUICommonModule, InjectorModule, LoggerModule.forRoot()], providers: [ FilingPlanService, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }, { provide: AccessContractService, useValue: accessContractServiceMock }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts index 6fc796df7e0..8583450474d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts @@ -109,7 +109,6 @@ describe('ReclassificationDialogComponent', () => { await TestBed.configureTestingModule({ imports: [MatSnackBarModule, LoggerModule.forRoot()], providers: [ - { provide: BASE_URL, useValue: '/fake-api' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: WINDOW_LOCATION, useValue: window.location }, { diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts index 4588502d972..0687e7db315 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts @@ -72,7 +72,6 @@ describe('ReclassificationDialogService', () => { BaseReclassificationDialogService, { provide: ReclassificationService, useValue: reclassificationServiceSpy }, { provide: TranslateService, useValue: translateServiceSpy }, - { provide: BASE_URL, useValue: '/fake-api' }, { provide: VitamTenantConfigService, useValue: tenantConfigServiceMock, From e4d38c30b3bae77edcfacb892835cab5b09ebf78 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Thu, 27 Aug 2026 19:55:45 +0200 Subject: [PATCH 14/33] Story #16471: Clean code - WIP --- ui/ui-frontend/angular.json | 3 +- .../archive-preview.component.spec.ts | 3 -- ...ive-unit-information-tab.component.spec.ts | 3 -- ...e-unit-rules-details-tab.component.spec.ts | 2 +- ...t-rules-informations-tab.component.spec.ts | 1 - .../dip-request-create.component.spec.ts | 10 +--- .../add-management-rules.component.spec.ts | 4 +- .../add-update-property.component.spec.ts | 5 +- .../archive-unit-rules.component.spec.ts | 13 +---- ...ock-category-inheritance.component.spec.ts | 5 +- .../block-rules-inheritance.component.spec.ts | 5 +- .../delete-unit-rules.component.spec.ts | 4 +- ...ock-category-inheritance.component.spec.ts | 5 +- ...unlock-rules-inheritance.component.spec.ts | 4 +- .../update-unit-rules.component.spec.ts | 4 +- .../management-rules.component.spec.ts | 5 +- .../transfer-request-modal.component.spec.ts | 2 +- .../archive-search.component.spec.ts | 1 - .../search-criteria-list.component.spec.ts | 3 +- .../search-criteria-list.service.spec.ts | 3 +- .../search-criteria-saver.component.spec.ts | 3 +- .../search-criteria-saver.service.spec.ts | 2 +- .../simple-criteria-search.component.spec.ts | 1 - .../transfer-acknowledgment.component.spec.ts | 2 +- .../src/app/archive/archive.component.spec.ts | 1 - .../src/app/archive/archive.service.spec.ts | 2 +- .../archive-facets.service.spec.ts | 2 +- .../criteria-search.component.spec.ts | 12 +---- .../filing-holding-scheme.component.spec.ts | 2 - .../leaves-tree/leaves-tree.component.spec.ts | 2 - .../found-object-modal.component.spec.ts | 5 +- ...istent-identifier-search.component.spec.ts | 4 +- .../app/core/api/archive-api.service.spec.ts | 2 +- .../add-units/add-units.component.spec.ts | 2 +- .../archive-preview.component.spec.ts | 3 -- ...e-unit-rules-details-tab.component.spec.ts | 2 +- ...t-rules-informations-tab.component.spec.ts | 1 - ...object-group-details-tab.component.spec.ts | 3 -- .../archive-search-collect.component.spec.ts | 3 -- .../filing-holding-scheme.component.spec.ts | 2 - .../search-criteria-list.component.spec.ts | 10 +--- .../search-criteria-saver.component.spec.ts | 10 +--- .../search-criteria-saver.service.spec.ts | 2 +- ...-criteria-search-collect.component.spec.ts | 11 +--- .../update-units-metadata.component.spec.ts | 2 +- .../core/api/project-api.service.spec.ts | 2 +- .../create-project.component.spec.ts | 1 - .../project-preview.component.spec.ts | 1 - .../transaction-list.component.spec.ts | 12 +---- .../app/core/api/customer-api.service.spec.ts | 2 +- .../app/core/api/group-api.service.spec.ts | 2 - .../src/app/core/api/user-api.service.spec.ts | 2 - .../src/app/core/customer.service.spec.ts | 2 +- .../customer-create.component.spec.ts | 2 +- .../customer-list.service.spec.ts | 2 +- .../sso-tab/identity-provider.service.spec.ts | 1 - .../sso-tab/provider-api.service.spec.ts | 2 - .../app/customer/owner-api.service.spec.ts | 2 - .../owner-preview.component.spec.ts | 2 +- .../src/app/customer/owner.service.spec.ts | 2 +- .../app/customer/tenant-api.service.spec.ts | 2 - .../src/app/customer/tenant.service.spec.ts | 2 +- ...nal-param-profile-detail.component.spec.ts | 2 +- ...rnal-param-profile-service.service.spec.ts | 2 +- .../units-edit/units-edit.component.spec.ts | 2 +- .../profiles-edit.component.spec.ts | 2 +- .../src/app/group/group.service.spec.ts | 2 +- .../app/hierarchy/hierarchy.service.spec.ts | 2 +- .../src/app/profile/profile.service.spec.ts | 2 +- .../customer-select.service.spec.ts | 2 +- .../subrogation/subrogation.service.spec.ts | 2 +- .../user-generic-api.service.spec.ts | 2 - .../app/core/api/ingest-api.service.spec.ts | 2 +- .../app/core/common/upload.component.spec.ts | 2 +- .../ingest-referential.service.spec.ts | 1 - .../holding-filling-scheme.component.spec.ts | 5 -- .../ingest-preview.component.spec.ts | 2 +- .../file-tree-metadata.component.spec.ts | 2 +- .../pastis-popup-option.component.spec.ts | 12 ++--- .../save-profile.component.spec.ts | 6 +-- .../portal/src/app/app.component.spec.ts | 2 +- .../access-contract-create.component.spec.ts | 9 +--- .../access-contract-list.component.spec.ts | 3 +- ...ccess-contract-nodes-tab.component.spec.ts | 10 +--- ...ess-contract-node-update.component.spec.ts | 11 +--- .../access-contract.component.spec.ts | 8 ++- ...cession-register-preview.component.spec.ts | 12 +---- .../agency-list/agency-list.component.spec.ts | 2 +- .../src/app/agency/agency.component.spec.ts | 13 +---- .../referential/src/app/app.component.spec.ts | 4 +- .../audit-preview.component.spec.ts | 2 +- .../src/app/audit/audit.component.spec.ts | 3 +- .../context-list.component.spec.ts | 5 +- .../context-permission-tab.component.spec.ts | 12 +---- .../src/app/context/context.component.spec.ts | 13 +---- .../app/core/api/context-api.service.spec.ts | 2 +- .../app/core/api/customer-api.service.spec.ts | 4 +- .../api/ingest-contract-api.service.spec.ts | 2 +- ...k-management-operation-api.service.spec.ts | 4 +- .../management-contracts-api.service.spec.ts | 4 +- .../app/core/api/ontology-api.service.spec.ts | 2 +- .../core/api/operation-api.service.spec.ts | 2 +- .../api/security-profile-api.service.spec.ts | 2 +- .../app/core/api/tenant-api.service.spec.ts | 3 +- .../file-format-list.component.spec.ts | 3 +- .../file-format/file-format.component.spec.ts | 6 +-- .../ingest-contract-create.component.spec.ts | 9 +--- ...-contract-attachment-tab.component.spec.ts | 9 +--- ...est-contract-node-update.component.spec.ts | 2 +- .../ingest-contract.component.spec.ts | 5 +- ...gement-operation-preview.component.spec.ts | 2 +- ...ook-management-operation.component.spec.ts | 3 +- ...logbook-operation-detail.component.spec.ts | 4 +- ...nagement-contract-create.component.spec.ts | 3 -- ...management-contract-list.component.spec.ts | 4 +- ...contract-information-tab.component.spec.ts | 4 +- ...agement-contract-preview.component.spec.ts | 2 - ...ent-contract-storage-tab.component.spec.ts | 12 +---- .../management-contract.component.spec.ts | 2 - .../ontology-list.component.spec.ts | 3 +- .../schema-list/schema-list.component.spec.ts | 3 +- .../app/ontology/ontology.component.spec.ts | 6 +-- .../griffin-list.component.spec.ts | 2 +- ...eservation-scenario-list.component.spec.ts | 2 +- .../preservation.component.spec.ts | 2 +- .../probative-value.component.spec.ts | 3 +- .../rule-list/rule-list.component.spec.ts | 3 +- .../src/app/rule/rule.component.spec.ts | 5 -- .../securisation-check-tab.component.spec.ts | 2 +- .../security-profile-list.component.spec.ts | 3 +- .../security-profile.component.spec.ts | 6 +-- .../referential-import-api.service.spec.ts | 2 +- .../modules/account/account.component.spec.ts | 2 +- .../modules/account/account.service.spec.ts | 3 +- .../agencies/agency-api.service.spec.ts | 2 +- .../analytics-resolver.service.spec.ts | 2 +- .../api/access-contract-api.service.spec.ts | 9 +++- .../api/application-api.service.spec.ts | 2 - .../modules/api/logbook-api.service.spec.ts | 2 - .../modules/api/ontology-api.service.spec.ts | 1 - .../modules/api/profile-api.service.spec.ts | 2 - .../modules/api/security-api.service.spec.ts | 2 - .../app/modules/api/site-api.service.spec.ts | 1 - .../api/subrogation-api.service.spec.ts | 2 +- .../app/modules/api/user-api.service.spec.ts | 2 +- .../app/modules/application.service.spec.ts | 1 - .../archive-unit-viewer.component.spec.ts | 1 - .../archive-unit-viewer.service.spec.ts | 1 - .../editable-field.component.spec.ts | 1 - .../object-viewer.component.spec.ts | 1 - .../modules/ontology/ontology.service.spec.ts | 1 - .../griffins/griffins-api.service.spec.ts | 7 ++- .../griffins/griffins.service.spec.ts | 1 - ...preservation-scenarios-api.service.spec.ts | 6 +-- .../modules/services/profile.service.spec.ts | 1 - .../subrogation-snack-bar.component.spec.ts | 3 +- .../subrogation/subrogation.service.spec.ts | 2 - .../filing-plan/filing-plan.service.spec.ts | 1 - .../reclassification-dialog.component.spec.ts | 2 +- .../reclassification-dialog.service.spec.ts | 1 - .../projects/vitamui-library/test.ts | 51 +++++++++++++++++++ 161 files changed, 201 insertions(+), 427 deletions(-) create mode 100644 ui/ui-frontend/projects/vitamui-library/test.ts diff --git a/ui/ui-frontend/angular.json b/ui/ui-frontend/angular.json index c11a31699f0..0ba36521817 100644 --- a/ui/ui-frontend/angular.json +++ b/ui/ui-frontend/angular.json @@ -386,7 +386,8 @@ "options": { "tsConfig": "projects/vitamui-library/tsconfig.spec.json", "setupFiles": [ - "test.ts" + "test.ts", + "projects/vitamui-library/test.ts" ], "outputFile": "junit/vitamui-library.xml" } diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index ef99607c6aa..50f3b5c14fa 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -42,10 +42,8 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { - BASE_URL, DescriptionLevel, ENVIRONMENT, InjectorModule, @@ -103,7 +101,6 @@ describe('ArchivePreviewComponent', () => { MatSidenavModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, MatIconModule, VitamUICommonModule, InjectorModule, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts index 88aa0ae706c..e78341c537e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-information-tab/archive-unit-information-tab.component.spec.ts @@ -46,14 +46,12 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; import { AccessContract, AccessContractService, ApiUnitObject, - BASE_URL, DataComponent, DescriptionLevel, ENVIRONMENT, @@ -131,7 +129,6 @@ describe('ArchiveUnitInformationTabComponent', () => { MatSidenavModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, MatIconModule, BrowserAnimationsModule, DataComponent, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index b3dabade9d3..e4d901d2e16 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -38,7 +38,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, Unit, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, Unit, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 3112fec8b15..9e35ba62616 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -38,7 +38,6 @@ import { Directive, Input, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { - BASE_URL, InheritedPropertyDto, InjectorModule, LoggerModule, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts index 643b4bdaf4d..5781c3ff5c8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/dip-request-create/dip-request-create.component.spec.ts @@ -40,15 +40,7 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; -import { - BASE_URL, - ConfirmDialogService, - InjectorModule, - LoggerModule, - StartupService, - UsageVersionEnum, - WINDOW_LOCATION, -} from 'vitamui-library'; +import { ConfirmDialogService, InjectorModule, LoggerModule, StartupService, UsageVersionEnum, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveApiService } from '../../../../core/api/archive-api.service'; import { DipRequestCreateComponent } from './dip-request-create.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts index 4a27ddeeed7..e12205d4bd1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.spec.ts @@ -37,13 +37,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; import { - BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, @@ -205,7 +203,7 @@ describe('AddManagementRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, AddManagementRulesComponent], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, AddManagementRulesComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts index d6c44aa057f..62d101ed457 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-update-property/add-update-property.component.spec.ts @@ -37,10 +37,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { AddUpdatePropertyComponent } from './add-update-property.component'; @@ -125,7 +124,7 @@ describe('AddUpdatePropertyComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, AddUpdatePropertyComponent], + imports: [InjectorModule, LoggerModule.forRoot(), AddUpdatePropertyComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts index b943ca88677..3e2145edaa2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/archive-unit-rules.component.spec.ts @@ -37,18 +37,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { of } from 'rxjs'; -import { - BASE_URL, - InjectorModule, - LoggerModule, - SearchCriteriaDto, - Tenant, - TenantSelectionService, - WINDOW_LOCATION, -} from 'vitamui-library'; +import { InjectorModule, LoggerModule, SearchCriteriaDto, Tenant, TenantSelectionService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { UpdateUnitManagementRuleService } from '../../../../common-services/update-unit-management-rule.service'; import { RuleTypeEnum } from '../../../../models/rule-type-enum'; @@ -195,7 +186,7 @@ describe('ArchiveUnitRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ArchiveUnitRulesComponent], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), ArchiveUnitRulesComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts index 3fe216bdf61..5a497657b00 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-category-inheritance/block-category-inheritance.component.spec.ts @@ -37,10 +37,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; import { ActionsRules, ManagementRules, RuleActionsEnum, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; @@ -124,7 +123,7 @@ describe('BlockCategoryInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockCategoryInheritanceComponent], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, BlockCategoryInheritanceComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts index ec2e7b4f4c2..5fecf2875cf 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/block-rules-inheritance/block-rules-inheritance.component.spec.ts @@ -37,11 +37,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, Rule, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, Rule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../../../models/ruleAction.interface'; import { BlockRulesInheritanceComponent } from './block-rules-inheritance.component'; @@ -146,7 +145,7 @@ describe('BlockRulesInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, BlockRulesInheritanceComponent], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, BlockRulesInheritanceComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts index be5a866e246..f586d57ba09 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/delete-unit-rules/delete-unit-rules.component.spec.ts @@ -37,13 +37,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; import { - BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, @@ -205,7 +203,7 @@ describe('DeleteUnitRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, DeleteUnitRulesComponent], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, DeleteUnitRulesComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts index 9d4f47670ad..71c27c0f556 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-category-inheritance/unlock-category-inheritance.component.spec.ts @@ -37,10 +37,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, PagedResult, SearchCriteriaDto, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { UpdateUnitManagementRuleService } from '../../../../../common-services/update-unit-management-rule.service'; import { RuleTypeEnum } from '../../../../../models/rule-type-enum'; @@ -240,7 +239,7 @@ describe('UnlockCategoryInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), RouterTestingModule, UnlockCategoryInheritanceComponent], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), UnlockCategoryInheritanceComponent], providers: [ FormBuilder, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts index 3e1b000d8aa..ed6cdd6359e 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/unlock-rules-inheritance/unlock-rules-inheritance.component.spec.ts @@ -36,13 +36,11 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; -import { RouterTestingModule } from '@angular/router/testing'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; import { - BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, @@ -192,7 +190,7 @@ describe('UnlockRulesInheritanceComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UnlockRulesInheritanceComponent], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, UnlockRulesInheritanceComponent], providers: [ FormBuilder, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts index b5bcc1a4dac..e08ff319cce 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/update-unit-rules/update-unit-rules.component.spec.ts @@ -37,13 +37,11 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { UpdateUnitManagementRuleService } from 'projects/archive-search/src/app/archive/common-services/update-unit-management-rule.service'; import { ManagementRulesValidatorService } from 'projects/archive-search/src/app/archive/validators/management-rules-validator.service'; import { ManagementRulesSharedDataService } from 'projects/archive-search/src/app/core/management-rules-shared-data.service'; import { Observable, of } from 'rxjs'; import { - BASE_URL, CriteriaDataType, CriteriaOperator, InjectorModule, @@ -205,7 +203,7 @@ describe('UpdateUnitRulesComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, RouterTestingModule, UpdateUnitRulesComponent], + imports: [InjectorModule, LoggerModule.forRoot(), VitamUICommonTestModule, UpdateUnitRulesComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts index 7a6bf6917f2..003ff3bb1e2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/management-rules.component.spec.ts @@ -38,9 +38,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, SearchCriteriaDto, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, SearchCriteriaDto, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { ManagementRulesSharedDataService } from '../../../../core/management-rules-shared-data.service'; import { ArchiveService } from '../../../archive.service'; import { ActionsRules, ManagementRules, RuleCategoryAction } from '../../../models/ruleAction.interface'; @@ -139,7 +138,7 @@ describe('ManagementRulesComponent', () => { }; await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, ManagementRulesComponent], + imports: [InjectorModule, LoggerModule.forRoot(), ManagementRulesComponent], providers: [ FormBuilder, { provide: StartupService, useValue: startupServiceStub }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts index 39047e53a05..30433e409e3 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/transfer-request-modal/transfer-request-modal.component.spec.ts @@ -40,7 +40,7 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService, InjectorModule, LoggerModule, UsageVersionEnum, WINDOW_LOCATION } from 'vitamui-library'; +import { ConfirmDialogService, InjectorModule, LoggerModule, UsageVersionEnum, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveApiService } from '../../../../core/api/archive-api.service'; import { TransferRequestModalComponent } from './transfer-request-modal.component'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index b27968af92f..a429aa1758d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -47,7 +47,6 @@ import { ActivatedRoute, Params, Router } from '@angular/router'; import { environment } from 'projects/archive-search/src/environments/environment'; import { of } from 'rxjs'; import { - BASE_URL, InjectorModule, LoggerModule, PagedResult, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts index 6e0cdf27593..a56be4d215b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts @@ -39,7 +39,6 @@ import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { CriteriaDataType, @@ -83,7 +82,7 @@ describe('SearchCriteriaListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, SearchCriteriaListComponent, MockTruncatePipe], + imports: [InjectorModule, LoggerModule.forRoot(), SearchCriteriaListComponent, MockTruncatePipe], providers: [ ArchiveSharedDataService, DatePipe, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts index a220c89582c..bc54f2318b6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.service.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { InjectorModule } from 'vitamui-library'; import { ArchiveApiService } from '../../../core/api/archive-api.service'; @@ -69,7 +68,7 @@ describe('SearchCriteriaListService', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [InjectorModule, RouterTestingModule], + imports: [InjectorModule], providers: [ { provide: ArchiveApiService, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts index 580bc03ff46..4449d22bda2 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -41,7 +41,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { CriteriaDataType, @@ -87,7 +86,7 @@ describe('SearchCriteriaSaverComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [InjectorModule, LoggerModule.forRoot(), RouterTestingModule, SearchCriteriaSaverComponent, MockTruncatePipe], + imports: [InjectorModule, LoggerModule.forRoot(), SearchCriteriaSaverComponent, MockTruncatePipe], providers: [ FormBuilder, ArchiveSharedDataService, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts index 19a8cee35a0..4c00acc0df1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-saver/search-criteria-saver.service.spec.ts @@ -37,7 +37,7 @@ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, SearchCriteriaHistory } from 'vitamui-library'; +import { SearchCriteriaHistory } from 'vitamui-library'; import { SearchCriteriaSaverService } from './search-criteria-saver.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts index a92eb0d4029..635bbb69da1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.spec.ts @@ -40,7 +40,6 @@ import { MatDialog } from '@angular/material/dialog'; import { BehaviorSubject, of } from 'rxjs'; import { AgenciesModule, - BASE_URL, InjectorModule, ItemNode, LoggerModule, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts index 3c07d50fc5c..f74a968beae 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/transfer-acknowledgment/transfer-acknowledgment.component.spec.ts @@ -38,7 +38,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { BytesPipe, InjectorModule, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveService } from '../../archive.service'; import { TransferAcknowledgmentComponent } from './transfer-acknowledgment.component'; import { DecimalPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts index cb7caba09dd..3179bd67d1f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.spec.ts @@ -45,7 +45,6 @@ import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; import { AccessContract, - BASE_URL, InjectorModule, LoggerModule, SearchBarComponent, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts index 1ddb1de865b..df147276199 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.service.spec.ts @@ -37,7 +37,7 @@ import { TestBed } from '@angular/core/testing'; import { ArchiveService } from './archive.service'; -import { BASE_URL, LoggerModule, Unit } from 'vitamui-library'; +import { LoggerModule, Unit } from 'vitamui-library'; import { ArchiveApiService } from '../core/api/archive-api.service'; import { vi } from 'vitest'; import { of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts index 10b02a46e3a..f97af347019 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/common-services/archive-facets.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule, ResultFacet, ResultFacetList } from 'vitamui-library'; +import { LoggerModule, ResultFacet, ResultFacetList } from 'vitamui-library'; import { ArchiveFacetsService } from './archive-facets.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts index 6260dc6c8f2..884eb21ae16 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/criteria-search/criteria-search.component.spec.ts @@ -37,10 +37,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; import { - BASE_URL, InjectorModule, LoggerModule, SearchCriteriaTypeEnum, @@ -57,15 +55,7 @@ describe('CriteriaSearchComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - InjectorModule, - RouterTestingModule, - VitamUICommonTestModule, - BrowserAnimationsModule, - LoggerModule.forRoot(), - RouterTestingModule, - CriteriaSearchComponent, - ], + imports: [InjectorModule, VitamUICommonTestModule, BrowserAnimationsModule, LoggerModule.forRoot(), CriteriaSearchComponent], providers: [ TranslateWithOptionalTypeSuffixPipe, { provide: WINDOW_LOCATION, useValue: window.location }, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts index db7a6eb0e73..a7c32444a56 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -41,7 +41,6 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { FilingHoldingSchemeNode, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; @@ -71,7 +70,6 @@ describe('FilingHoldingSchemeComponent', () => { MatSidenavModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, FilingHoldingSchemeComponent, ], providers: [ diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts index 9d22b4d5e54..419f0393e62 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/leaves-tree/leaves-tree.component.spec.ts @@ -39,7 +39,6 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule, MatTreeNestedDataSource } from '@angular/material/tree'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { ConfigurationsApiService, @@ -117,7 +116,6 @@ describe('LeavesTreeComponent', () => { MatSidenavModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, LeavesTreeComponent, ], providers: [ diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts index 0d4588a42ac..afb0d38c8cd 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/found-object-modal/found-object-modal.component.spec.ts @@ -36,10 +36,9 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; -import { BASE_URL, LoggerModule, ObjectQualifierType } from 'vitamui-library'; +import { LoggerModule, ObjectQualifierType } from 'vitamui-library'; import { FoundObjectModalComponent } from './found-object-modal.component'; class FakeTranslateLoader implements TranslateLoader { @@ -66,7 +65,7 @@ describe('ErrorResponseModalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [LoggerModule.forRoot(), RouterTestingModule, FoundObjectModalComponent], + imports: [LoggerModule.forRoot(), FoundObjectModalComponent], providers: [ { provide: MatDialogRef, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts index 4a9f28657dd..74df0cdbe2f 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/persistent-identifier-search/persistent-identifier-search.component.spec.ts @@ -37,8 +37,6 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; -import { BASE_URL } from 'vitamui-library'; import { PersistentIdentifierSearchComponent } from './persistent-identifier-search.component'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -49,7 +47,7 @@ describe('PersistentIdentifierSearchComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [MatDialogModule, RouterTestingModule, PersistentIdentifierSearchComponent], + imports: [MatDialogModule, PersistentIdentifierSearchComponent], providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts index 15278315b83..6c95213f7dd 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/core/api/archive-api.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { ArchiveApiService } from './archive-api.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts index 720ab41bc1a..6873e3da59d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/add-units/add-units.component.spec.ts @@ -39,7 +39,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { BASE_URL, BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; +import { BytesPipe, InjectorModule, LoggerModule, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { AddUnitsComponent } from './add-units.component'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { DecimalPipe } from '@angular/common'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts index 22936649e60..cb57aa08aa2 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-preview.component.spec.ts @@ -43,10 +43,8 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabChangeEvent } from '@angular/material/tabs'; import { MatTreeModule } from '@angular/material/tree'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { - BASE_URL, DescriptionLevel, ENVIRONMENT, InjectorModule, @@ -96,7 +94,6 @@ describe('ArchivePreviewComponent', () => { MatSidenavModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, MatIconModule, ArchivePreviewComponent, MockTruncatePipe, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts index 9e189aec3c6..a268afd9668 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-details-tab.component.spec.ts @@ -37,7 +37,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { environment } from 'projects/archive-search/src/environments/environment'; -import { BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-details-tab.component'; describe('Collect ArchiveUnitRulesDetailsTabComponent', () => { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts index 931b950cf3c..dd48564c6ff 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/archive-unit-rules-details-tab/archive-unit-rules-informations-tab/archive-unit-rules-informations-tab.component.spec.ts @@ -40,7 +40,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ArchiveUnitRulesInformationsTabComponent } from './archive-unit-rules-informations-tab.component'; import { - BASE_URL, InheritedPropertyDto, InjectorModule, LoggerModule, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts index 006c6a36bbd..d0cdd9197a2 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-preview/collect-object-group-details-tab/collect-object-group-details-tab.component.spec.ts @@ -38,12 +38,10 @@ import { vi } from 'vitest'; import { Clipboard } from '@angular/cdk/clipboard'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/collect/src/environments/environment'; import { of } from 'rxjs'; import { ApiUnitObject, - BASE_URL, DescriptionLevel, ENVIRONMENT, FileInfoDto, @@ -124,7 +122,6 @@ describe('CollectObjectGroupDetailsTabComponent', () => { BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, BrowserAnimationsModule, CollectObjectGroupDetailsTabComponent, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index 5be313f8e64..dec5bfa2a4e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -40,11 +40,9 @@ import { MatDialog } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Params, Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/collect/src/environments/environment'; import { of } from 'rxjs'; import { - BASE_URL, ConfigService, DiscussionIconComponent, DiscussionPanelComponent, @@ -164,7 +162,6 @@ describe('ArchiveSearchCollectComponent', () => { LoggerModule.forRoot(), MatMenuModule, MatSidenavModule, - RouterTestingModule, ...extraImports, ], providers: [ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts index 3514cf547e0..70eb756d6e4 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.spec.ts @@ -41,7 +41,6 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/collect/src/environments/environment.prod'; import { of } from 'rxjs'; import { FilingHoldingSchemeNode, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; @@ -125,7 +124,6 @@ describe('FilingHoldingSchemeComponent', () => { MatSidenavModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, FilingHoldingSchemeComponent, ], providers: [ diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts index b03f4660d30..77233e580f5 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts @@ -40,7 +40,6 @@ import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/collect/src/environments/environment'; import { of } from 'rxjs'; import { @@ -87,14 +86,7 @@ describe('SearchCriteriaListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - BrowserAnimationsModule, - InjectorModule, - LoggerModule.forRoot(), - RouterTestingModule, - SearchCriteriaListComponent, - MockTruncatePipe, - ], + imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), SearchCriteriaListComponent, MockTruncatePipe], providers: [ ArchiveSharedDataService, DatePipe, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts index 8528d1335e0..5494da903de 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.component.spec.ts @@ -42,7 +42,6 @@ import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { environment } from 'projects/collect/src/environments/environment'; import { of } from 'rxjs'; import { @@ -90,14 +89,7 @@ describe('SearchCriteriaSaverComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - BrowserAnimationsModule, - InjectorModule, - LoggerModule.forRoot(), - RouterTestingModule, - SearchCriteriaSaverComponent, - MockTruncatePipe, - ], + imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), SearchCriteriaSaverComponent, MockTruncatePipe], providers: [ FormBuilder, ArchiveSharedDataService, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts index d81aa793b5d..255efc55aad 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-saver/search-criteria-saver.service.spec.ts @@ -38,7 +38,7 @@ import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, SearchCriteriaHistory } from 'vitamui-library'; +import { SearchCriteriaHistory } from 'vitamui-library'; import { SearchCriteriaSaverService } from '../../services/search-criteria-saver.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts index 4f8581dd558..8bcb80d0c11 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/title-and-description-criteria-search-collect/title-and-description-criteria-search-collect.component.spec.ts @@ -38,8 +38,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; -import { BASE_URL, InjectorModule, LoggerModule } from 'vitamui-library'; +import { InjectorModule, LoggerModule } from 'vitamui-library'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TitleAndDescriptionCriteriaSearchCollectComponent } from './title-and-description-criteria-search-collect.component'; @@ -57,13 +56,7 @@ describe('TitleAndDescriptionCriteriaSearchCollectComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [ - BrowserAnimationsModule, - InjectorModule, - LoggerModule.forRoot(), - RouterTestingModule, - TitleAndDescriptionCriteriaSearchCollectComponent, - ], + imports: [BrowserAnimationsModule, InjectorModule, LoggerModule.forRoot(), TitleAndDescriptionCriteriaSearchCollectComponent], schemas: [NO_ERRORS_SCHEMA], providers: [FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }], }).compileComponents(); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts index 08d16e4d8de..4e5d7a8ab4d 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.spec.ts @@ -36,7 +36,7 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { BASE_URL, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; +import { Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { UpdateUnitsMetadataComponent } from './update-units-metadata.component'; const selectedTransaction: Transaction = { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts index 15ce618e7cf..f76a3195ad7 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/core/api/project-api.service.spec.ts @@ -36,7 +36,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../../environments/environment'; import { ProjectsApiService } from './project-api.service'; diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts index 4cd52db0692..047f7a52918 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/create-project/create-project.component.spec.ts @@ -43,7 +43,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { environment } from 'projects/collect/src/environments/environment'; import { of } from 'rxjs'; import { - BASE_URL, ENVIRONMENT, FlowType, InjectorModule, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts index 11a6d1901c9..18b8d6b3d40 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-preview/project-preview.component.spec.ts @@ -45,7 +45,6 @@ import { BrowserModule } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute, Router } from '@angular/router'; import { - BASE_URL, FilingPlanService, LoggerModule, PaginatedResponse, diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts index 599db0b6541..aece3b24479 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.spec.ts @@ -42,9 +42,8 @@ import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, StartupService, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, StartupService, Transaction, TransactionStatus, WINDOW_LOCATION } from 'vitamui-library'; import { environment } from '../../../../../../archive-search/src/environments/environment'; import { TransactionResolver } from '../transaction-resolver.service'; import { TransactionsService } from '../transactions.service'; @@ -110,14 +109,7 @@ describe('TransactionListComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - InjectorModule, - MatSidenavModule, - BrowserAnimationsModule, - LoggerModule.forRoot(), - RouterTestingModule, - TransactionListComponent, - ], + imports: [InjectorModule, MatSidenavModule, BrowserAnimationsModule, LoggerModule.forRoot(), TransactionListComponent], providers: [ DatePipe, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts index 20210c66fb6..5bf6aec080f 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/customer-api.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { CustomerApiService } from './customer-api.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts index b903a030aaf..0e8cac947a5 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/group-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from 'vitamui-library'; import { GroupApiService } from './group-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts index 47260a6c187..0e833cbc5c8 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/api/user-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from 'vitamui-library'; import { UserApiService } from './user-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts index d3de1280736..4b8e51408de 100644 --- a/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/core/customer.service.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Customer, ENVIRONMENT, LoggerModule, Operators, OtpState, SnackBarService } from 'vitamui-library'; +import { CriteriaSearchQuery, Customer, ENVIRONMENT, LoggerModule, Operators, OtpState, SnackBarService } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { HttpTestingController } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts index 26e811ce1e2..487ed21f9db 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-create/customer-create.component.spec.ts @@ -45,7 +45,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService, CountryService, LoggerModule, OtpState, StartupService, WINDOW_LOCATION } from 'vitamui-library'; +import { ConfirmDialogService, CountryService, LoggerModule, OtpState, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { CustomerService } from '../../core/customer.service'; import { OwnerFormValidators } from '../owner-form/owner-form.validators'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts index dafdf4a2287..7a208430d7e 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-list/customer-list.service.spec.ts @@ -37,7 +37,7 @@ import { HttpTestingController } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, Customer, Direction, ENVIRONMENT, LoggerModule, OtpState, PageRequest } from 'vitamui-library'; +import { Customer, Direction, ENVIRONMENT, LoggerModule, OtpState, PageRequest } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { CustomerListService } from './customer-list.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts index 115a6a71d27..1ca4f971411 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/identity-provider.service.spec.ts @@ -37,7 +37,6 @@ import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { - BASE_URL, CriteriaSearchQuery, ENVIRONMENT, IdentityProvider, diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts index eb40d1af5c3..70e7aaf8aa9 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer-preview/sso-tab/provider-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from 'vitamui-library'; import { ProviderApiService } from './provider-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts index b77f749d480..fcef0ea0daa 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from 'vitamui-library'; import { OwnerApiService } from './owner-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts index 0a7317b1c91..8296880e854 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.spec.ts @@ -40,7 +40,7 @@ import { MatMenuModule } from '@angular/material/menu'; import { MatTabsModule } from '@angular/material/tabs'; import { EMPTY } from 'rxjs'; -import { BASE_URL, ENVIRONMENT, LoggerModule, SnackBarService, WINDOW_LOCATION } from 'vitamui-library'; +import { ENVIRONMENT, LoggerModule, SnackBarService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../environments/environment'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts index 4e0972aff9e..fd9c1cc347c 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner.service.spec.ts @@ -38,7 +38,7 @@ import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; -import { BASE_URL, Owner, SnackBarService } from 'vitamui-library'; +import { Owner, SnackBarService } from 'vitamui-library'; import { OwnerService } from './owner.service'; const expectedOwner: Owner = { diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts index a1e1a4e3967..90d46317169 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from 'vitamui-library'; import { TenantApiService } from './tenant-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts index e5e63eac997..4d084ef7e2f 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/tenant.service.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Operators, Owner, SnackBarService, Tenant } from 'vitamui-library'; +import { CriteriaSearchQuery, Operators, Owner, SnackBarService, Tenant } from 'vitamui-library'; import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts index c0035548051..9928dce28c3 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-detail/external-param-profile-detail.component.spec.ts @@ -37,7 +37,7 @@ import { Component, Input } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of, Subject } from 'rxjs'; -import { AuthService, BASE_URL, ExternalParamProfile, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthService, ExternalParamProfile, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { ExternalParamProfileService } from '../external-param-profile.service'; import { ExternalParamProfileDetailComponent } from './external-param-profile-detail.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts index 176cea41ce8..cc438e04c0b 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile-service.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule, SnackBarService } from 'vitamui-library'; +import { LoggerModule, SnackBarService } from 'vitamui-library'; import { ExternalParamProfileService } from './external-param-profile.service'; describe('ExternalParamProfileService', () => { diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts index 34e63800d76..82e3da04664 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/information-tab/units-edit/units-edit.component.spec.ts @@ -40,7 +40,7 @@ import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { GroupService } from '../../../group.service'; import { UnitsEditComponent } from './units-edit.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts index 0f1e6cb8225..bdea1ae82cb 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/profiles-tab/profiles-edit/profiles-edit.component.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ConfirmDialogService } from 'vitamui-library'; +import { ConfirmDialogService } from 'vitamui-library'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts index ceb90db35f0..6d638d25650 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.service.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, CriteriaSearchQuery, Direction, Group, Operators, PageRequest, SnackBarService } from 'vitamui-library'; +import { CriteriaSearchQuery, Direction, Group, Operators, PageRequest, SnackBarService } from 'vitamui-library'; import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts index 51d8d4275ab..68535715eb3 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.service.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { BASE_URL, SnackBarService } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; import { TestBed } from '@angular/core/testing'; import { HierarchyService } from './hierarchy.service'; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts index 06650f20b0b..2fe2f7fe8ea 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.service.spec.ts @@ -38,7 +38,7 @@ import { HttpTestingController } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { Type } from '@angular/core'; -import { BASE_URL, Profile, SnackBarService } from 'vitamui-library'; +import { Profile, SnackBarService } from 'vitamui-library'; import { ProfileService } from './profile.service'; describe('ProfileService', () => { diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts index 183e6cba8b6..7013e0957c1 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/customer-select.service.spec.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AuthService, BASE_URL, CriteriaSearchQuery, ENVIRONMENT, LoggerModule, Operators } from 'vitamui-library'; +import { AuthService, CriteriaSearchQuery, ENVIRONMENT, LoggerModule, Operators } from 'vitamui-library'; import { environment } from './../../environments/environment'; import { HttpTestingController } from '@angular/common/http/testing'; diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts index 0be364e46e7..3b7d24d4d2e 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogation.service.spec.ts @@ -36,7 +36,7 @@ */ import { inject, TestBed } from '@angular/core/testing'; -import { BASE_URL, SubrogationApiService, WINDOW_LOCATION } from 'vitamui-library'; +import { SubrogationApiService, WINDOW_LOCATION } from 'vitamui-library'; import { SubrogationService } from './subrogation.service'; describe('SubrogationService', () => { diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts index d7d14131a84..2ee5aa01fd4 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/user-generic-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from 'vitamui-library'; import { UserGenericApiService } from './user-generic-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts index be51ec70e6d..6f2ee0dfe80 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/api/ingest-api.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { IngestApiService } from './ingest-api.service'; diff --git a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts index ef974227b6a..a5bad846693 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/common/upload.component.spec.ts @@ -39,7 +39,7 @@ import { FormBuilder } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { MatProgressBarModule } from '@angular/material/progress-bar'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, BytesPipe, ConfirmDialogService, LoggerModule, StartupService } from 'vitamui-library'; +import { BytesPipe, ConfirmDialogService, LoggerModule, StartupService } from 'vitamui-library'; import { UploadComponent } from './upload.component'; import { UploadService } from './upload.service'; diff --git a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts index c6a181e9b74..cd4d8cc3ba0 100644 --- a/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/core/service/ingest-referential.service.spec.ts @@ -37,7 +37,6 @@ import { HttpTestingController } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { inject, TestBed } from '@angular/core/testing'; -import { BASE_URL } from 'vitamui-library'; import { IngestReferentialService } from './ingest-referential.service'; describe('IngestReferentialService', () => { diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts index c427cf982f9..cd900118fc7 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.spec.ts @@ -39,7 +39,6 @@ import { FormBuilder } from '@angular/forms'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; import { Component } from '@angular/core'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; @@ -62,10 +61,8 @@ import { HoldingFillingSchemeComponent } from './holding-filling-scheme.componen MatMenuModule, MatSidenavModule, InjectorModule, - RouterTestingModule, VitamUICommonTestModule, BrowserAnimationsModule, - RouterTestingModule, MatDialogModule, ], }) @@ -91,11 +88,9 @@ describe('HoldingFilingSchemeComponent', () => { MatMenuModule, MatSidenavModule, InjectorModule, - RouterTestingModule, VitamUICommonTestModule, BrowserAnimationsModule, LoggerModule.forRoot(), - RouterTestingModule, SearchBarComponent, MatDialogModule, HoldingFillingSchemeComponent, diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts index d8b2d03666c..d0a2d5f0eec 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-preview/ingest-preview.component.spec.ts @@ -38,7 +38,7 @@ import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatMenuModule } from '@angular/material/menu'; import { of } from 'rxjs'; -import { BASE_URL, LogbookService } from 'vitamui-library'; +import { LogbookService } from 'vitamui-library'; import { LogbookOperation } from '../../models/logbook-event.interface'; import { IngestService } from '../ingest.service'; import { IngestPreviewComponent } from './ingest-preview.component'; diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts index e371c3a2041..99c45f50828 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.spec.ts @@ -39,7 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { RouterModule } from '@angular/router'; -import { BASE_URL, LoggerModule, ProfileService, WINDOW_LOCATION } from 'vitamui-library'; +import { LoggerModule, ProfileService, WINDOW_LOCATION } from 'vitamui-library'; import { PastisApiService } from '../../../core/api/api.pastis.service'; import { PastisConfiguration } from '../../../core/classes/pastis-configuration'; import { FileService } from '../../../core/services/file.service'; diff --git a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts index 921748a7459..2d313c8e596 100644 --- a/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/shared/pastis-popup-option/pastis-popup-option.component.spec.ts @@ -36,9 +36,8 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, SnackBarService } from 'vitamui-library'; +import { SnackBarService } from 'vitamui-library'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { PastisPopupOptionComponent } from './pastis-popup-option.component'; @@ -54,13 +53,8 @@ describe('PastisPopupOptionComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [RouterTestingModule, PastisPopupOptionComponent], - providers: [ - PastisConfiguration, - { provide: BASE_URL, useValue: '/pastis-api' }, - { provide: MatDialog, useValue: matDialogSpy }, - { provide: SnackBarService, useValue: {} }, - ], + imports: [PastisPopupOptionComponent], + providers: [PastisConfiguration, { provide: MatDialog, useValue: matDialogSpy }, { provide: SnackBarService, useValue: {} }], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts index f29b6c7cdf6..01afbe90050 100644 --- a/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts +++ b/ui/ui-frontend/projects/pastis/src/app/user-actions/save-profile/save-profile.component.spec.ts @@ -73,9 +73,8 @@ knowledge of the CeCILL-C license and that you accept its terms. */ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, LoggerModule, StartupService } from 'vitamui-library'; +import { LoggerModule, StartupService } from 'vitamui-library'; import { PastisConfiguration } from '../../core/classes/pastis-configuration'; import { ProfileService } from '../../core/services/profile.service'; import { FileTreeMetadataService } from '../../profile/edit-profile/file-tree-metadata/file-tree-metadata.service'; @@ -107,12 +106,11 @@ describe('UserActionOpenProfileComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [RouterTestingModule, LoggerModule.forRoot(), UserActionSaveProfileComponent], + imports: [LoggerModule.forRoot(), UserActionSaveProfileComponent], providers: [ ProfileService, FileTreeMetadataService, PastisConfiguration, - { provide: BASE_URL, useValue: '/pastis-api' }, { provide: MatDialog, useValue: matDialogSpy }, { provide: StartupService, useValue: startUpServiceMock }, { provide: PopupService, useValue: popupServiceMock }, diff --git a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts index 6166ad332c6..9270e02821d 100644 --- a/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/portal/src/app/app.component.spec.ts @@ -39,7 +39,7 @@ import { Component } from '@angular/core'; import { TestBed } from '@angular/core/testing'; import { ActivatedRoute, Router } from '@angular/router'; import { EMPTY, of } from 'rxjs'; -import { AuthService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; +import { AuthService, ENVIRONMENT, InjectorModule, LoggerModule, StartupService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../environments/environment.prod'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts index fa4e99149f2..3c3a1ade924 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-create/access-contract-create.component.spec.ts @@ -45,14 +45,7 @@ import { MatProgressBarModule } from '@angular/material/progress-bar'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { MatSelectModule } from '@angular/material/select'; import { EMPTY, of } from 'rxjs'; -import { - AccessContractService, - AgencyService, - BASE_URL, - ConfirmDialogService, - ExternalParametersService, - LoggerModule, -} from 'vitamui-library'; +import { AccessContractService, AgencyService, ConfirmDialogService, ExternalParametersService, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractCreateComponent } from './access-contract-create.component'; import { AccessContractCreateValidators } from './access-contract-create.validators'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts index 77c60c9bc13..8eeadc2c2ab 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.spec.ts @@ -38,7 +38,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; -import { AccessContractService, BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { AccessContractService, WINDOW_LOCATION } from 'vitamui-library'; import { AccessContractListComponent } from './access-contract-list.component'; import { EMPTY, of } from 'rxjs'; @@ -59,7 +59,6 @@ describe('AccessContractListComponent', () => { schemas: [CUSTOM_ELEMENTS_SCHEMA], imports: [VitamUICommonTestModule, MatProgressSpinnerModule, AccessContractListComponent], providers: [ - { provide: BASE_URL, useValue: '' }, { provide: AccessContractService, useValue: accessContractServiceMock }, { provide: WINDOW_LOCATION, useValue: window.location }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts index 0e4280a5648..8f18745e24e 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-tab.component.spec.ts @@ -38,15 +38,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { - AccessContract, - BASE_URL, - ExternalParameters, - ExternalParametersService, - LoggerModule, - SearchUnitApiService, - Status, -} from 'vitamui-library'; +import { AccessContract, ExternalParameters, ExternalParametersService, LoggerModule, SearchUnitApiService, Status } from 'vitamui-library'; import { AccessContractNodesTabComponent } from './access-contract-nodes-tab.component'; describe('AccessContractNodesTabComponent', () => { diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts index 1b95b66220b..2379b1778ee 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-preview/access-contract-nodes-tab/access-contract-nodes-update/access-contract-node-update.component.spec.ts @@ -37,16 +37,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { - AccessContractService, - BASE_URL, - Customer, - ENVIRONMENT, - InjectorModule, - LoggerModule, - OtpState, - SnackBarService, -} from 'vitamui-library'; +import { AccessContractService, Customer, ENVIRONMENT, InjectorModule, LoggerModule, OtpState, SnackBarService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from '../../../../../environments/environment'; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts index 25113aa6fd9..c876d2d4d05 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.spec.ts @@ -38,8 +38,7 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AccessContractService, ApplicationService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AccessContractService, ApplicationService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AccessContractComponent } from './access-contract.component'; @@ -49,7 +48,7 @@ import { EMPTY, of } from 'rxjs'; @Component({ selector: 'app-access-contract-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AccessContractPreviewStub { @Input() @@ -59,7 +58,7 @@ class AccessContractPreviewStub { @Component({ selector: 'app-access-contract-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AccessContractListStub {} @@ -81,7 +80,6 @@ describe('AccessContractComponent', () => { await TestBed.configureTestingModule({ imports: [ VitamUICommonTestModule, - RouterTestingModule, InjectorModule, LoggerModule.forRoot(), MatSidenavModule, diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts index 74967222a67..212e537920c 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-preview/accession-register-preview.component.spec.ts @@ -43,17 +43,8 @@ import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTreeModule } from '@angular/material/tree'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { - AccessionRegisterDetail, - BASE_URL, - ENVIRONMENT, - InjectorModule, - LoggerModule, - StartupService, - WINDOW_LOCATION, -} from 'vitamui-library'; +import { AccessionRegisterDetail, ENVIRONMENT, InjectorModule, LoggerModule, StartupService, WINDOW_LOCATION } from 'vitamui-library'; import { environment } from '../../../environments/environment.prod'; import { AccessionRegistersService } from '../accession-register.service'; import { AccessionRegisterPreviewComponent } from './accession-register-preview.component'; @@ -90,7 +81,6 @@ describe('AccessionRegisterPreviewComponent', () => { MatSidenavModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, MatIconModule, BrowserAnimationsModule, AccessionRegisterPreviewComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts index 791baf229ed..a2950474359 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.spec.ts @@ -40,7 +40,7 @@ import { MatDialog } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; import { ActivatedRoute } from '@angular/router'; import { EMPTY, of } from 'rxjs'; -import { AgencyService, AuthService, BASE_URL, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AgencyService, AuthService, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AgencyListComponent } from './agency-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts index 798bb8d28e8..03760b5acfe 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.spec.ts @@ -39,8 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatMenuModule } from '@angular/material/menu'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; -import { AgencyService, BASE_URL, InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; +import { AgencyService, InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActivatedRoute } from '@angular/router'; @@ -72,15 +71,7 @@ describe('AgencyComponent', () => { }); await TestBed.configureTestingModule({ - imports: [ - VitamUICommonTestModule, - RouterTestingModule, - InjectorModule, - LoggerModule.forRoot(), - MatSidenavModule, - MatDialogModule, - MatMenuModule, - ], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), MatSidenavModule, MatDialogModule, MatMenuModule], providers: [ { provide: AgencyService, useValue: {} }, { diff --git a/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts index fef764e20e3..69b134a107d 100644 --- a/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/app.component.spec.ts @@ -36,21 +36,19 @@ */ import { Component } from '@angular/core'; import { TestBed, waitForAsync } from '@angular/core/testing'; -import { RouterTestingModule } from '@angular/router/testing'; import { AppComponent } from './app.component'; @Component({ // eslint-disable-next-line @angular-eslint/component-selector selector: 'vitamui-common-subrogation-banner', template: '', - imports: [RouterTestingModule], }) class SubrogationBannerStubComponent {} describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [RouterTestingModule, SubrogationBannerStubComponent, AppComponent], + imports: [SubrogationBannerStubComponent, AppComponent], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts index fe56dfec335..83ae84d36bf 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-preview/audit-preview.component.spec.ts @@ -37,7 +37,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { CUSTOM_ELEMENTS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { EMPTY, of } from 'rxjs'; -import { BASE_URL, ExternalParameters, ExternalParametersService, LoggerModule, SnackBarService } from 'vitamui-library'; +import { ExternalParameters, ExternalParametersService, LoggerModule, SnackBarService } from 'vitamui-library'; import { AuditPreviewComponent } from './audit-preview.component'; import { AuditService } from '../audit.service'; import { ActivatedRoute } from '@angular/router'; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts index 534c1cf323a..3a99097a04f 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.spec.ts @@ -45,7 +45,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; +import { DatepickerComponent, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { AuditComponent } from './audit.component'; import { DatePipe } from '@angular/common'; @@ -84,7 +84,6 @@ describe('AuditComponent', () => { ], providers: [ provideNativeDateAdapter(), - { provide: BASE_URL, useValue: '/pastis-api' }, DatePipe, FormBuilder, GlobalEventService, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts index 66df6de3048..1e2015ac117 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.spec.ts @@ -39,9 +39,8 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin import { ReactiveFormsModule } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; -import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; -import { AuthService, BASE_URL, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../context.service'; import { ContextListComponent } from './context-list.component'; @@ -77,11 +76,9 @@ describe('ContextListComponent', () => { ReactiveFormsModule, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, ContextListComponent, ], providers: [ - { provide: BASE_URL, useValue: '' }, { provide: MatDialogRef, useValue: matDialogRefSpy }, { provide: MatDialog, useValue: matDialogSpy }, { provide: ContextService, useValue: contextServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts index a5d75b2a384..4c1bfc88fd3 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-preview/context-permission-tab/context-permission-tab.component.spec.ts @@ -38,9 +38,8 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; -import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY } from 'rxjs'; -import { BASE_URL, Context, ContextPermission, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; +import { Context, ContextPermission, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ContextService } from '../../context.service'; @@ -153,14 +152,7 @@ describe('ContextPermissionTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - ReactiveFormsModule, - VitamUICommonTestModule, - InjectorModule, - LoggerModule.forRoot(), - RouterTestingModule, - ContextPermissionTabComponent, - ], + imports: [ReactiveFormsModule, VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), ContextPermissionTabComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts index 0ed917246fa..dd0b360aa2d 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.spec.ts @@ -38,7 +38,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; import { Application, ApplicationService, GlobalEventService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ActivatedRoute } from '@angular/router'; @@ -49,7 +48,7 @@ import { ContextListComponent } from './context-list/context-list.component'; @Component({ selector: 'app-agency-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class ContextPreviewStub { @Input() @@ -72,15 +71,7 @@ describe('ContextComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - VitamUICommonTestModule, - RouterTestingModule, - InjectorModule, - LoggerModule.forRoot(), - MatSidenavModule, - MatDialogModule, - ContextPreviewStub, - ], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), MatSidenavModule, MatDialogModule, ContextPreviewStub], providers: [ { provide: ActivatedRoute, useValue: { params: EMPTY, data: EMPTY, paramMap: EMPTY, snapshot: { data: { appId: 'App Id' } } } }, { provide: GlobalEventService, useValue: { pageEvent: EMPTY, customerEvent: EMPTY, tenantEvent: EMPTY } }, diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts index 9cbec1a74a6..096e6e012a0 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/context-api.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { AgencyApiService, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; describe('AgencyApiService', () => { diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts index f17a08b7379..a4eb8520455 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/customer-api.service.spec.ts @@ -36,7 +36,7 @@ */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CustomerApiService } from './customer-api.service'; @@ -46,7 +46,7 @@ describe('CustomerApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts index 1f56d0d3f6f..b4b06141704 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ingest-contract-api.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { IngestContractApiService } from './ingest-contract-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts index f7b5adb6c16..c4aa3666ab1 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/logbook-management-operation-api.service.spec.ts @@ -36,7 +36,7 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { LogbookManagementOperationApiService } from './logbook-management-operation-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -44,7 +44,7 @@ describe('LogbookManagementOperationApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts index 67562573082..9ba0cecc270 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/management-contracts-api.service.spec.ts @@ -66,7 +66,7 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, LoggerModule } from 'vitamui-library'; +import { LoggerModule } from 'vitamui-library'; import { ManagementContractsApiService } from './management-contracts-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -74,7 +74,7 @@ describe('ManagementContractsApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [LoggerModule.forRoot()], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts index 80b9acdf998..bb27fcb38c2 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/ontology-api.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OntologyApiService } from './ontology-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts index e5d5cc9536d..5196d7c95ec 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/operation-api.service.spec.ts @@ -36,7 +36,7 @@ */ import { HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; import { OperationApiService } from './operation-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts index 9cbec1a74a6..096e6e012a0 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/security-profile-api.service.spec.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { AgencyApiService, BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { AgencyApiService, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from './../../../environments/environment'; describe('AgencyApiService', () => { diff --git a/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts index 8ff1a3e4c62..4f6fe96d5c4 100644 --- a/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/core/api/tenant-api.service.spec.ts @@ -37,7 +37,6 @@ import { TestBed } from '@angular/core/testing'; import { provideHttpClientTesting } from '@angular/common/http/testing'; -import { BASE_URL } from 'vitamui-library'; import { TenantApiService } from './tenant-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; @@ -45,7 +44,7 @@ describe('TenantApiService', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [], - providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting(), { provide: BASE_URL, useValue: '' }], + providers: [provideHttpClient(withInterceptorsFromDi()), provideHttpClientTesting()], }).compileComponents(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts index bc484a7baec..0b2c2461ce2 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.spec.ts @@ -37,7 +37,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; -import { AuthService, BASE_URL, SnackBarService, StartupService } from 'vitamui-library'; +import { AuthService, SnackBarService, StartupService } from 'vitamui-library'; import { FileFormatService } from '../file-format.service'; import { FileFormatListComponent } from './file-format-list.component'; @@ -50,7 +50,6 @@ describe('FileFormatListComponent', () => { schemas: [NO_ERRORS_SCHEMA], imports: [FileFormatListComponent], providers: [ - { provide: BASE_URL, useValue: '' }, FileFormatService, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, { provide: SnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts index cfa6675eebc..efb5bf4f6cc 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.spec.ts @@ -38,7 +38,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; import { InjectorModule, LoggerModule, SecurityService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -48,7 +47,7 @@ import { of } from 'rxjs'; @Component({ selector: 'app-file-format-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AgencyPreviewStub { @Input() @@ -58,7 +57,7 @@ class AgencyPreviewStub { @Component({ selector: 'app-file-format-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class AgencyListStub {} @@ -70,7 +69,6 @@ describe('FileFormatComponent', () => { await TestBed.configureTestingModule({ imports: [ VitamUICommonTestModule, - RouterTestingModule, InjectorModule, LoggerModule.forRoot(), MatSidenavModule, diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts index 804b60a4dd2..40b97aa1425 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-create/ingest-contract-create.component.spec.ts @@ -40,14 +40,7 @@ import { FormBuilder } from '@angular/forms'; import { MatButtonToggleModule } from '@angular/material/button-toggle'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { EMPTY, of } from 'rxjs'; -import { - AccessContractService, - BASE_URL, - ConfirmDialogService, - ExternalParameters, - ExternalParametersService, - LoggerModule, -} from 'vitamui-library'; +import { AccessContractService, ConfirmDialogService, ExternalParameters, ExternalParametersService, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ArchiveProfileApiService } from '../../core/api/archive-profile-api.service'; import { ManagementContractApiService } from '../../core/api/management-contract-api.service'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts index 1a392006668..5bfca92d6b8 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-attachment-tab.component.spec.ts @@ -38,14 +38,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { - BASE_URL, - ExternalParameters, - ExternalParametersService, - IngestContract, - LoggerModule, - SearchUnitApiService, -} from 'vitamui-library'; +import { ExternalParameters, ExternalParametersService, IngestContract, LoggerModule, SearchUnitApiService } from 'vitamui-library'; import { IngestContractAttachmentTabComponent } from './ingest-contract-attachment-tab.component'; describe('IngestContractAttachmentTabComponent', () => { diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts index 3370bd45629..eb8f9f625ae 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-preview/ingest-contract-attachment-tab/ingest-contract-nodes-update/ingest-contract-node-update.component.spec.ts @@ -38,7 +38,7 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { BASE_URL, ENVIRONMENT, FilingPlanComponent, InjectorModule, LoggerModule, SnackBarService } from 'vitamui-library'; +import { ENVIRONMENT, FilingPlanComponent, InjectorModule, LoggerModule, SnackBarService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { environment } from './../../../../../environments/environment'; diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts index 57f0840d9e2..5659011f000 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.spec.ts @@ -38,12 +38,10 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { Application, ApplicationService, - BASE_URL, GlobalEventService, IngestContract, InjectorModule, @@ -77,13 +75,12 @@ describe('IngestContractComponent', () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, LoggerModule.forRoot(), IngestContractComponent], + imports: [VitamUICommonTestModule, InjectorModule, LoggerModule.forRoot(), IngestContractComponent], providers: [ GlobalEventService, { provide: ActivatedRoute, useValue: activatedRouteMock }, { provide: Router, useValue: {} }, { provide: MatDialog, useValue: {} }, - { provide: BASE_URL, useValue: '' }, { provide: WINDOW_LOCATION, useValue: window.location }, { provide: DownloadSnackBarService, useValue: {} }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts index 395753bf32d..f3cf305c147 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation-preview/logbook-management-operation-preview.component.spec.ts @@ -38,7 +38,7 @@ import { Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { BASE_URL, WINDOW_LOCATION } from 'vitamui-library'; +import { WINDOW_LOCATION } from 'vitamui-library'; import { OperationsResults } from '../../models/operation-response.interface'; import { LogbookManagementOperationService } from '../logbook-management-operation.service'; import { LogbookManagementOperationPreviewComponent } from './logbook-management-operation-preview.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts index 2678593314a..523d0231740 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-management-operation/logbook-management-operation.component.spec.ts @@ -39,7 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; import { LogbookManagementOperationComponent } from './logbook-management-operation.component'; import { MatDatepickerModule } from '@angular/material/datepicker'; import { provideNativeDateAdapter } from '@angular/material/core'; @@ -76,7 +76,6 @@ describe('LogbookManagementOperationComponent', () => { }, }, { provide: WINDOW_LOCATION, useValue: {} }, - { provide: BASE_URL, useValue: '' }, { provide: ENVIRONMENT, useValue: '' }, ], schemas: [NO_ERRORS_SCHEMA], diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts index eeab9c6ba85..eb0d74edd51 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-detail/logbook-operation-detail.component.spec.ts @@ -38,9 +38,8 @@ import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { AuthService, BASE_URL, ExternalParametersService, InjectorModule, LogbookService, LoggerModule } from 'vitamui-library'; +import { AuthService, ExternalParametersService, InjectorModule, LogbookService, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { LogbookDownloadService } from '../logbook-download.service'; import { LogbookOperationDetailComponent } from './logbook-operation-detail.component'; @@ -71,7 +70,6 @@ describe('LogbookOperationDetailComponent', () => { EventTypeBadgeColorPipe, InjectorModule, LoggerModule.forRoot(), - RouterTestingModule, VitamUICommonTestModule, LogbookOperationDetailComponent, LastEventPipe, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts index 8a045814a0d..3725dd8f70d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-create/management-contract-create.component.spec.ts @@ -41,11 +41,9 @@ import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dial import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; import { delay } from 'rxjs/operators'; import { - BASE_URL, ConfirmDialogService, InjectorModule, LoggerModule, @@ -99,7 +97,6 @@ describe('ManagementContractCreateComponent', () => { MatSelectModule, MatSidenavModule, ReactiveFormsModule, - RouterTestingModule, VitamUICommonTestModule, VitamUILibraryModule, ], diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index 0355d8b7f0d..a4009f4a5a6 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -40,9 +40,8 @@ import { ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; -import { RouterTestingModule } from '@angular/router/testing'; import { of, Subject } from 'rxjs'; -import { BASE_URL, InjectorModule, LoggerModule, ManagementContract, SearchService, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, LoggerModule, ManagementContract, SearchService, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../management-contract.service'; import { ManagementContractListComponent } from './management-contract-list.component'; @@ -81,7 +80,6 @@ describe('ManagementContractListComponent', () => { MatSidenavModule, InjectorModule, VitamUICommonTestModule, - RouterTestingModule, LoggerModule.forRoot(), BrowserAnimationsModule, ManagementContractListComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts index 5b51c520d84..a691bfd03da 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-information-tab/management-contract-information-tab.component.spec.ts @@ -39,9 +39,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; import { InputStubComponent, VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractInformationTabComponent } from './management-contract-information-tab.component'; @@ -108,7 +107,6 @@ describe('ManagementContractInformationTabComponent', () => { MatSidenavModule, InjectorModule, VitamUICommonTestModule, - RouterTestingModule, LoggerModule.forRoot(), ManagementContractInformationTabComponent, DateTimeStubPipe, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts index 364ac159126..2eaa1a738f9 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-preview.component.spec.ts @@ -38,7 +38,6 @@ import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; import { InjectorModule, IntermediaryVersionEnum, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractPreviewComponent } from './management-contract-preview.component'; @@ -61,7 +60,6 @@ describe('ManagementContractPreviewComponent', () => { MatSidenavModule, InjectorModule, VitamUICommonTestModule, - RouterTestingModule, LoggerModule.forRoot(), MatDialogModule, ManagementContractPreviewComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts index 9dde29004db..72cfe0d6756 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-preview/management-contract-storage-tab/management-contract-storage-tab.component.spec.ts @@ -39,9 +39,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormBuilder } from '@angular/forms'; import { MatDialog, MatDialogRef } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; -import { BASE_URL, InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; +import { InjectorModule, IntermediaryVersionEnum, LoggerModule, ManagementContract, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ManagementContractService } from '../../management-contract.service'; import { ManagementContractStorageTabComponent } from './management-contract-storage-tab.component'; @@ -96,14 +95,7 @@ describe('ManagementContractStorageTabComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ schemas: [NO_ERRORS_SCHEMA], - imports: [ - MatSidenavModule, - InjectorModule, - VitamUICommonTestModule, - RouterTestingModule, - LoggerModule.forRoot(), - ManagementContractStorageTabComponent, - ], + imports: [MatSidenavModule, InjectorModule, VitamUICommonTestModule, LoggerModule.forRoot(), ManagementContractStorageTabComponent], providers: [ FormBuilder, { provide: MatDialogRef, useValue: matDialogRefSpy }, diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts index 6a9c403dd8d..b9fe5a7b5f4 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.spec.ts @@ -41,7 +41,6 @@ import { MatDialog } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { of } from 'rxjs'; import { Application, ApplicationService, InjectorModule, LoggerModule, WINDOW_LOCATION } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -74,7 +73,6 @@ describe('ManagementContractComponent', () => { MatSidenavModule, InjectorModule, VitamUICommonTestModule, - RouterTestingModule, LoggerModule.forRoot(), BrowserAnimationsModule, ManagementContractComponent, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts index 4e0860d0eb1..b90c7809dc1 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.spec.ts @@ -39,7 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { EMPTY, of } from 'rxjs'; -import { AuthService, BASE_URL, Ontology, TenantSelectionService } from 'vitamui-library'; +import { AuthService, Ontology, TenantSelectionService } from 'vitamui-library'; import { OntologyListComponent } from './ontology-list.component'; import { OntologyService } from '../../ontology.service'; @@ -64,7 +64,6 @@ describe('OntologyListComponent', () => { declarations: [], imports: [OntologyListComponent], providers: [ - { provide: BASE_URL, useValue: '' }, { provide: MatDialog, useValue: {} }, { provide: OntologyService, useValue: ontologyServiceMock }, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts index e2395e0908f..0866f1bea19 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/schema-list/schema-list.component.spec.ts @@ -39,7 +39,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NO_ERRORS_SCHEMA } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { AuthService, BASE_URL, SchemaService, TenantSelectionService } from 'vitamui-library'; +import { AuthService, SchemaService, TenantSelectionService } from 'vitamui-library'; import { SchemaListComponent } from './schema-list.component'; describe('SchemaListComponent', () => { @@ -61,7 +61,6 @@ describe('SchemaListComponent', () => { declarations: [], imports: [SchemaListComponent], providers: [ - { provide: BASE_URL, useValue: '' }, { provide: MatDialog, useValue: {} }, { provide: SchemaService, useValue: schemaServiceMock }, { provide: TenantSelectionService, useValue: tenantSelectionServiceMock }, diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts index d03146bad4e..0b6d047f742 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts @@ -38,7 +38,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; import { InjectorModule, LoggerModule, SchemaService, SecurityService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -49,7 +48,7 @@ import { EMPTY } from 'rxjs'; @Component({ selector: 'app-ontology-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class OntologyPreviewStub { @Input() @@ -59,7 +58,7 @@ class OntologyPreviewStub { @Component({ selector: 'app-ontology-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class OntologyListStub {} @@ -71,7 +70,6 @@ describe('OntologyComponent', () => { await TestBed.configureTestingModule({ imports: [ VitamUICommonTestModule, - RouterTestingModule, InjectorModule, LoggerModule.forRoot(), MatSidenavModule, diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts index 79282c27230..8361c237ebb 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/griffin-list/griffin-list.component.spec.ts @@ -41,7 +41,7 @@ import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; import { EMPTY, of, throwError } from 'rxjs'; import type { Mock, MockInstance } from 'vitest'; -import { BASE_URL, Griffin, GriffinsService, LoggerModule, SnackBarService, StartupService, TenantSelectionService } from 'vitamui-library'; +import { Griffin, GriffinsService, LoggerModule, SnackBarService, StartupService, TenantSelectionService } from 'vitamui-library'; import { GriffinListComponent } from './griffin-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts index 0ea7de08802..12f17f40d60 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation-group/preservation-scenario-list/preservation-scenario-list.component.spec.ts @@ -41,7 +41,7 @@ import { By } from '@angular/platform-browser'; import { MatDialog } from '@angular/material/dialog'; import { EMPTY, of, throwError } from 'rxjs'; import type { Mock, MockInstance } from 'vitest'; -import { BASE_URL, LoggerModule, PreservationScenario, PreservationScenariosService, SnackBarService } from 'vitamui-library'; +import { LoggerModule, PreservationScenario, PreservationScenariosService, SnackBarService } from 'vitamui-library'; import { PreservationScenarioListComponent } from './preservation-scenario-list.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts index d0fbf195c64..3bd77b26c59 100644 --- a/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/preservation/preservation.component.spec.ts @@ -38,7 +38,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { PreservationComponent } from './preservation.component'; -import { BASE_URL, InjectorModule, LoggerModule, SecurityService, VitamUICommonModule } from 'vitamui-library'; +import { InjectorModule, LoggerModule, SecurityService, VitamUICommonModule } from 'vitamui-library'; import { ActivatedRoute } from '@angular/router'; import { of } from 'rxjs'; diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts index e3967a7d0ab..77ccde17402 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.spec.ts @@ -43,7 +43,7 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { ActivatedRoute, Router } from '@angular/router'; import { of } from 'rxjs'; -import { BASE_URL, DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; +import { DatepickerComponent, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { ProbativeValueComponent } from './probative-value.component'; @@ -74,7 +74,6 @@ describe('ProbativeValueComponent', () => { ], providers: [ provideNativeDateAdapter(), - { provide: BASE_URL, useValue: '/pastis-api' }, DatePipe, FormBuilder, { provide: MatDialog, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts index 134a9e82b09..6b8b9dc1815 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.spec.ts @@ -38,7 +38,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialog } from '@angular/material/dialog'; import { of } from 'rxjs'; -import { AuthService, BASE_URL, Rule, RuleService, SnackBarService } from 'vitamui-library'; +import { AuthService, Rule, RuleService, SnackBarService } from 'vitamui-library'; import { RuleListComponent } from './rule-list.component'; describe('RuleListComponent', () => { @@ -54,7 +54,6 @@ describe('RuleListComponent', () => { await TestBed.configureTestingModule({ imports: [RuleListComponent], providers: [ - { provide: BASE_URL, useValue: '' }, { provide: RuleService, useValue: ruleServiceMock }, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, { provide: SnackBarService, useValue: {} }, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts index 93ecca475ba..3c0c1b9d665 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.spec.ts @@ -44,11 +44,9 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSidenavModule } from '@angular/material/sidenav'; import { MatTabsModule } from '@angular/material/tabs'; import { ActivatedRoute } from '@angular/router'; -import { RouterTestingModule } from '@angular/router/testing'; import { EMPTY, of } from 'rxjs'; import { AuthService, - BASE_URL, ENVIRONMENT, GlobalEventService, InjectorModule, @@ -65,7 +63,6 @@ import { RuleComponent } from './rule.component'; selector: 'app-rule-preview', template: '', imports: [ - RouterTestingModule, VitamUICommonTestModule, ReactiveFormsModule, MatMenuModule, @@ -86,7 +83,6 @@ class RulePreviewStubComponent { selector: 'app-rule-list', template: '', imports: [ - RouterTestingModule, VitamUICommonTestModule, ReactiveFormsModule, MatMenuModule, @@ -140,7 +136,6 @@ describe('RuleComponent', () => { await TestBed.configureTestingModule({ imports: [ - RouterTestingModule, VitamUICommonTestModule, ReactiveFormsModule, MatMenuModule, diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts index 2bbc62c8b3d..3a6d48ca4a5 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-preview/securisation-check-tab/securisation-check-tab.component.spec.ts @@ -37,7 +37,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; -import { AccessContractService, BASE_URL, ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; +import { AccessContractService, ExternalParameters, ExternalParametersService, SnackBarService } from 'vitamui-library'; import { SecurisationService } from '../../securisation.service'; import { SecurisationCheckTabComponent } from './securisation-check-tab.component'; diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts index 538d628db9c..c367a256f49 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.spec.ts @@ -37,7 +37,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { of } from 'rxjs'; -import { AuthService, BASE_URL, SecurityProfile } from 'vitamui-library'; +import { AuthService, SecurityProfile } from 'vitamui-library'; import { SecurityProfileService } from '../security-profile.service'; import { SecurityProfileListComponent } from './security-profile-list.component'; @@ -54,7 +54,6 @@ describe('SecurityProfileListComponent', () => { await TestBed.configureTestingModule({ imports: [SecurityProfileListComponent], providers: [ - { provide: BASE_URL, useValue: '' }, { provide: SecurityProfileService, useValue: securityProfileServiceMock }, { provide: AuthService, useValue: { user: { proofTenantIdentifier: '1' } } }, ], diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts index 578ff2df528..443516c6eef 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.spec.ts @@ -39,7 +39,6 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { RouterTestingModule } from '@angular/router/testing'; import { ApplicationService, InjectorModule, LoggerModule } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; @@ -49,7 +48,7 @@ import { SecurityProfileComponent } from './security-profile.component'; @Component({ selector: 'app-SecurityProfile-preview', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class SecurityProfilePreviewStub { @Input() @@ -59,7 +58,7 @@ class SecurityProfilePreviewStub { @Component({ selector: 'app-SecurityProfile-list', template: '', - imports: [VitamUICommonTestModule, RouterTestingModule, InjectorModule, MatSidenavModule, MatDialogModule], + imports: [VitamUICommonTestModule, InjectorModule, MatSidenavModule, MatDialogModule], }) class SecurityProfileListStub {} @@ -76,7 +75,6 @@ describe('SecurityProfileComponent', () => { await TestBed.configureTestingModule({ imports: [ VitamUICommonTestModule, - RouterTestingModule, InjectorModule, LoggerModule.forRoot(), MatSidenavModule, diff --git a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts index a69b860c9a8..8a986e26bd1 100644 --- a/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/shared/import-dialog/referential-import-api.service.spec.ts @@ -36,7 +36,7 @@ */ import { HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL, ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; +import { ENVIRONMENT, InjectorModule, LoggerModule } from 'vitamui-library'; import { environment } from '../../../environments/environment'; import { ReferentialImportService } from './referential-import.service'; import { ReferentialImportInvalidFileError, ReferentialTypes } from './import-dialog-param.interface'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts index 018f7cbefda..3b8e829d4b6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts @@ -45,7 +45,7 @@ import { environment } from '../../../environments/environment'; import { BaseUserInfoApiService } from '../api/base-user-info-api.service'; import { InjectorModule } from '../helper/injector.module'; import { LoggerModule } from '../logger/logger.module'; -import { BASE_URL, ENVIRONMENT, WINDOW_LOCATION } from '../injection-tokens'; +import { ENVIRONMENT, WINDOW_LOCATION } from '../injection-tokens'; import type { Account } from '../models/account/account.interface'; import { AccountComponent } from './account.component'; import { AccountService } from './account.service'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts index e59249dcfa2..4564d1635c6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.service.spec.ts @@ -38,14 +38,13 @@ import { inject, TestBed } from '@angular/core/testing'; import { EMPTY } from 'rxjs'; import { SnackBarService } from '../components/snack-bar/snack-bar.service'; -import { BASE_URL } from '../injection-tokens'; import { AccountService } from './account.service'; describe('AccountService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [], - providers: [AccountService, { provide: BASE_URL, useValue: {} }, { provide: SnackBarService, useValue: { instant: () => EMPTY } }], + providers: [AccountService, { provide: SnackBarService, useValue: { instant: () => EMPTY } }], }); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts index b7c7e663310..84d730a2a86 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/agencies/agency-api.service.spec.ts @@ -38,7 +38,7 @@ import { TestBed } from '@angular/core/testing'; import { AgencyApiService } from './agency-api.service'; import { InjectorModule } from '../helper/injector.module'; import { LoggerModule } from '../logger/logger.module'; -import { BASE_URL, ENVIRONMENT } from '../injection-tokens'; +import { ENVIRONMENT } from '../injection-tokens'; import { environment } from '../../../environments/environment'; describe('AgencyApiService', () => { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts index 7039d4a69ba..bc7d7cdd072 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/analytics-resolver.service.spec.ts @@ -40,7 +40,7 @@ import { UserApiService } from './api/user-api.service'; import { Router, RouterModule } from '@angular/router'; import { AnalyticsResolver } from './analytics-resolver.service'; -import { BASE_URL, WINDOW_LOCATION } from './injection-tokens'; +import { WINDOW_LOCATION } from './injection-tokens'; import { LoggerModule } from './logger/logger.module'; const expectedUser = { id: 10 }; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts index c8592a7f474..bfb532ae437 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/access-contract-api.service.spec.ts @@ -40,13 +40,20 @@ import { InjectorModule } from '../helper/injector.module'; import { BASE_URL, ENVIRONMENT } from '../injection-tokens'; import { environment } from '../../../environments/environment'; import { AccessContractApiService } from './access-contract-api.service'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; +import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; describe('AccessContractApiService', () => { let service: AccessContractApiService; beforeEach(() => { TestBed.configureTestingModule({ imports: [InjectorModule, LoggerModule.forRoot()], - providers: [{ provide: ENVIRONMENT, useValue: environment }], + providers: [ + { provide: ENVIRONMENT, useValue: environment }, + provideHttpClient(withInterceptorsFromDi()), + provideHttpClientTesting(), + { provide: BASE_URL, useValue: '/fake-api' }, + ], }); service = TestBed.inject(AccessContractApiService); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts index a525700bd2b..364472a9a80 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/application-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from '../injection-tokens'; import { ApplicationApiService } from './application-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts index 051d10de967..437bc989d94 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/logbook-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from '../injection-tokens'; import { LogbookApiService } from './logbook-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts index a50cf3bf7cd..b3f6d5e990b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/ontology-api.service.spec.ts @@ -36,7 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL } from '../injection-tokens'; import { OntologyApiService } from './ontology-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts index 4c539a2e173..80462e95a2d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/profile-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from '../injection-tokens'; import { ProfileApiService } from './profile-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts index b30d2360730..18d96eaa2dc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/security-api.service.spec.ts @@ -36,8 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; - -import { BASE_URL } from '../injection-tokens'; import { SecurityApiService } from './security-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts index b41daf504ea..2634bad1f8f 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/site-api.service.spec.ts @@ -36,7 +36,6 @@ */ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { BASE_URL } from '../injection-tokens'; import { SiteApiService } from './site-api.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts index 32f6284b329..7bcc87e58cb 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/subrogation-api.service.spec.ts @@ -37,7 +37,7 @@ import { TestBed } from '@angular/core/testing'; import { AuthService } from '../auth.service'; -import { BASE_URL, WINDOW_LOCATION } from '../injection-tokens'; +import { WINDOW_LOCATION } from '../injection-tokens'; import { SubrogationApiService } from './subrogation-api.service'; describe('SubrogationApiService', () => { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts index 27deb418ec2..91b1c5c63d9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/api/user-api.service.spec.ts @@ -36,7 +36,7 @@ */ import { TestBed } from '@angular/core/testing'; import { AuthService } from '../auth.service'; -import { BASE_URL, WINDOW_LOCATION } from './../injection-tokens'; +import { WINDOW_LOCATION } from './../injection-tokens'; import { UserApiService } from './user-api.service'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts index c2c13b11aeb..41618b2c3cc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/application.service.spec.ts @@ -42,7 +42,6 @@ import { ApplicationId } from './application-id.enum'; import { ApplicationService } from './application.service'; import { AuthService } from './auth.service'; import { ConfigService } from './config.service'; -import { BASE_URL } from './injection-tokens'; import { Application } from './models/application/application.interface'; import { StartupService } from './startup.service'; import { Category } from './models/application/category.interface'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts index 9480cd9e161..198e96cc48a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.component.spec.ts @@ -38,7 +38,6 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { BASE_URL } from '../../../injection-tokens'; import { LoggerModule } from '../../../logger/logger.module'; import { UnitType } from '../../../models/units/unit-type.enum'; import { Unit } from '../../../models/units/unit.interface'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts index efe1fec2fd1..fe86bda403c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/archive-unit/components/archive-unit-viewer/archive-unit-viewer.service.spec.ts @@ -36,7 +36,6 @@ */ import { TestBed, waitForAsync } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; -import { BASE_URL } from '../../../injection-tokens'; import { LoggerModule } from '../../../logger/logger.module'; import { DisplayObject } from '../../../object-viewer/models/display-object.model'; import { DisplayRule } from '../../../object-viewer/models/display-rule.model'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts index e99987610f7..ffab183189a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/editable-field/editable-field.component.spec.ts @@ -38,7 +38,6 @@ import { provideHttpClientTesting } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { Validators } from '@angular/forms'; import { VitamUICommonTestModule } from '../../../../../testing/src/vitamui-common-test.module'; -import { BASE_URL } from '../../injection-tokens'; import { EditableFieldComponent } from './editable-field.component'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts index 8fe2081312b..8157e544de8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/object-viewer/object-viewer.component.spec.ts @@ -40,7 +40,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, of } from 'rxjs'; import { customTemplate } from '../archive-unit/archive-unit-template'; -import { BASE_URL } from '../injection-tokens'; import { LoggerModule } from '../logger/logger.module'; import { EmptyPipe } from '../pipes/empty.pipe'; import { GroupComponent } from './components/group/group.component'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts index bf1e3cd02ab..56e972c48c4 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/ontology/ontology.service.spec.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { TestBed } from '@angular/core/testing'; -import { BASE_URL } from '../injection-tokens'; import { OntologyService } from './ontology.service'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins-api.service.spec.ts index 14fd4f6f12e..f214f37ac8c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins-api.service.spec.ts @@ -37,13 +37,12 @@ import { TestBed } from '@angular/core/testing'; import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; import { GriffinsApiService } from './griffins-api.service'; -import { BASE_URL } from '../../injection-tokens'; -import { Griffin, CreateGriffin } from './griffin.type'; +import { CreateGriffin, Griffin } from './griffin.type'; describe('GriffinsApiService', () => { let service: GriffinsApiService; let httpMock: HttpTestingController; - const baseUrl = 'http://localhost:8080'; + const baseUrl = '/fake-api'; const mockGriffin: Griffin = { '#id': '1', @@ -61,7 +60,7 @@ describe('GriffinsApiService', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [HttpClientTestingModule], - providers: [GriffinsApiService, { provide: BASE_URL, useValue: baseUrl }], + providers: [GriffinsApiService], }); service = TestBed.inject(GriffinsApiService); httpMock = TestBed.inject(HttpTestingController); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts index 4f4246b2c4f..520e530d883 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/griffins/griffins.service.spec.ts @@ -40,7 +40,6 @@ import { GriffinsApiService } from './griffins-api.service'; import { of } from 'rxjs'; import { CreateGriffin, Griffin } from './griffin.type'; import { vi } from 'vitest'; -import { BASE_URL } from '../../injection-tokens'; import { LoggerModule } from '../../logger/logger.module'; describe('GriffinsService', () => { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts index 0ddb67ffe35..9e9b9ad5cbc 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/preservation/scenarios/preservation-scenarios-api.service.spec.ts @@ -38,15 +38,13 @@ import { TestBed } from '@angular/core/testing'; import { HttpTestingController } from '@angular/common/http/testing'; import { PreservationScenariosApiService } from './preservation-scenarios-api.service'; -import { BASE_URL } from '../../injection-tokens'; import { PreservationScenario } from './preservation-scenario.type'; describe('PreservationScenariosApiService', () => { let service: PreservationScenariosApiService; let httpMock: HttpTestingController; - const baseUrl = 'http://localhost:8080'; - const endpoint = `${baseUrl}/preservation-scenarios`; + const endpoint = `/fake-api/preservation-scenarios`; const mockScenario: PreservationScenario = { Identifier: 'ID-123', @@ -67,7 +65,7 @@ describe('PreservationScenariosApiService', () => { beforeEach(() => { TestBed.configureTestingModule({ - providers: [PreservationScenariosApiService, { provide: BASE_URL, useValue: baseUrl }], + providers: [PreservationScenariosApiService], }); service = TestBed.inject(PreservationScenariosApiService); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts index 9d0a3e4b91a..1e2ea87c45c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/services/profile.service.spec.ts @@ -38,7 +38,6 @@ import { HttpTestingController } from '@angular/common/http/testing'; import { Type } from '@angular/core'; import { inject, TestBed } from '@angular/core/testing'; -import { BASE_URL } from '../injection-tokens'; import { ProfileService } from './profile.service'; describe('ProfileService', () => { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts index 168a68568be..90770aa9d71 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation-snack-bar/subrogation-snack-bar.component.spec.ts @@ -41,7 +41,7 @@ import { VitamUICommonTestModule } from '../../../../../testing/src/vitamui-comm import { SubrogationApiService } from '../../api/subrogation-api.service'; import { SnackBarService } from '../../components/snack-bar/snack-bar.service'; -import { BASE_URL, WINDOW_LOCATION } from '../../injection-tokens'; +import { WINDOW_LOCATION } from '../../injection-tokens'; import { SubrogationSnackBarComponent } from './subrogation-snack-bar.component'; describe('SubrogationSnackBarComponent', () => { @@ -53,7 +53,6 @@ describe('SubrogationSnackBarComponent', () => { imports: [VitamUICommonTestModule, SubrogationSnackBarComponent], providers: [ { provide: MAT_SNACK_BAR_DATA, useValue: {} }, - { provide: BASE_URL, useValue: '/fakeapi' }, { provide: MatSnackBarRef, useValue: { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts index 36064f6f226..03947c8605a 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/subrogation/subrogation.service.spec.ts @@ -42,7 +42,6 @@ import { VitamUICommonTestModule } from '../../../../testing/src/vitamui-common- import { AuthService } from '../auth.service'; import { SnackBarService } from '../components/snack-bar/snack-bar.service'; -import { BASE_URL } from '../injection-tokens'; import { LoggerModule } from '../logger/logger.module'; import { environment } from './../../../environments/environment'; import { ENVIRONMENT, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION } from './../injection-tokens'; @@ -63,7 +62,6 @@ describe('SubrogationService', () => { url: 'subrogations/customers/customerId', }, }, - { provide: BASE_URL, useValue: 'fake-api' }, { provide: SUBROGRATION_REFRESH_RATE_MS, useValue: 100 }, { provide: AuthService, useValue: {} }, { provide: ENVIRONMENT, useValue: environment }, diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts index 619d79b52f3..4092a54456c 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.spec.ts @@ -41,7 +41,6 @@ import { inject, TestBed } from '@angular/core/testing'; import { SnackBarService } from '../../../app/modules/components/snack-bar/snack-bar.service'; import { FileType } from '../../../app/modules/file-type.enum'; import { InjectorModule } from '../../../app/modules/helper/injector.module'; -import { BASE_URL } from '../../../app/modules/injection-tokens'; import { LoggerModule } from '../../../app/modules/logger/logger.module'; import { UnitType } from '../../../app/modules/models/units/unit-type.enum'; import { AccessContractService } from '../../../app/modules/services/access-contract.service'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts index 8583450474d..9d63f875b26 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.component.spec.ts @@ -39,7 +39,7 @@ import { ReclassificationDialogComponent } from './reclassification-dialog.compo import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; import { ConfirmDialogService } from '../../../app/modules/components/common-confirm-dialog/confirm-dialog.service'; -import { BASE_URL, WINDOW_LOCATION } from '../../../app/modules/injection-tokens'; +import { WINDOW_LOCATION } from '../../../app/modules/injection-tokens'; import { LoggerModule } from '../../../app/modules/logger/logger.module'; import { CriteriaDataType, CriteriaOperator } from '../../../app/modules/models/criteria/criteria.enums'; import { PagedResult, SearchCriteriaDto, SearchCriteriaTypeEnum } from '../../../app/modules/models/criteria/search-criteria.interface'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts index 0687e7db315..cdcf2a93c96 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/reclassification-dialog/reclassification-dialog.service.spec.ts @@ -40,7 +40,6 @@ import { TranslateService } from '@ngx-translate/core'; import { ReclassificationService } from '../../../app/modules/services/reclassification.service'; import { Observable, of } from 'rxjs'; import { ArchiveUnit } from '../../../app/modules/archive-unit/models/archive-unit'; -import { BASE_URL } from '../../../app/modules/injection-tokens'; import { LoggerModule } from '../../../app/modules/logger/logger.module'; import { PagedResult } from '../../../app/modules/models/criteria/search-criteria.interface'; import { BaseReclassificationDialogService } from './reclassification-dialog.service'; diff --git a/ui/ui-frontend/projects/vitamui-library/test.ts b/ui/ui-frontend/projects/vitamui-library/test.ts new file mode 100644 index 00000000000..e1df6d7b383 --- /dev/null +++ b/ui/ui-frontend/projects/vitamui-library/test.ts @@ -0,0 +1,51 @@ +/* + * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) + * and the signatories of the "VITAM - Accord du Contributeur" agreement. + * + * contact@programmevitam.fr + * + * This software is a computer program whose purpose is to implement + * implement a digital archiving front-office system for the secure and + * efficient high volumetry VITAM solution. + * + * This software is governed by the CeCILL-C license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL-C + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL-C license and that you accept its terms. + */ + +/// + +import { TestBed } from '@angular/core/testing'; +import { BASE_URL } from './src/app/modules/injection-tokens'; + +/** + * We just need to override BASE_URL differently when executing tests in vitamui-library because the injection token wouldn't be recognized if it were imported from 'vitamui-library' (we use a relative path instead) + */ +const configureTestingModule = TestBed.configureTestingModule.bind(TestBed); +TestBed.configureTestingModule = ((moduleDef: any) => + configureTestingModule({ + ...moduleDef, + providers: [{ provide: BASE_URL, useValue: '/fake-api' }, ...(moduleDef?.providers ?? [])], + })) as typeof TestBed.configureTestingModule; From 483e7fd1e586f9249417a57cd73a27455a1b60ed Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Tue, 1 Sep 2026 14:54:42 +0200 Subject: [PATCH 15/33] Story #16471: Clean code - WIP replace animations --- .../projects/design-system/src/main.ts | 2 ++ ui/ui-frontend/projects/portal/src/main.ts | 2 ++ .../collapse/collapse.component.scss | 35 +++++++++++++++++++ .../header/menu/menu.component.scss | 7 ++++ .../components/stepper/stepper.component.scss | 8 +---- .../vitamui-field-error.component.scss | 4 +++ .../vitamui-library/src/sass/_animations.scss | 20 ++++++++++- .../vitamui-library/src/sass/styles.scss | 1 + 8 files changed, 71 insertions(+), 8 deletions(-) diff --git a/ui/ui-frontend/projects/design-system/src/main.ts b/ui/ui-frontend/projects/design-system/src/main.ts index 53a84ed672d..6e96989a1d4 100644 --- a/ui/ui-frontend/projects/design-system/src/main.ts +++ b/ui/ui-frontend/projects/design-system/src/main.ts @@ -55,6 +55,7 @@ import { ServiceWorkerModule } from '@angular/service-worker'; import { PreloadAllModules, provideRouter, withHashLocation, withPreloading } from '@angular/router'; import { routes } from './app/app.routes'; import { inject, provideAppInitializer } from '@angular/core'; +import { VitamUILibraryModule } from '../../vitamui-library/src/lib/vitamui-library.module'; if (environment.production) { enableProdMode(); @@ -71,6 +72,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideAppInitializer(async () => { const configService = inject(ConfigService); diff --git a/ui/ui-frontend/projects/portal/src/main.ts b/ui/ui-frontend/projects/portal/src/main.ts index 33134272685..96094794412 100644 --- a/ui/ui-frontend/projects/portal/src/main.ts +++ b/ui/ui-frontend/projects/portal/src/main.ts @@ -47,6 +47,7 @@ import { LoggerModule, provideI18n, VitamUICommonModule, + VitamUILibraryModule, WINDOW_LOCATION, } from 'vitamui-library'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -87,6 +88,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideI18n(), Title, diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.scss b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.scss index aa494ea8177..8340c1fdc66 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/collapse/collapse.component.scss @@ -7,5 +7,40 @@ .collapse-content { overflow: hidden; + display: grid; + transition: + grid-template-rows 150ms cubic-bezier(0.4, 0, 0.2, 1), + opacity 150ms cubic-bezier(0.4, 0, 0.2, 1); + grid-template-rows: 1fr; + opacity: 1; + + &.collapsed { + grid-template-rows: 0fr; + opacity: 0; + visibility: hidden; + } + + &.expanded { + grid-template-rows: 1fr; + opacity: 1; + visibility: visible; + } + + & > * { + min-height: 0; + } + } + + .collapse-icon { + display: inline-block; + transition: transform 200ms ease-out; + + &.collapsed { + transform: rotate(-90deg); + } + + &:not(.collapsed) { + transform: rotate(0deg); + } } } diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.scss b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.scss index 11dbbf50a11..be2ff6524d6 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/menu/menu.component.scss @@ -74,6 +74,13 @@ outline-width: 0; } + .menu-container { + animation: menuFadeIn 500ms cubic-bezier(0, 0, 0.2, 1); + &.menu-closing { + animation: menuFadeOut 500ms cubic-bezier(0, 0, 0.2, 1) forwards; + } + } + .container { background: var(--vitamui-white); width: var(--width); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss index 33448aab1b4..6773d975953 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss @@ -1,7 +1 @@ -.step { - outline: none; - - &.hidden { - overflow: hidden; - } -} +// step styles centralised in sass/_animations.scss diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-field-error/vitamui-field-error.component.scss b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-field-error/vitamui-field-error.component.scss index e69de29bb2d..9f3b9be94d1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-field-error/vitamui-field-error.component.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-field-error/vitamui-field-error.component.scss @@ -0,0 +1,4 @@ +:host { + display: block; +} +// .slide-down-enter defined in sass/_animations.scss diff --git a/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss b/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss index 54079266b6c..6a6ea152cdf 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss @@ -97,7 +97,6 @@ opacity: 1; } } - // Generic collapsible used by archive/collect preview tabs (former trigger collapse 300ms) .collapsible { display: grid; @@ -111,3 +110,22 @@ .collapsible.is-collapsed { grid-template-rows: 0fr; } + +// Generic collapsible used by archive/collect preview tabs (former trigger collapse 300ms) +.collapsible { + display: grid; + overflow: hidden; + grid-template-rows: 1fr; + visibility: visible; + transition: + grid-template-rows 300ms ease-in-out, + visibility 300ms ease-in-out; + > * { + min-height: 0; + } +} +.collapsible.collapsed, +.collapsible.is-collapsed { + grid-template-rows: 0fr; + visibility: hidden; +} diff --git a/ui/ui-frontend/projects/vitamui-library/src/sass/styles.scss b/ui/ui-frontend/projects/vitamui-library/src/sass/styles.scss index fddaf6323b8..ff1c2692cfd 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/sass/styles.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/sass/styles.scss @@ -1,3 +1,4 @@ @use './animations'; @use './date-filter'; @use './filter'; +@use './animations'; From fbbc4e806dfba2a5207842e3a6decbc09a3d3e2f Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Tue, 1 Sep 2026 15:53:42 +0200 Subject: [PATCH 16/33] Story #16471: Clean code - fix portal --- .../src/app/portal/portal.component.html | 6 +- .../portal/src/app/portal/portal.component.ts | 71 ++++++++-------- .../account-information-tab.component.ts | 25 +++--- .../modules/account/account.component.html | 6 +- .../app/modules/account/account.component.ts | 33 +++----- .../components/header/header.component.html | 16 ++-- .../components/header/header.component.ts | 80 +++++++++---------- .../select-language.component.html | 4 +- .../select-language.component.ts | 37 +++++---- 9 files changed, 126 insertions(+), 152 deletions(-) diff --git a/ui/ui-frontend/projects/portal/src/app/portal/portal.component.html b/ui/ui-frontend/projects/portal/src/app/portal/portal.component.html index a8228048349..0cf0dddcdfe 100644 --- a/ui/ui-frontend/projects/portal/src/app/portal/portal.component.html +++ b/ui/ui-frontend/projects/portal/src/app/portal/portal.component.html @@ -1,10 +1,10 @@
- +
- - @if (loading) { + + @if (loading()) { }
diff --git a/ui/ui-frontend/projects/portal/src/app/portal/portal.component.ts b/ui/ui-frontend/projects/portal/src/app/portal/portal.component.ts index d2462827a62..56cb0f5d6c0 100644 --- a/ui/ui-frontend/projects/portal/src/app/portal/portal.component.ts +++ b/ui/ui-frontend/projects/portal/src/app/portal/portal.component.ts @@ -34,9 +34,9 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, OnDestroy, OnInit, inject } from '@angular/core'; +import { Component, OnDestroy, OnInit, computed, effect, inject, signal } from '@angular/core'; import { SafeResourceUrl, Title } from '@angular/platform-browser'; -import { LangChangeEvent, TranslateService } from '@ngx-translate/core'; +import { TranslateService } from '@ngx-translate/core'; import { Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; import { @@ -44,16 +44,13 @@ import { ApplicationId, ApplicationService, AuthService, - BasicCustomer, Category, - FullLangString, GlobalEventService, LanguageService, MinLangString, StartupService, ThemeDataType, ThemeService, - UserInfo, } from 'vitamui-library'; import { ContentTypeEnum } from '../components/content-list/content.enum'; import { Content } from '../components/content-list/content.interface'; @@ -83,32 +80,48 @@ export class PortalComponent implements OnInit, OnDestroy { private titleService = inject(Title); private globalEventService = inject(GlobalEventService); - public content: Map = new Map(); - public welcomeTitle: string; - public welcomeMessage: string; - public portalLogoUrl: SafeResourceUrl; - public loading = true; + public content = signal>(new Map()); + public portalLogoUrl = signal(null); + public loading = signal(true); + + private currentMinLang = computed(() => (this.translateService.currentLang() as MinLangString) ?? MinLangString.FR); + private currentFullLang = computed(() => this.languageService.getFullLangString(this.currentMinLang())); + + public welcomeTitle = computed(() => { + const fullLang = this.currentFullLang(); + const customer = this.authService.user?.basicCustomer; + if (customer?.portalTitles?.[fullLang]) return customer.portalTitles[fullLang]; + return this.startupService.getConfigStringValue('PORTAL_TITLE') ?? ''; + }); + + public welcomeMessage = computed(() => { + const fullLang = this.currentFullLang(); + const customer = this.authService.user?.basicCustomer; + if (customer?.portalMessages?.[fullLang]) return customer.portalMessages[fullLang]; + return this.startupService.getConfigStringValue('PORTAL_MESSAGE') ?? ''; + }); private destroyer$ = new Subject(); + constructor() { + effect(() => { + const translatedAppName = this.translateService.instant(APPLICATION_TRANSLATE_PATH + '.' + ApplicationId.PORTAL_APP + '.NAME'); + this.titleService.setTitle(translatedAppName); + }); + } + ngOnInit() { this.applicationService .getActiveTenantAppsMap() .pipe(takeUntil(this.destroyer$)) .subscribe((appMap) => { - this.content = this.convertAppMapToContentMap(appMap); - this.loading = false; + this.content.set(this.convertAppMapToContentMap(appMap)); + this.loading.set(false); }); this.themeService .getData$(this.authService.user, ThemeDataType.PORTAL_LOGO) - .subscribe((portalLogoUrl: SafeResourceUrl) => (this.portalLogoUrl = portalLogoUrl)); - - this.authService.getUserInfo$().subscribe((userInfo: UserInfo) => this.initPortalTitleAndMessage(userInfo.language as FullLangString)); - - this.translateService.onLangChange.pipe(takeUntil(this.destroyer$)).subscribe((event: LangChangeEvent) => { - this.initPortalTitleAndMessage(this.languageService.getFullLangString(event.lang as MinLangString)); - }); + .subscribe((portalLogoUrl: SafeResourceUrl) => this.portalLogoUrl.set(portalLogoUrl)); this.globalEventService.pageEvent.next(ApplicationId.PORTAL_APP); } @@ -129,24 +142,4 @@ export class PortalComponent implements OnInit, OnDestroy { return contentMap; } - - private initPortalTitleAndMessage(lang: FullLangString): void { - const translatedAppName = this.translateService.instant(APPLICATION_TRANSLATE_PATH + '.' + ApplicationId.PORTAL_APP + '.NAME'); - this.titleService.setTitle(translatedAppName); - - const customer: BasicCustomer = this.authService.user.basicCustomer; - if (customer) { - if (customer.portalTitles && customer.portalTitles[lang]) { - this.welcomeTitle = customer.portalTitles[lang]; - } else { - this.welcomeTitle = this.startupService.getConfigStringValue('PORTAL_TITLE'); - } - - if (customer.portalMessages && customer.portalMessages[lang]) { - this.welcomeMessage = customer.portalMessages[lang]; - } else { - this.welcomeMessage = this.startupService.getConfigStringValue('PORTAL_MESSAGE'); - } - } - } } diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts index d3fc041da02..4e7f74eeac8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account-information-tab/account-information-tab.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, inject, Input } from '@angular/core'; +import { Component, effect, inject, input } from '@angular/core'; import { FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import type { Account } from '../../models/account/account.interface'; @@ -54,18 +54,7 @@ export class AccountInformationTabComponent { public language: string; - @Input() - set account(account: Account) { - this._account = account; - if (this.account?.userInfo) { - this.language = this.account.userInfo.language; - } - this.resetForm(this.account); - } - get account(): Account { - return this._account; - } - private _account: Account; + public account = input(null); constructor() { this.form = this.formBuilder.group({ @@ -81,6 +70,16 @@ export class AccountInformationTabComponent { type: [{ value: null, disabled: true }], profileGroup: [{ value: null, disabled: true }], }); + + effect(() => { + const acc = this.account(); + if (acc?.userInfo) { + this.language = acc.userInfo.language; + } + if (acc) { + this.resetForm(acc); + } + }); } private resetForm(account: Account) { diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.html b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.html index b018cf1b118..6f70cf509d9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.html +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.html @@ -1,7 +1,7 @@
- + {{ 'ACCOUNT.TITLE' | translate }}
@@ -19,7 +19,9 @@
- + @if (account(); as acc) { + + }
diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts index 8fa4aeaa291..87b8b3c0f25 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts @@ -34,9 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, inject, OnDestroy, OnInit } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; -import { Subscription } from 'rxjs'; +import { toSignal } from '@angular/core/rxjs-interop'; +import { map, switchMap } from 'rxjs/operators'; import { BaseUserInfoApiService } from '../api/base-user-info-api.service'; import { AppRootComponent } from '../app-root-component.class'; import { ApplicationId } from '../application-id.enum'; @@ -55,17 +56,20 @@ import { TranslatePipe } from '@ngx-translate/core'; styleUrls: ['./account.component.scss'], imports: [VitamuiTitleBreadcrumbComponent, UserPhotoComponent, MatTabGroup, MatTab, AccountInformationTabComponent, TranslatePipe], }) -export class AccountComponent extends AppRootComponent implements OnInit, OnDestroy { +export class AccountComponent extends AppRootComponent { private accountService = inject(AccountService); private userInfoApiService = inject(BaseUserInfoApiService); route: ActivatedRoute; public displayAppTab = false; - public displayEditionAndAdminContact = false; - public account: Account; - public dataBreadcrumb: BreadCrumbData[]; + public dataBreadcrumb: BreadCrumbData[] = [{ identifier: ApplicationId.PORTAL_APP }, { identifier: ApplicationId.ACCOUNTS_APP }]; - private sub: Subscription; + public account = toSignal( + this.accountService + .getMyAccount() + .pipe(switchMap((account) => this.userInfoApiService.getMyUserInfo().pipe(map((userInfo) => ({ ...account, userInfo }) as Account)))), + { initialValue: null as Account | null }, + ); constructor() { const route = inject(ActivatedRoute); @@ -74,19 +78,4 @@ export class AccountComponent extends AppRootComponent implements OnInit, OnDest this.route = route; } - - ngOnInit() { - this.sub = this.accountService.getMyAccount().subscribe((account) => { - this.userInfoApiService.getMyUserInfo().subscribe((userInfo) => { - const accountWithUserInfos = account; - accountWithUserInfos.userInfo = userInfo; - this.account = accountWithUserInfos; - }); - }); - this.dataBreadcrumb = [{ identifier: ApplicationId.PORTAL_APP }, { identifier: ApplicationId.ACCOUNTS_APP }]; - } - - ngOnDestroy() { - this.sub.unsubscribe(); - } } diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html index 58e1a9723ba..f542c33864e 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/header/header.component.html @@ -1,7 +1,7 @@ @@ -20,9 +20,9 @@
} -
+
- @if (hasTenantSelection) { + @if (hasTenantSelection()) { - @if (hasCustomerSelection) { + @if (hasCustomerSelection()) { @@ -25,7 +21,7 @@

{{ 'SPACING.MARGIN' | translate }}

{{ 'SPACING.GAP' | translate }}

@for (gap of gaps; track gap) { - hgap-{{ gap }} ({{ getGap(el) }}) + hgap-{{ gap }} ()
@@ -39,7 +35,7 @@

{{ 'SPACING.GAP' | translate }}

@for (gap of gaps; track gap) {
- gap-{{ gap }} ({{ getGap(el) }}) + gap-{{ gap }} ()
diff --git a/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/spacing.component.ts b/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/spacing.component.ts index 2abbcbf70b9..e9a6b3a4178 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/spacing.component.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/spacing.component.ts @@ -36,26 +36,15 @@ */ import { Component } from '@angular/core'; import { TranslatePipe } from '@ngx-translate/core'; +import { ComputedStyleDirective } from './computed-style.directive'; @Component({ templateUrl: './spacing.component.html', styleUrls: ['./spacing.component.scss'], - imports: [TranslatePipe], + imports: [TranslatePipe, ComputedStyleDirective], }) export class SpacingComponent { paddings = [0, 1, 2, 3, 4, 5, 6, 7, 8]; margins = [0, 1, 2, 3, 4, 5, 6, 7, 8, 'auto']; gaps = [0, 1, 2, 3, 4, 5, 6, 7, 8]; - - getPadding(element: HTMLElement) { - return getComputedStyle(element).padding; - } - - getMargin(element: HTMLElement) { - return getComputedStyle(element).margin; - } - - getGap(element: HTMLElement) { - return getComputedStyle(element).gap; - } } From d687e7323a5b07ff8b02a359f96d76a2ee593dea Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Mon, 7 Sep 2026 17:32:35 +0200 Subject: [PATCH 18/33] Story #16471: Clean code - fix prettier --- .../src/app/group/group-preview/group-preview.component.ts | 7 +------ .../hierarchy-detail/hierarchy-detail.component.ts | 7 +------ .../app/profile/profile-detail/profile-detail.component.ts | 7 +------ 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts index 55fd9d8917f..07e1b643905 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-preview/group-preview.component.ts @@ -37,12 +37,7 @@ import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; import { Subscription } from 'rxjs'; import type { Group } from 'vitamui-library'; -import { - AuthService, - isLevelAllowed, - OperationHistoryTabComponent, - VitamuiSidenavHeaderComponent, -} from 'vitamui-library'; +import { AuthService, isLevelAllowed, OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { GroupService } from '../group.service'; import { MatTab, MatTabGroup } from '@angular/material/tabs'; diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts index 317f92e8a08..88b5eeb540e 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-detail/hierarchy-detail.component.ts @@ -38,12 +38,7 @@ import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } fro import { Subscription } from 'rxjs'; import type { Profile } from 'vitamui-library'; -import { - AuthService, - isLevelAllowed, - OperationHistoryTabComponent, - VitamuiSidenavHeaderComponent, -} from 'vitamui-library'; +import { AuthService, isLevelAllowed, OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { HierarchyService } from '../hierarchy.service'; import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts index ebdb04074fd..912c82fe914 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-detail/profile-detail.component.ts @@ -37,12 +37,7 @@ import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { Subscription } from 'rxjs'; import type { Profile } from 'vitamui-library'; -import { - AuthService, - isLevelAllowed, - OperationHistoryTabComponent, - VitamuiSidenavHeaderComponent, -} from 'vitamui-library'; +import { AuthService, isLevelAllowed, OperationHistoryTabComponent, VitamuiSidenavHeaderComponent } from 'vitamui-library'; import { ProfileService } from '../profile.service'; import { MatTab, MatTabGroup } from '@angular/material/tabs'; import { InformationTabComponent } from './information-tab/information-tab.component'; From e4080b7b746ef3dee6eb2bd7edd70f73e2fc6da1 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Mon, 7 Sep 2026 17:36:40 +0200 Subject: [PATCH 19/33] Story #16471: Clean code - fix CI post rebase --- .../spacing/computed-style.directive.ts | 37 ++++++++++++++++++- .../owner-operation-history-tab.component.ts | 1 + .../owner-preview/owner-preview.component.ts | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/computed-style.directive.ts b/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/computed-style.directive.ts index 0692f26c869..0d0d40baeeb 100644 --- a/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/computed-style.directive.ts +++ b/ui/ui-frontend/projects/design-system/src/app/components/tokens/spacing/computed-style.directive.ts @@ -1,8 +1,43 @@ +/* + * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) + * and the signatories of the "VITAM - Accord du Contributeur" agreement. + * + * contact@programmevitam.fr + * + * This software is a computer program whose purpose is to implement + * implement a digital archiving front-office system for the secure and + * efficient high volumetry VITAM solution. + * + * This software is governed by the CeCILL-C license under French law and + * abiding by the rules of distribution of free software. You can use, + * modify and/ or redistribute the software under the terms of the CeCILL-C + * license as circulated by CEA, CNRS and INRIA at the following URL + * "http://www.cecill.info". + * + * As a counterpart to the access to the source code and rights to copy, + * modify and redistribute granted by the license, users are provided only + * with a limited warranty and the software's author, the holder of the + * economic rights, and the successive licensors have only limited + * liability. + * + * In this respect, the user's attention is drawn to the risks associated + * with loading, using, modifying and/or developing or reproducing the + * software by the user in light of its specific status of free software, + * that may mean that it is complicated to manipulate, and that also + * therefore means that it is reserved for developers and experienced + * professionals having in-depth computer knowledge. Users are therefore + * encouraged to load and test the software's suitability as regards their + * requirements in conditions enabling the security of their systems and/or + * data to be ensured and, more generally, to use and operate it in the + * same conditions as regards security. + * + * The fact that you are presently reading this means that you have had + * knowledge of the CeCILL-C license and that you accept its terms. + */ import { AfterViewInit, Directive, ElementRef, inject, input } from '@angular/core'; @Directive({ selector: '[designSystemComputedStyle]', - standalone: true, }) export class ComputedStyleDirective implements AfterViewInit { readonly property = input.required<'padding' | 'margin' | 'gap'>({ alias: 'designSystemComputedStyle' }); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts index 3dd911175b1..0b16ebe7a51 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-operation-history-tab/owner-operation-history-tab.component.ts @@ -35,6 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, Input, OnChanges, SimpleChanges, inject } from '@angular/core'; +import type { HistoryEvent } from 'vitamui-library'; import { AuthService, LogbookService, HistoryEventsComponent, CollapseComponent } from 'vitamui-library'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; import { TranslatePipe } from '@ngx-translate/core'; diff --git a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts index 0be82c51c49..5e5e6c49e0c 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/owner-preview/owner-preview.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, inject, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Input, Output } from '@angular/core'; import type { Owner, Tenant } from 'vitamui-library'; import { VitamuiSidenavHeaderComponent } from 'vitamui-library'; From 39a8388737278987e88b17854da4de22aaf5cd4a Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Mon, 7 Sep 2026 19:25:57 +0200 Subject: [PATCH 20/33] Story #16471: Clean code - WIP fix archive-search --- .../archive-search.component.html | 67 ++++---- .../archive-search.component.spec.ts | 16 +- .../archive-search.component.ts | 148 +++++++++++------- .../search-criteria-list.component.html | 6 +- .../search-criteria-list.component.spec.ts | 8 +- .../search-criteria-list.component.ts | 25 ++- .../simple-criteria-search.component.html | 24 +-- .../simple-criteria-search.component.ts | 43 ++--- .../src/app/archive/archive.component.html | 4 +- .../src/app/archive/archive.component.ts | 8 +- .../filing-holding-scheme.component.html | 10 +- .../filing-holding-scheme.component.ts | 20 +-- .../vitamui-breadcrumb.component.html | 52 +++--- .../vitamui-breadcrumb.component.ts | 33 ++-- 14 files changed, 259 insertions(+), 205 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.html b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.html index 6a77d515541..8c3264da0ac 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.html +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.html @@ -15,13 +15,17 @@
{{ 'ARCHIVE_SEARCH.TITLE_SEARCH' | translate }}
- - @@ -74,7 +78,7 @@
{{ 'ARCHIVE_SEARCH.TITLE_SEARCH' | translate }}
} - @if (!pendingComputeFacets && submitted && rulesFacetsComputed && showingFacets) { + @if (!pendingComputeFacets && submitted() && rulesFacetsComputed && showingFacets) {
{{ 'ARCHIVE_SEARCH.TITLE_SEARCH' | translate }} [holdRuleFacets]="archiveSearchResultFacets?.holdRuleFacets" [classificationRuleFacets]="archiveSearchResultFacets?.classificationRuleFacets" [tenantIdentifier]="tenantIdentifier" - [totalResults]="totalResults" + [totalResults]="totalResults()" [defaultFacetTabIndex]="defaultFacetTabIndex" >
} - @if (!pending) { + @if (!pending()) {
- @if (!showCriteriaPanel) { + @if (!showCriteriaPanel()) { {{ 'ARCHIVE_SEARCH.SHOW_SEARCH_CRITERIA' | translate }} } - @if (!pendingComputeFacets && !showingFacets && submitted) { + @if (!pendingComputeFacets && !showingFacets && submitted()) { {{ 'ARCHIVE_SEARCH.COMPUTE_RULES_FACETS' | translate }} }
} -
+
@@ -210,51 +214,52 @@
{{ 'ARCHIVE_SEARCH.TITLE_SEARCH' | translate }}
- @if (showCriteriaPanel) { + @if (showCriteriaPanel()) { }
-@if (submitted) { +@if (submitted()) {
- - - - - @if ((configService.config$ | async)?.REASSIGNMENT_ENABLED) { @@ -420,15 +425,15 @@
{{ 'ARCHIVE_SEARCH.TITLE_SEARCH' | translate }}
> diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts index a429aa1758d..83d74e0c08a 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.spec.ts @@ -234,7 +234,7 @@ describe('ArchiveSearchComponent', () => { it('should be false', () => { component.showHidePanel(false); - expect(component.showCriteriaPanel).toBeFalsy(); + expect(component.showCriteriaPanel()).toBeFalsy(); }); it('should call hasArchiveSearchRole', () => { @@ -267,7 +267,7 @@ describe('ArchiveSearchComponent', () => { }); describe('DOM', () => { - it('should have 5 rows ', () => { + it('should have 5 rows on init (no search yet, criteria panel expanded)', () => { // When const nativeElement = fixture.nativeElement; const elementRow = nativeElement.querySelectorAll('.row'); @@ -406,7 +406,17 @@ describe('ArchiveSearchComponent', () => { }); }); - it('should trigger a search with criteria matching the queryParams in the URL on page access', async () => { + it('should not trigger a search on portal landing (no query params on arrival)', async () => { + await setupTest({}); + + // Leave time for any asynchronous auto-submit to run. + await new Promise((resolve) => setTimeout(resolve, 500)); + + const currentCalls = vi.mocked(archiveServiceStub.searchArchiveUnitsByCriteria as Mock).mock.calls; + expect(currentCalls.length).toBe(0); + }); + + it('should trigger a search with criteria matching the queryParams in the URL on reload / deep link', async () => { await setupTest({ opi: '1234' }); await vi.waitFor(() => { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts index 3ae2584b7f4..253eb018382 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/archive-search.component.ts @@ -36,9 +36,7 @@ */ import { HttpErrorResponse } from '@angular/common/http'; import { - AfterContentChecked, AfterViewInit, - ChangeDetectorRef, Component, EventEmitter, inject, @@ -46,6 +44,7 @@ import { OnDestroy, OnInit, Output, + signal, SimpleChanges, TemplateRef, ViewChild, @@ -54,7 +53,7 @@ import { MatDialog, MatDialogActions, MatDialogClose, MatDialogConfig, MatDialog import { ActivatedRoute, Router } from '@angular/router'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { merge, Observable, Subject, Subscription } from 'rxjs'; -import { debounceTime, filter, map } from 'rxjs/operators'; +import { debounceTime, filter, map, take } from 'rxjs/operators'; import { ACCESS_RULE, AccessContract, @@ -219,7 +218,7 @@ const NON_TREE_UNIT_TYPES = [ARCHIVE_UNIT_FILING_UNIT, ARCHIVE_UNIT_WITH_OBJECTS InfiniteScrollDirective, ], }) -export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, AfterContentChecked, AfterViewInit { +export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit { archiveService = inject(ArchiveService); private archiveFacetsService = inject(ArchiveFacetsService); private translateService = inject(TranslateService); @@ -235,7 +234,6 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft private computeInheritedRulesService = inject(ComputeInheritedRulesService); private archiveUnitDipService = inject(ArchiveUnitDipService); private accessContractService = inject(AccessContractService); - private cdr = inject(ChangeDetectorRef); private queryParamsService = inject(QueryParamsService); private searchCriteriaService = inject(SearchCriteriaService); private ruleService = inject(RuleService); @@ -255,8 +253,8 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft direction = Direction.ASCENDANT; accessContractId: string; - accessContractAllowUpdating: boolean; - accessContractUpdatingRestrictedDesc: boolean; + accessContractAllowUpdating = signal(false); + accessContractUpdatingRestrictedDesc = signal(false); @Output() archiveUnitClick = new EventEmitter(); tenantIdentifier: number; @@ -269,28 +267,37 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft isAllChecked: boolean; hasResults = false; - hasReassignmentRole = false; - hasDipExportRole = false; - hasTransferRequestRole = false; - hasUpdateManagementRuleRole = false; - hasEliminationAnalysisOrActionRole = false; - hasComputedInheritedRulesRole = false; - hasReclassificationRole = false; - hasPreservationRole = false; + hasReassignmentRole = signal(false); + hasDipExportRole = signal(false); + hasTransferRequestRole = signal(false); + hasUpdateManagementRuleRole = signal(false); + hasEliminationAnalysisOrActionRole = signal(false); + hasComputedInheritedRulesRole = signal(false); + hasReclassificationRole = signal(false); + hasPreservationRole = signal(false); waitingToGetFixedCount = false; showDuaEndDate = false; - pending = false; + pending = signal(false); pendingComputeFacets = false; - submitted = false; + submitted = signal(false); pendingGetFixedCount = false; submitedGetFixedCount = false; included = false; canLoadMore = false; - showCriteriaPanel = true; + // Starts visible: no search runs on portal landing, the user starts it explicitly. + // submit() collapses the panel once a search is launched. + showCriteriaPanel = signal(true); + /** + * True when the page is opened with query params already present (reload or deep link + * with search criteria): the search runs automatically once criteria are ready. + * False on portal landing (bare URL): default criteria are prefilled without searching. + * Captured from the arrival snapshot in ngOnInit, before default params are injected. + */ + private shouldAutoSearchOnInit = false; defaultFacetTabIndex = 1; currentPage = 0; pageNumbers = 0; - totalResults = 0; + totalResults = signal(0); selectedItemCount = 0; selectedHoldingUnitItemCount = 0; itemNotSelected = 0; @@ -319,7 +326,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft archiveUnitAllunitup: string[]; hasAccessContractManagementPermissionsMessage = ''; bulkOperationsThreshold = -1; - hasTransferAcknowledgmentRole = false; + hasTransferAcknowledgmentRole = signal(false); selectedArchive$: Observable; rulesToExport$: Observable; @@ -521,8 +528,8 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft this.accessContractService.currentAccessContract$.subscribe((ac: AccessContract) => { this.accessContractId = ac.identifier; - this.accessContractAllowUpdating = ac.writingPermission; - this.accessContractUpdatingRestrictedDesc = ac.writingRestrictedDesc; + this.accessContractAllowUpdating.set(ac.writingPermission); + this.accessContractUpdatingRestrictedDesc.set(ac.writingRestrictedDesc); }); this.additionalSearchCriteriaCategoryIndex = 0; this.additionalSearchCriteriaCategories = []; @@ -542,6 +549,12 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft .navigate({ replaceUrl: true }); } + // Snapshot taken on arrival, before the default params are injected above: + // - portal landing (bare URL): prefill defaults, do NOT search; + // - reload or deep link with criteria: the search runs automatically (see ngAfterViewInit). + // Selecting criteria later never triggers a search by itself (submit stays explicit). + this.shouldAutoSearchOnInit = this.route.snapshot.queryParamMap.keys.length > 0; + const searchCriteriaChange = merge(this.orderChange, this.filterChange).pipe(debounceTime(FILTER_DEBOUNCE_TIME_MS)); searchCriteriaChange.subscribe(() => { this.submit(true); @@ -564,9 +577,28 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft .pipe(map((rules) => rules.sort((a, b) => a.ruleId.localeCompare(b.ruleId)))); } + // No automatic search on portal landing (see shouldAutoSearchOnInit set in ngOnInit). + // On reload / deep link with criteria, the search runs automatically once the + // searchCriteriaService is ready (i.e.: schema retrieved, URL criteria applied). + // Reactive subscription (not snapshot): the default query params may be added by an async + // navigation, so the snapshot may still be empty here. take(1) guarantees a single submit: + // selecting criteria afterwards never triggers a search by itself. + // A schema failure must not block the initial search either. ngAfterViewInit() { - // Trigger the search if we land on the page with query params, but only after searchCriteriaService is ready (i.e.: schema has been retrieved) in order to trigger search only after criteria have been set from the URL query params - if (this.route.snapshot.queryParamMap.keys.length) this.searchCriteriaService.ready().then(() => setTimeout(() => this.submit(true))); + if (!this.shouldAutoSearchOnInit) return; + this.searchCriteriaService + .ready() + .catch((): void => undefined) + .then(() => { + this.subscriptions.add( + this.route.queryParamMap + .pipe( + filter((params) => params.keys.length > 0), + take(1), + ) + .subscribe(() => setTimeout(() => this.submit(true))), + ); + }); } ngOnChanges(changes: SimpleChanges): void { @@ -575,10 +607,6 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft } } - ngAfterContentChecked(): void { - this.cdr.detectChanges(); - } - toManagementRuleType = toManagementRuleType; toUpdateOn(category: SearchCriteriaCategory) { @@ -594,7 +622,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft } showHidePanel(show: boolean) { - this.showCriteriaPanel = show; + this.showCriteriaPanel.set(show); } showStoredSearchCriteria(event: SearchCriteriaHistory) { @@ -626,8 +654,8 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft removeCriteria(keyElt: string, valueElt: CriteriaValue, emit: boolean) { this.archiveHelperService.removeCriteria(keyElt, valueElt, emit, this.searchCriteriaKeys, this.searchCriterias, this.nbQueryCriteria); if (this.searchCriterias && this.searchCriterias.size === 0) { - this.submitted = false; - this.showCriteriaPanel = true; + this.submitted.set(false); + this.showCriteriaPanel.set(true); this.archiveUnits = []; this.archiveSharedDataService.emitNodeTarget(null); } @@ -728,7 +756,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft pageNumber: 0, size: 1, sortingCriteria, - trackTotalHits: this.totalResults >= 10000, + trackTotalHits: this.totalResults() >= 10000, computeMgtRulesFacets: true, facets: facets, }; @@ -754,7 +782,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft this.pendingComputeFacets = true; this.showingFacets = false; } - this.pending = true; + this.pending.set(true); let facets: TermsFacet[] = []; facets.push(ALL_DESCENDANTS_FACET); if (includeFacets) { @@ -784,16 +812,16 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft this.archiveSearchResultFacets.nodesFacets = this.archiveFacetsService.extractNodesFacetsResults(pagedResult.facets); this.archiveSharedDataService.emitFacets(this.archiveSearchResultFacets.nodesFacets); this.hasResults = true; - this.totalResults = pagedResult.totalResults; - this.archiveSharedDataService.emitTotalResults(this.totalResults); + this.totalResults.set(pagedResult.totalResults); + this.archiveSharedDataService.emitTotalResults(this.totalResults()); } else if (pagedResult.results) { this.hasResults = true; this.archiveUnits = [...this.archiveUnits, ...pagedResult.results]; } this.pageNumbers = pagedResult.pageNumbers; - this.waitingToGetFixedCount = this.totalResults === this.vitamConfigurationService.tenantConfig()?.resultThreshold; + this.waitingToGetFixedCount = this.totalResults() === this.vitamConfigurationService.tenantConfig()?.resultThreshold; if (this.isAllChecked) { - this.selectedItemCount = this.totalResults - this.itemNotSelected; + this.selectedItemCount = this.totalResults() - this.itemNotSelected; } this.canLoadMore = this.currentPage < this.pageNumbers - 1; this.archiveHelperService.updateCriteriaStatus( @@ -801,12 +829,12 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft SearchCriteriaStatusEnum.IN_PROGRESS, SearchCriteriaStatusEnum.INCLUDED, ); - this.pending = false; + this.pending.set(false); this.included = true; }, (error: HttpErrorResponse) => { this.canLoadMore = false; - this.pending = false; + this.pending.set(false); if (includeFacets) { this.pendingComputeFacets = false; this.archiveSharedDataService.emitFacets([]); @@ -823,7 +851,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft } onArchiveUnitCountChange(resultCount: number) { - this.totalResults = resultCount; + this.totalResults.set(resultCount); this.archiveSharedDataService.emitTotalResults(resultCount); } @@ -978,14 +1006,14 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft } loadMore() { - if (this.pending) { + if (this.pending()) { return; } this.canLoadMore = this.currentPage < this.pageNumbers - 1; if (!this.canLoadMore) { return; } - this.submitted = true; + this.submitted.set(true); this.currentPage = this.currentPage + 1; if (!this.hasSearchCriteria()) { return; @@ -1008,7 +1036,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft this.submitedGetFixedCount = true; const exactCountResults: number = await this.archiveService.getTotalTrackHitsByCriteria(this.criteriaSearchList).toPromise(); if (exactCountResults !== -1) { - this.totalResults = exactCountResults; + this.totalResults.set(exactCountResults); this.waitingToGetFixedCount = false; this.managementRulesSharedDataService.emitHasExactCount(true); this.launchComputingManagementRulesFacets(); @@ -1077,7 +1105,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft this.included = false; this.nbQueryCriteria = 0; this.pageNumbers = 0; - this.totalResults = 0; + this.totalResults.set(0); this.selectedItemCount = 0; this.isAllChecked = false; this.isIndeterminate = false; @@ -1094,7 +1122,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft const { checked } = event; this.isAllChecked = checked; - this.selectedItemCount = checked ? this.totalResults : 0; + this.selectedItemCount = checked ? this.totalResults() : 0; this.selectedHoldingUnitItemCount = 0; if (!checked) { this.isIndeterminate = false; @@ -1130,7 +1158,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft } this.listOfUACriteriaSearch = []; this.selectedItemCount++; - if (this.selectedItemCount === this.totalResults) { + if (this.selectedItemCount === this.totalResults()) { this.isIndeterminate = false; } if (this.isAllChecked) { @@ -1152,9 +1180,9 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft } private initializeSelectionParams() { - this.pending = true; - this.submitted = true; - this.showCriteriaPanel = false; + this.pending.set(true); + this.submitted.set(true); + this.showCriteriaPanel.set(false); this.currentPage = 0; this.archiveUnits = []; this.criteriaSearchList = []; @@ -1169,28 +1197,28 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft this.archiveService.hasArchiveSearchRole(role, tenantIdentifier).subscribe((result) => { switch (role) { case VitamuiRoles.ROLE_EXPORT_DIP: - this.hasDipExportRole = result; + this.hasDipExportRole.set(result); break; case VitamuiRoles.ROLE_TRANSFER_REQUEST: - this.hasTransferRequestRole = result; + this.hasTransferRequestRole.set(result); break; case VitamuiRoles.ROLE_ELIMINATION: - this.hasEliminationAnalysisOrActionRole = result; + this.hasEliminationAnalysisOrActionRole.set(result); break; case VitamuiRoles.ROLE_ARCHIVE_SEARCH_UPDATE_ARCHIVE_UNIT: - this.hasUpdateManagementRuleRole = result; + this.hasUpdateManagementRuleRole.set(result); break; case VitamuiRoles.ROLE_COMPUTED_INHERITED_RULES: - this.hasComputedInheritedRulesRole = result; + this.hasComputedInheritedRulesRole.set(result); break; case VitamuiRoles.ROLE_RECLASSIFICATION: - this.hasReclassificationRole = result; + this.hasReclassificationRole.set(result); break; case VitamuiRoles.ROLE_LAUNCH_PRESERVATION: - this.hasPreservationRole = result; + this.hasPreservationRole.set(result); break; case VitamuiRoles.ROLE_TRANSFER_ACKNOWLEDGMENT: - this.hasTransferAcknowledgmentRole = result; + this.hasTransferAcknowledgmentRole.set(result); break; default: break; @@ -1268,9 +1296,9 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft this.submitedGetFixedCount = true; const exactCountResults: number = await this.archiveService.getTotalTrackHitsByCriteria(this.criteriaSearchList).toPromise(); if (exactCountResults !== -1) { - this.totalResults = exactCountResults; + this.totalResults.set(exactCountResults); if (this.isAllChecked) { - this.selectedItemCount = this.totalResults - this.itemNotSelected; + this.selectedItemCount = this.totalResults() - this.itemNotSelected; } this.waitingToGetFixedCount = false; this.managementRulesSharedDataService.emitHasExactCount(true); @@ -1322,7 +1350,7 @@ export class ArchiveSearchComponent implements OnInit, OnChanges, OnDestroy, Aft private hasRole(role: string): void { const appId = 'ARCHIVE_SEARCH_MANAGEMENT_APP'; this.securityService.hasRole$(appId, role, this.tenantIdentifier).subscribe((result) => { - return (this.hasReassignmentRole = result); + return this.hasReassignmentRole.set(result); }); } diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.html b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.html index a9eeb19e292..791d06f8ea0 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.html +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.html @@ -1,5 +1,5 @@
- @for (criteria of searchCriteriaHistory; track criteria) { + @for (criteria of searchCriteriaHistory(); track criteria) { } - @if (pending) { + @if (pending()) {
diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts index a56be4d215b..ac68c3462bf 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.spec.ts @@ -184,7 +184,7 @@ describe('SearchCriteriaListComponent', () => { }, ]; - component.searchCriteriaHistory = searchCriteriaHistory$; + component.searchCriteriaHistory.set(searchCriteriaHistory$); }); it('should call getSearchCriteriaHistory of SearchCriteriaListService', () => { @@ -195,14 +195,14 @@ describe('SearchCriteriaListComponent', () => { component.getSearchCriteriaHistory(); // Then - expect(component.pending).toBeFalsy(); + expect(component.pending()).toBeFalsy(); expect(SearchCriteriaListServiceStub.getSearchCriteriaHistory).toHaveBeenCalled(); }); it('should delete searchCriteria', () => { component.clearElement(searchCriteriaHistory$[0].id); - expect(component.searchCriteriaHistory.length).toEqual(1); - expect(component.searchCriteriaHistory[0].name).toEqual('Second Save'); + expect(component.searchCriteriaHistory().length).toEqual(1); + expect(component.searchCriteriaHistory()[0].name).toEqual('Second Save'); }); }); }); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts index 22259c7ab64..3f5e3c7d01d 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/search-criteria-list/search-criteria-list.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, inject, OnDestroy, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, inject, OnDestroy, OnInit, Output, signal } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; @@ -62,7 +62,7 @@ export class SearchCriteriaListComponent implements OnInit, OnDestroy { @Output() storedSearchCriteriaHistory = new EventEmitter(); - searchCriteriaHistory: SearchCriteriaHistory[]; + searchCriteriaHistory = signal([]); private readonly orderChange = new Subject(); direction: Direction = Direction.ASCENDANT; @@ -70,15 +70,16 @@ export class SearchCriteriaListComponent implements OnInit, OnDestroy { subscriptionSearchCriteriaHistory: Subscription; keyPressSubscription: Subscription; - pending = false; + pending = signal(false); ngOnInit() { this.subscriptionSearchCriteriaHistoryShared = this.archiveSharedDataService .getSearchCriteriaHistoryShared() .subscribe((searchCriteriaHistoryResults) => { if (searchCriteriaHistoryResults) { - this.searchCriteriaHistory.push(searchCriteriaHistoryResults); - this.archiveSharedDataService.sort(Direction.ASCENDANT, this.searchCriteriaHistory); + const next = [...this.searchCriteriaHistory(), searchCriteriaHistoryResults]; + this.archiveSharedDataService.sort(Direction.ASCENDANT, next); + this.searchCriteriaHistory.set(next); } }); this.getSearchCriteriaHistory(); @@ -95,12 +96,12 @@ export class SearchCriteriaListComponent implements OnInit, OnDestroy { } getSearchCriteriaHistory() { - this.pending = true; + this.pending.set(true); this.subscriptionSearchCriteriaHistory = this.searchCriteriaListService.getSearchCriteriaHistory().subscribe((data) => { - this.searchCriteriaHistory = data; - this.archiveSharedDataService.sort(Direction.ASCENDANT, this.searchCriteriaHistory); + this.archiveSharedDataService.sort(Direction.ASCENDANT, data); + this.searchCriteriaHistory.set(data); this.archiveSharedDataService.emitAllSearchCriteriaHistory(data); - this.pending = false; + this.pending.set(false); }); } @@ -126,10 +127,6 @@ export class SearchCriteriaListComponent implements OnInit, OnDestroy { } clearElement(id: string) { - for (let i = 0; i < this.searchCriteriaHistory.length; i++) { - if (this.searchCriteriaHistory[i].id === id) { - this.searchCriteriaHistory.splice(i, 1); - } - } + this.searchCriteriaHistory.set(this.searchCriteriaHistory().filter((criteria) => criteria.id !== id)); } } diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.html b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.html index d17d471a277..dc5ec3bbf9b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.html +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.html @@ -1,13 +1,14 @@
- @if (titleSearchTypes) { - @if (titleSearchTypes?.length) { + @if (titleSearchTypes()) { + @if (titleSearchTypes()?.length) { } @else { @@ -54,7 +55,7 @@ [multiple]="true" [enableSelectAll]="false" formControlName="agencies" - [options]="selectOptions.agency" + [options]="selectOptions().agency" [placeholder]="'ARCHIVE_SEARCH.SEARCH_CRITERIA_FILTER.FIELDS.SP' | translate" [searchBarPlaceHolder]="'ARCHIVE_SEARCH.SEARCH_CRITERIA_FILTER.FIELDS.SP_PLACEHOLDER' | translate" class="w-100" @@ -64,7 +65,7 @@ [multiple]="true" [enableSelectAll]="false" formControlName="archiveUnitProfiles" - [options]="selectOptions.archiveUnitProfile" + [options]="selectOptions().archiveUnitProfile" [placeholder]="'ARCHIVE_SEARCH.SEARCH_CRITERIA_FILTER.FIELDS.AUP' | translate" [searchBarPlaceHolder]="'ARCHIVE_SEARCH.SEARCH_CRITERIA_FILTER.FIELDS.AUP_PLACEHOLDER' | translate" class="w-100" @@ -123,13 +124,13 @@

{{ 'ARCHIVE_SEARCH.SEARCH_CRITERIA_FILTER.FIELDS.OTHER_FIELDS' | translate }}

- @if (otherCriteriaOptions) { + @if (otherCriteriaOptions()) {
@for (otherCriteria of otherCriteriaList.value; track otherCriteria.ApiPath) { - @if (['Title'].includes(otherCriteria.ApiPath) && titleSearchTypes?.length) { + @if (['Title'].includes(otherCriteria.ApiPath) && titleSearchTypes()?.length) { } @else if (['TEXT', 'KEYWORD', 'BOOLEAN', 'LONG'].includes(otherCriteria.Type)) { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts index 13c1f875216..7122a7075f1 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/simple-criteria-search/simple-criteria-search.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { ChangeDetectorRef, Component, inject, OnInit } from '@angular/core'; +import { Component, inject, OnInit, signal } from '@angular/core'; import { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogModule } from '@angular/material/dialog'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; @@ -132,7 +132,6 @@ export class SimpleCriteriaSearchComponent implements OnInit { private schemaService = inject(SchemaService); private agencyService = inject(AgencyService); private archiveUnitProfilesService = inject(ArchiveUnitProfilesService); - private cdr = inject(ChangeDetectorRef); form: FormGroup; criteriaSearchListToSave: SearchCriteriaEltDto[] = []; @@ -144,17 +143,17 @@ export class SimpleCriteriaSearchComponent implements OnInit { [ARCHIVE_UNIT_WITHOUT_OBJECTS, false], ]); - otherCriteriaOptions: ItemNode[]; + otherCriteriaOptions = signal[]>(undefined); getOtherCriteriaDisplayValue = (element: SchemaElement) => `${element.Origin === 'EXTERNAL' ? 'EXT-' : ''}${element.ShortName} - ${element.FieldName}`; - titleSearchTypes: SearchType[]; - titleSelectedType?: SearchType; + titleSearchTypes = signal(undefined); + titleSelectedType = signal(undefined); - selectOptions = { + selectOptions = signal({ agency: { options: [] as Option[] }, archiveUnitProfile: { options: [] as Option[] }, - } satisfies { [key: string]: VitamuiSelectOptions }; + } satisfies { [key: string]: VitamuiSelectOptions }); constructor() { const otherCriteriaListControl = this.formBuilder.control([]); @@ -194,7 +193,9 @@ export class SimpleCriteriaSearchComponent implements OnInit { }), ), ) - .subscribe((options) => (this.selectOptions.agency = options)); + .subscribe((options) => { + this.selectOptions.update((selectOptions) => ({ ...selectOptions, agency: options })); + }); this.archiveUnitProfilesService .getAll() @@ -208,18 +209,21 @@ export class SimpleCriteriaSearchComponent implements OnInit { }), ), ) - .subscribe((options) => (this.selectOptions.archiveUnitProfile = options)); + .subscribe((options) => { + this.selectOptions.update((selectOptions) => ({ ...selectOptions, archiveUnitProfile: options })); + }); const descriptiveSchemaTree$ = this.schemaService.getDescriptiveSchemaTree().pipe(share()); - descriptiveSchemaTree$.subscribe((schema) => (this.otherCriteriaOptions = schema)); + descriptiveSchemaTree$.subscribe((schema) => { + this.otherCriteriaOptions.set(schema); + }); const titleSearchTypes$ = descriptiveSchemaTree$.pipe( map((schema) => this.searchTypes(schema, 'Title')), share(), ); titleSearchTypes$.subscribe((titleSearchTypes) => { - this.titleSearchTypes = titleSearchTypes; - this.cdr.detectChanges(); // Force la détection de changements + this.titleSearchTypes.set(titleSearchTypes); }); const otherCriteriaControl = this.form.controls['otherCriteria'] as FormGroup; @@ -239,12 +243,13 @@ export class SimpleCriteriaSearchComponent implements OnInit { combineLatest([titleKeys$, titleSearchTypes$]).subscribe(([titleKeys, titleSearchTypes]) => { const hasTitleSearchCriteria = !!titleKeys?.length; const type = hasTitleSearchCriteria ? titleKeys[0].split('.')[1] || '' : null; - this.titleSearchTypes = titleSearchTypes.map((item) => ({ - ...item, - disabled: hasTitleSearchCriteria && item.value !== type, - })); - if (hasTitleSearchCriteria) this.titleSelectedType = this.titleSearchTypes.find((item) => item.value === type); - this.cdr.detectChanges(); // Force la détection de changements + this.titleSearchTypes.set( + titleSearchTypes.map((item) => ({ + ...item, + disabled: hasTitleSearchCriteria && item.value !== type, + })), + ); + if (hasTitleSearchCriteria) this.titleSelectedType.set(this.titleSearchTypes().find((item) => item.value === type)); }); // Sync archive unit types with criteria @@ -343,7 +348,7 @@ export class SimpleCriteriaSearchComponent implements OnInit { getCriteriaName(criteria: SchemaElement) { const path = criteria.Path.split('.').slice(0, -1); const parent = path.reduce((acc, p) => acc.children.find((o) => o.item.FieldName === p), { - children: this.otherCriteriaOptions, + children: this.otherCriteriaOptions(), } as ItemNode); return `${criteria.ShortName}${parent?.item ? ` (${parent.item.ShortName})` : ''}`; } diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.html b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.html index 29e472c7d3c..207e4020c36 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.html +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.html @@ -1,5 +1,5 @@ - @if (foundAccessContract) { + @if (foundAccessContract()) { @@ -29,7 +29,7 @@
{{ 'APPLICATION.ARCHIVE_SEARCH_MANAGEMENT_APP.NAME' | translate }}
- @if (foundAccessContract) { + @if (foundAccessContract()) {
@if (!show) { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts index 9c7dbf18c0f..a2e452b8d63 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts @@ -34,7 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, inject, OnInit } from '@angular/core'; +import { Component, inject, OnInit, signal } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { @@ -94,7 +94,9 @@ export class ArchiveComponent extends SidenavPage implements OnInit { show = true; tenantIdentifier: string; - foundAccessContract = false; + // Signal (et non booléen) : la notification via ChangeDetectionScheduler planifie un tick + // même si la zone ne notifie pas la fin des callbacks HTTP. + foundAccessContract = signal(false); bulkOperationsThreshold: number; isLPExtended = false; hasUpdateDescriptiveUnitMetadataRole = false; @@ -133,7 +135,7 @@ export class ArchiveComponent extends SidenavPage implements OnInit { fetchUserExternalParameters() { this.accessContractService.currentAccessContractId$.subscribe((accessContractId) => { if (accessContractId && accessContractId.length > 0) { - this.foundAccessContract = true; + this.foundAccessContract.set(true); this.managementRulesSharedDataService.emitAccessContract(accessContractId); } else { this.snackBarService.open({ diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.html b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.html index 465708f1aee..20c19d39e90 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.html +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/filing-holding-scheme/filing-holding-scheme.component.html @@ -1,10 +1,10 @@
-@if (hasMatchesInSearch) { +@if (hasMatchesInSearch()) {
} -@if (hasMatchesInSearch) { +@if (hasMatchesInSearch()) {
= new MatTreeNestedDataSource(); disabled: boolean; - loadingHolding = true; + loadingHolding = signal(true); node: string; nodeData: NodeData; fullNodes: FilingHoldingSchemeNode[] = []; - showEveryNodes = true; + showEveryNodes = signal(true); requestResultFacets: ResultFacet[]; - hasMatchesInSearch = false; + hasMatchesInSearch = signal(false); requestResultsInFilingPlan: number; requestTotalResults: number; loadingArchiveUnit: { [key: string]: boolean } = { @@ -109,7 +109,7 @@ export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { this.subscribeResetNodesOnFilingHoldingNodesChanges(); this.subscribeOnNodeSelectionToSetCheck(); this.subscribeOnFacetsChangesToResetCounts(); - this.loadingHolding = true; + this.loadingHolding.set(true); this.loadFilingHoldingSchemeTree(); } @@ -164,7 +164,7 @@ export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { // keeps last child with result only this.nestedDataSourceLeaves.data = FilingHoldingSchemeHandler.keepEndNodesWithResultsOnly(this.fullNodes); this.addOrRemoveOrphansNode(numberOfOrphanNodes); - this.showEveryNodes = false; + this.showEveryNodes.set(false); } private refreshTreeNodes() { @@ -196,14 +196,14 @@ export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { } loadFilingHoldingSchemeTree() { - this.loadingHolding = true; + this.loadingHolding.set(true); this.subscriptions.add( this.archiveService.loadFilingHoldingSchemeTree(this.tenantIdentifier).subscribe((nodes) => { this.fullNodes = nodes; this.nestedDataSourceFull.data = nodes; this.nestedTreeControlFull.dataNodes = nodes; this.archiveSharedDataService.emitFilingHoldingNodes(nodes); - this.loadingHolding = false; + this.loadingHolding.set(false); }), ); } @@ -225,7 +225,7 @@ export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { } switchViewAllNodes() { - this.showEveryNodes = !this.showEveryNodes; + this.showEveryNodes.update((show) => !show); } emitClose() { @@ -259,7 +259,7 @@ export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { private subscribeOnTotalResultsChange(): void { this.subscriptions.add( this.archiveSharedDataService.getTotalResults().subscribe((resultCount) => { - this.hasMatchesInSearch = resultCount > 0; + this.hasMatchesInSearch.set(resultCount > 0); this.requestTotalResults = resultCount; }), ); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.html b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.html index 6bf871200b9..2b560d50cf9 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.html +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.html @@ -1,31 +1,33 @@ diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.ts index 6755c25a4ff..da928c8a4ac 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/vitamui-title-breadcrumb/vitamui-breadcrumb/vitamui-breadcrumb.component.ts @@ -34,7 +34,8 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, inject, Input, OnInit, Output } from '@angular/core'; +import { Component, computed, EventEmitter, inject, input, Output, Signal } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; import { ActivatedRoute } from '@angular/router'; import { ApplicationId } from '../../../application-id.enum'; import { ApplicationService } from '../../../application.service'; @@ -49,28 +50,30 @@ import { TranslatePipe } from '@ngx-translate/core'; styleUrls: ['./vitamui-breadcrumb.component.scss'], imports: [CommonModule, TranslatePipe], }) -export class VitamuiBreadcrumbComponent implements OnInit { +export class VitamuiBreadcrumbComponent { private route = inject(ActivatedRoute); private applicationService = inject(ApplicationService); - @Input() - public data: BreadCrumbData[]; + public data = input(); @Output() public selected = new EventEmitter(); - ngOnInit() { - if (!this.data) { - const appId = this.route.snapshot.data['appId']; - if (appId) { - this.applicationService.getAppById(appId).subscribe((app: Application) => { - this.data = [{ identifier: ApplicationId.PORTAL_APP }, { label: app.name, identifier: appId }]; - }); - } else { - console.error('NO appId'); - } + private readonly appId: string = this.route.snapshot.data['appId']; + + private readonly app: Signal = this.appId ? toSignal(this.applicationService.getAppById(this.appId)) : undefined; + + protected readonly breadcrumb: Signal = computed(() => { + const inputData = this.data(); + if (inputData?.length) return inputData; + if (!this.appId) { + console.error('NO appId'); + return undefined; } - } + const app = this.app?.(); + if (!app) return undefined; + return [{ identifier: ApplicationId.PORTAL_APP }, { label: app.name, identifier: this.appId }]; + }); public onClick(d: BreadCrumbData, emit: boolean): void { if (emit) { From 7f0f95f37f68ac243e5738a1bb8bfd66df0192c2 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Tue, 8 Sep 2026 12:28:47 +0200 Subject: [PATCH 21/33] Story #16471: Clean code - fix stepper --- .../components/stepper/stepper.component.scss | 8 +++++++- .../vitamui-library/src/sass/_animations.scss | 19 ------------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss index 6773d975953..33448aab1b4 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/components/stepper/stepper.component.scss @@ -1 +1,7 @@ -// step styles centralised in sass/_animations.scss +.step { + outline: none; + + &.hidden { + overflow: hidden; + } +} diff --git a/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss b/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss index 6a6ea152cdf..8085f1b86c1 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss +++ b/ui/ui-frontend/projects/vitamui-library/src/sass/_animations.scss @@ -110,22 +110,3 @@ .collapsible.is-collapsed { grid-template-rows: 0fr; } - -// Generic collapsible used by archive/collect preview tabs (former trigger collapse 300ms) -.collapsible { - display: grid; - overflow: hidden; - grid-template-rows: 1fr; - visibility: visible; - transition: - grid-template-rows 300ms ease-in-out, - visibility 300ms ease-in-out; - > * { - min-height: 0; - } -} -.collapsible.collapsed, -.collapsible.is-collapsed { - grid-template-rows: 0fr; - visibility: hidden; -} From 848b855ac0d12a42ae7475afea0b73570da27666 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Tue, 8 Sep 2026 15:06:34 +0200 Subject: [PATCH 22/33] Story #16471: Clean code - WIP fix collect --- .../archive-search-collect.component.html | 35 +++++----- .../archive-search-collect.component.spec.ts | 2 +- .../archive-search-collect.component.ts | 58 ++++++++-------- .../filing-holding-scheme.component.html | 2 +- .../filing-holding-scheme.component.ts | 8 +-- .../search-criteria-list.component.html | 6 +- .../search-criteria-list.component.spec.ts | 6 +- .../search-criteria-list.component.ts | 25 +++---- .../simple-criteria-search.component.html | 8 +-- .../simple-criteria-search.component.ts | 22 +++--- .../project-list/project-list.component.html | 10 +-- .../project-list/project-list.component.ts | 16 ++--- .../transaction-list.component.html | 14 ++-- .../transaction-list.component.ts | 34 +++++----- .../customer-list.component.html | 8 +-- .../customer-list.component.spec.ts | 8 +-- .../customer-list/customer-list.component.ts | 18 +++-- ...external-param-profile-list.component.html | 8 +-- .../external-param-profile-list.component.ts | 36 +++++----- .../group-list/group-list.component.html | 8 +-- .../group-list/group-list.component.spec.ts | 18 ++--- .../group/group-list/group-list.component.ts | 12 ++-- .../hierarchy-list.component.html | 8 +-- .../hierarchy-list.component.ts | 42 ++++++------ .../profile-list/profile-list.component.html | 8 +-- .../profile-list/profile-list.component.ts | 44 ++++++------ .../subrogate-user-list.component.html | 8 +-- .../subrogate-user-list.component.ts | 8 +-- .../user/user-list/user-list.component.html | 4 +- .../app/user/user-list/user-list.component.ts | 12 ++-- .../ingest-list/ingest-list.component.html | 4 +- .../ingest-list/ingest-list.component.ts | 14 ++-- .../access-contract-list.component.html | 8 +-- .../access-contract-list.component.ts | 18 +++-- .../accession-register-list.component.html | 10 +-- .../agency-list/agency-list.component.html | 6 +- .../agency-list/agency-list.component.ts | 12 ++-- .../audit-list/audit-list.component.html | 6 +- .../audit/audit-list/audit-list.component.ts | 28 +++++--- .../context-list/context-list.component.html | 8 +-- .../context-list/context-list.component.ts | 14 ++-- .../file-format-list.component.html | 8 +-- .../file-format-list.component.ts | 14 ++-- .../ingest-contract-list.component.html | 8 +-- .../ingest-contract-list.component.ts | 68 ++++++++++--------- .../logbook-operation-list.component.html | 8 +-- .../logbook-operation-list.component.spec.ts | 2 +- .../logbook-operation-list.component.ts | 16 +++-- .../logbook-operation.component.ts | 2 +- .../management-contract-list.component.html | 4 +- ...management-contract-list.component.spec.ts | 2 +- .../management-contract-list.component.ts | 20 +++--- .../ontology-list.component.html | 8 +-- .../ontology-list/ontology-list.component.ts | 18 +++-- .../probative-value-list.component.html | 8 +-- .../probative-value-list.component.ts | 2 +- .../rule/rule-list/rule-list.component.html | 8 +-- .../app/rule/rule-list/rule-list.component.ts | 2 +- .../securisation-list.component.html | 8 +-- .../securisation-list.component.ts | 2 +- .../security-profile-list.component.html | 8 +-- .../security-profile-list.component.ts | 2 +- .../vitamui-table/infinite-scroll-table.ts | 33 ++++----- 63 files changed, 473 insertions(+), 402 deletions(-) diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.html b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.html index 1f1d41e11cc..32fc6ceff7b 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.html +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.html @@ -1,11 +1,11 @@ - @if (foundAccessContract) { + @if (foundAccessContract()) { @@ -50,7 +50,7 @@
- @if (foundAccessContract) { + @if (foundAccessContract()) {
@@ -151,9 +151,9 @@
} - @if (!pendingComputeFacets && submited && rulesFacetsComputed && showingFacets) { + @if (!pendingComputeFacets && submited() && rulesFacetsComputed && showingFacets) {
- @if (!pendingComputeFacets && showingFacets && submited) { + @if (!pendingComputeFacets && showingFacets && submited()) { [holdRuleFacets]="archiveSearchResultFacets?.holdRuleFacets" [classificationRuleFacets]="archiveSearchResultFacets?.classificationRuleFacets" [tenantIdentifier]="tenantIdentifier" - [totalResults]="totalResults" + [totalResults]="totalResults()" [defaultFacetTabIndex]="defaultFacetTabIndex" >
} - @if (!pending) { + @if (!pending()) {
- @if (!showCriteriaPanel) { + @if (!showCriteriaPanel()) { {{ 'COLLECT.SHOW_SEARCH_CRITERIA' | translate }} } - @if (!pendingComputeFacets && !showingFacets && submited) { + @if (!pendingComputeFacets && !showingFacets && submited()) { {{ 'COLLECT.COMPUTE_RULES_FACETS' | translate }} }
} -
+
@@ -285,7 +285,7 @@
- @if (showCriteriaPanel) { + @if (showCriteriaPanel()) { @@ -296,11 +296,12 @@
@@ -308,7 +309,7 @@
@@ -427,15 +428,15 @@
> diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index dec5bfa2a4e..f0dd7a060c0 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -206,7 +206,7 @@ describe('ArchiveSearchCollectComponent', () => { component.submit(); // Then - expect(component.submited).toBeTruthy(); + expect(component.submited()).toBeTruthy(); expect(component.itemSelected).toBe(0); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts index 405f33d0e39..abcd79b6a2a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { HttpErrorResponse } from '@angular/common/http'; -import { AfterViewInit, Component, inject, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { AfterViewInit, Component, inject, OnDestroy, OnInit, signal, TemplateRef, ViewChild } from '@angular/core'; import { MatDialog, MatDialogActions, MatDialogClose, MatDialogConfig, MatDialogContent } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; @@ -243,7 +243,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O transaction: Transaction; private transaction$: Observable; - foundAccessContract = false; + foundAccessContract = signal(false); accessContractUpdatingRestrictedDesc: boolean; hasUnitaryUpdateUnitRole = false; hasDeleteArchiveUnitActionRole = false; @@ -261,7 +261,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O nbQueryCriteria = 0; additionalSearchCriteriaCategoryIndex = 0; included = false; - showCriteriaPanel = true; + showCriteriaPanel = signal(true); showSearchCriteriaPanel = false; archiveUnits: Unit[]; @@ -271,15 +271,15 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O nodeArray: FilingHoldingSchemeNode[] = []; // AU Search Properties - pending = false; - submited = false; + pending = signal(false); + submited = signal(false); currentPage = 0; itemSelected = 0; itemNotSelected = 0; isIndeterminate: boolean; isAllChecked: boolean; waitingToGetFixedCount = false; - totalResults = 0; + totalResults = signal(0); orderBy = 'Title'; direction = Direction.ASCENDANT; searchHasResults = false; @@ -663,9 +663,9 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O } private initializeSelectionParams() { - this.pending = true; - this.submited = true; - this.showCriteriaPanel = false; + this.pending.set(true); + this.submited.set(true); + this.showCriteriaPanel.set(false); this.showSearchCriteriaPanel = false; this.currentPage = 0; this.archiveUnits = []; @@ -683,7 +683,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O const accessContractId: string = parameters.get(ExternalParameters.PARAM_ACCESS_CONTRACT); if (accessContractId && accessContractId.length > 0) { this.accessContract = accessContractId; - this.foundAccessContract = true; + this.foundAccessContract.set(true); this.fetchVitamAccessContract(); } else { this.snackBarService.open({ @@ -741,7 +741,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O this.showingFacets = false; } // Prepare criteria and store them to use for lateral panel - this.pending = true; + this.pending.set(true); const sortingCriteria = { criteria: this.orderBy, sorting: this.direction }; let facets: TermsFacet[] = []; @@ -772,16 +772,16 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O this.archiveUnits = pagedResult.results; this.searchHasResults = !isEmpty(pagedResult.results); this.archiveSearchResultFacets.nodesFacets = this.archiveFacetsService.extractNodesFacetsResults(pagedResult.facets); - this.totalResults = pagedResult.totalResults; - this.archiveSharedDataService.emitTotalResults(this.totalResults); + this.totalResults.set(pagedResult.totalResults); + this.archiveSharedDataService.emitTotalResults(this.totalResults()); this.archiveSharedDataService.emitFacets(this.archiveSearchResultFacets.nodesFacets); } else if (pagedResult.results) { this.archiveUnits = [...this.archiveUnits, ...pagedResult.results]; } this.pageNumbers = pagedResult.pageNumbers; - this.waitingToGetFixedCount = this.totalResults === this.vitamConfigurationService.tenantConfig()?.resultThreshold; + this.waitingToGetFixedCount = this.totalResults() === this.vitamConfigurationService.tenantConfig()?.resultThreshold; if (this.isAllChecked) { - this.itemSelected = this.totalResults - this.itemNotSelected; + this.itemSelected = this.totalResults() - this.itemNotSelected; } this.canLoadMore = this.currentPage < this.pageNumbers - 1; this.archiveHelperService.updateCriteriaStatus( @@ -789,13 +789,13 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O SearchCriteriaStatusEnum.IN_PROGRESS, SearchCriteriaStatusEnum.INCLUDED, ); - this.pending = false; + this.pending.set(false); this.included = true; }, (error: HttpErrorResponse) => { this.logger.error('Error message :', error.message); this.canLoadMore = false; - this.pending = false; + this.pending.set(false); if (includeFacets) { this.pendingComputeFacets = false; this.archiveSharedDataService.emitFacets([]); @@ -805,7 +805,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O } onArchiveUnitCountChange(event: number) { - this.totalResults = event; + this.totalResults.set(event); this.archiveSharedDataService.emitTotalResults(event); } @@ -838,7 +838,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O const { checked } = event; this.isAllChecked = checked; - this.itemSelected = checked ? this.totalResults : 0; + this.itemSelected = checked ? this.totalResults() : 0; if (!checked) { this.isIndeterminate = false; } else { @@ -866,7 +866,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O if (action) { this.listOfUACriteriaSearch = []; this.itemSelected++; - if (this.itemSelected === this.totalResults) { + if (this.itemSelected === this.totalResults()) { this.isIndeterminate = false; } if (this.isAllChecked) { @@ -911,8 +911,8 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O this.archiveHelperService.removeCriteria(keyElt, valueElt, emit, this.searchCriteriaKeys, this.searchCriterias, this.nbQueryCriteria); if (this.searchCriterias && this.searchCriterias.size === 0) { - this.submited = false; - this.showCriteriaPanel = true; + this.submited.set(false); + this.showCriteriaPanel.set(true); this.showSearchCriteriaPanel = false; // Get initial AUs by project Id this.searchCriteriaKeys = []; @@ -942,7 +942,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O this.included = false; this.nbQueryCriteria = 0; this.pageNumbers = 0; - this.totalResults = 0; + this.totalResults.set(0); this.itemSelected = 0; this.isAllChecked = false; this.isIndeterminate = false; @@ -1066,7 +1066,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O } showHidePanel(show: boolean) { - this.showCriteriaPanel = show; + this.showCriteriaPanel.set(show); } containsWaitingToRecalculateInheritenceRuleCriteria() { @@ -1139,7 +1139,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O pageNumber: 0, size: 1, sortingCriteria, - trackTotalHits: this.totalResults >= 10000, + trackTotalHits: this.totalResults() >= 10000, computeMgtRulesFacets: true, facets: facets, }; @@ -1243,14 +1243,14 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O } loadMore() { - if (this.pending) { + if (this.pending()) { return; } this.canLoadMore = this.currentPage < this.pageNumbers - 1; if (!this.canLoadMore) { return; } - this.submited = true; + this.submited.set(true); this.currentPage = this.currentPage + 1; if (!this.hasSearchCriteriaOrMoreThan10Results()) { return; @@ -1263,7 +1263,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O } private hasSearchCriteriaOrMoreThan10Results() { - return this.hasSearchCriteria() || this.totalResults >= 10; + return this.hasSearchCriteria() || this.totalResults() >= 10; } showHideFacets(show: boolean) { @@ -1291,7 +1291,7 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O .getTotalTrackHitsByCriteria(this.criteriaSearchList, this.transaction?.id || null) .toPromise(); if (exactCountResults !== -1) { - this.totalResults = exactCountResults; + this.totalResults.set(exactCountResults); this.waitingToGetFixedCount = false; this.launchComputingManagementRulesFacets(); } diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.html b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.html index 371aab23689..88b59d56fd8 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.html +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/filing-holding-scheme.component.html @@ -1,7 +1,7 @@
{ // Disable checkbox use to prevent add unit to search criteria this.disableNodesRecursive(nodes); @@ -253,7 +253,7 @@ export class FilingHoldingSchemeComponent implements OnInit, OnDestroy { this.archiveSharedDataService.emitFilingHoldingNodes(nodes); this.switchViewAllNodes(); this.setAttachmentNodes(); - this.loadingHolding = false; + this.loadingHolding.set(false); }); } diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.html b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.html index 59eff650b92..e95a431fb6b 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.html +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.html @@ -1,5 +1,5 @@
- @for (criteria of searchCriteriaHistory; track criteria) { + @for (criteria of searchCriteriaHistory(); track criteria) { } - @if (pending) { + @if (pending()) {
diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts index 77233e580f5..7ae8a0edc6a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.spec.ts @@ -188,14 +188,14 @@ describe('SearchCriteriaListComponent', () => { }, ]; - component.searchCriteriaHistory = searchCriteriaHistory$; + component.searchCriteriaHistory.set(searchCriteriaHistory$); }); describe('deleteSearchCriteriaHistory', () => { it('should delete searchCriteria', () => { component.clearElement(searchCriteriaHistory$[0].id); - expect(component.searchCriteriaHistory.length).toEqual(1); - expect(component.searchCriteriaHistory[0].name).toEqual('Second Svae'); + expect(component.searchCriteriaHistory().length).toEqual(1); + expect(component.searchCriteriaHistory()[0].name).toEqual('Second Svae'); }); }); }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts index 2525a77ee25..6b431678feb 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/search-criteria-list/search-criteria-list.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, inject, OnInit, Output } from '@angular/core'; +import { Component, EventEmitter, inject, OnInit, Output, signal } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { Subject, Subscription } from 'rxjs'; @@ -63,22 +63,23 @@ export class SearchCriteriaListComponent implements OnInit { @Output() storedSearchCriteriaHistory = new EventEmitter(); - searchCriteriaHistory: SearchCriteriaHistory[]; + searchCriteriaHistory = signal([]); private readonly orderChange = new Subject(); direction: Direction = Direction.ASCENDANT; subscriptionSearchCriteriaHistory: Subscription; keyPressSubscription: Subscription; - pending = false; + pending = signal(false); ngOnInit() { this.subscriptionSearchCriteriaHistory = this.archiveSharedDataService .getSearchCriteriaHistoryShared() .subscribe((searchCriteriaHistoryResults) => { if (searchCriteriaHistoryResults) { - this.searchCriteriaHistory.push(searchCriteriaHistoryResults); - this.archiveSharedDataService.sort(Direction.ASCENDANT, this.searchCriteriaHistory); + const next = [...this.searchCriteriaHistory(), searchCriteriaHistoryResults]; + this.archiveSharedDataService.sort(Direction.ASCENDANT, next); + this.searchCriteriaHistory.set(next); } }); this.getSearchCriteriaHistory(); @@ -90,12 +91,12 @@ export class SearchCriteriaListComponent implements OnInit { } getSearchCriteriaHistory() { - this.pending = true; + this.pending.set(true); this.searchCriteriaSaverService.getSearchCriteriaHistory().subscribe((data) => { - this.searchCriteriaHistory = data; - this.archiveSharedDataService.sort(Direction.ASCENDANT, this.searchCriteriaHistory); + this.archiveSharedDataService.sort(Direction.ASCENDANT, data); + this.searchCriteriaHistory.set(data); this.archiveSharedDataService.emitAllSearchCriteriaHistory(data); - this.pending = false; + this.pending.set(false); }); } @@ -121,10 +122,6 @@ export class SearchCriteriaListComponent implements OnInit { } clearElement(id: string) { - for (let i = 0; i < this.searchCriteriaHistory.length; i++) { - if (this.searchCriteriaHistory[i].id === id) { - this.searchCriteriaHistory.splice(i, 1); - } - } + this.searchCriteriaHistory.set(this.searchCriteriaHistory().filter((criteria) => criteria.id !== id)); } } diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.html b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.html index 37ae7b698e4..d4a789fd8be 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.html +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/simple-criteria-search/simple-criteria-search.component.html @@ -36,7 +36,7 @@ [multiple]="true" [enableSelectAll]="false" formControlName="agencies" - [options]="selectOptions.agency" + [options]="selectOptions().agency" [placeholder]="'COLLECT.SEARCH_CRITERIA_FILTER.FIELDS.SP' | translate" [searchBarPlaceHolder]="'COLLECT.SEARCH_CRITERIA_FILTER.FIELDS.SP_PLACEHOLDER' | translate" class="w-100" @@ -55,7 +55,7 @@ [multiple]="true" [enableSelectAll]="false" formControlName="archiveUnitProfiles" - [options]="selectOptions.archiveUnitProfile" + [options]="selectOptions().archiveUnitProfile" [placeholder]="'COLLECT.SEARCH_CRITERIA_FILTER.FIELDS.AUP' | translate" [searchBarPlaceHolder]="'COLLECT.SEARCH_CRITERIA_FILTER.FIELDS.AUP_PLACEHOLDER' | translate" class="w-100" @@ -123,12 +123,12 @@

{{ 'COLLECT.SEARCH_CRITERIA_FILTER.FIELDS.OTHER_FIELDS' | translate }}

- @if (otherCriteriaOptions) { + @if (otherCriteriaOptions()) {
[]; + otherCriteriaOptions = signal[]>(undefined); getOtherCriteriaDisplayValue = (element: SchemaElement) => `${element.Origin === 'EXTERNAL' ? 'EXT-' : ''}${element.ShortName} - ${element.FieldName}`; - selectOptions = { + selectOptions = signal({ agency: { options: [] as Option[] }, archiveUnitProfile: { options: [] as Option[] }, - } satisfies { [key: string]: VitamuiSelectOptions }; + } satisfies { [key: string]: VitamuiSelectOptions }); private offlineServices$: Observable; constructor() { @@ -175,7 +175,9 @@ export class SimpleCriteriaSearchComponent implements OnInit { }), ), ) - .subscribe((options) => (this.selectOptions.agency = options)); + .subscribe((options) => { + this.selectOptions.update((selectOptions) => ({ ...selectOptions, agency: options })); + }); archiveUnitProfilesService .getAll() @@ -189,10 +191,14 @@ export class SimpleCriteriaSearchComponent implements OnInit { }), ), ) - .subscribe((options) => (this.selectOptions.archiveUnitProfile = options)); + .subscribe((options) => { + this.selectOptions.update((selectOptions) => ({ ...selectOptions, archiveUnitProfile: options })); + }); const descriptiveSchemaTree$ = schemaService.getDescriptiveSchemaTree().pipe(share()); - descriptiveSchemaTree$.subscribe((schema) => (this.otherCriteriaOptions = schema)); + descriptiveSchemaTree$.subscribe((schema) => { + this.otherCriteriaOptions.set(schema); + }); const otherCriteriaListControl = this.formBuilder.control([]); const otherCriteriaControl = this.formBuilder.group({}); @@ -311,7 +317,7 @@ export class SimpleCriteriaSearchComponent implements OnInit { getCriteriaName(criteria: SchemaElement) { const path = criteria.Path.split('.').slice(0, -1); const parent = path.reduce((acc, p) => acc.children.find((o) => o.item.FieldName === p), { - children: this.otherCriteriaOptions, + children: this.otherCriteriaOptions(), } as ItemNode); return `${criteria.ShortName}${parent?.item ? ` (${parent.item.ShortName})` : ''}`; } diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.html b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.html index 512b1f31278..1b525f8c362 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.html +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.html @@ -8,7 +8,7 @@
{{ 'COLLECT.PROJECT_LIST_TITLE' | translate }}
- {{ 'COLLECT.NB_ENTRIES' | translate: { nb: dataSource?.length } }} + {{ 'COLLECT.NB_ENTRIES' | translate: { nb: dataSource()?.length } }}
@@ -81,7 +81,7 @@
{{ 'COLLECT.PROJECT_LIST_TITLE' | translate }}
- @for (project of dataSource; track project) { + @for (project of dataSource(); track project) { {{ 'COLLECT.PROJECT_LIST_TITLE' | translate }}
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COLLECT.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && projectsService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && projectsService.canLoadMore && !pending()) {
{{ 'COLLECT.LOAD_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts index f6a3d0e51ca..330ec3ecc64 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/project-list/project-list.component.ts @@ -101,11 +101,9 @@ export class ProjectListComponent extends InfiniteScrollTable implement this.searchProject(); this.projectUpdated = this.projectsService.getUpdatedProject$().subscribe((projectUpdated) => { - for (let i = 0; i < this.dataSource.length; i++) { - if (this.dataSource[i].id === projectUpdated.id) { - this.dataSource[i] = { ...projectUpdated }; - } - } + this.dataSource.update((projects) => + (projects ?? []).map((project) => (project.id === projectUpdated.id ? { ...projectUpdated } : project)), + ); }); } @@ -123,9 +121,11 @@ export class ProjectListComponent extends InfiniteScrollTable implement sortTable() { const direction: number = this.direction === Direction.ASCENDANT ? -1 : 1; - this.dataSource.sort((a, b) => { - return a[this.column] === b[this.column] ? 0 : a[this.column] > b[this.column] ? direction : -direction; - }); + this.dataSource.update((projects) => + [...(projects ?? [])].sort((a, b) => { + return a[this.column] === b[this.column] ? 0 : a[this.column] > b[this.column] ? direction : -direction; + }), + ); } searchProject() { diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.html b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.html index 30630b80e10..469f34508e0 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.html +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transaction-list/transaction-list.component.html @@ -10,8 +10,8 @@
{{ 'COLLECT.INGEST_LIST_TITLE' | translate }}
{{ - (dataSource?.length <= 1 ? 'COLLECT.SINGLE_TRANSACTION' : 'COLLECT.NB_ENTRIES_TRANSACTIONS') - | translate: { nb: dataSource?.length } + (dataSource()?.length <= 1 ? 'COLLECT.SINGLE_TRANSACTION' : 'COLLECT.NB_ENTRIES_TRANSACTIONS') + | translate: { nb: dataSource()?.length } }} @@ -56,7 +56,7 @@
{{ 'COLLECT.INGEST_LIST_TITLE' | translate }}
- @for (transaction of dataSource; track transaction) { + @for (transaction of dataSource(); track transaction) { @@ -83,7 +83,7 @@
{{ 'COLLECT.INGEST_LIST_TITLE' | translate }}
@@ -243,8 +243,8 @@ describe('GroupListComponent', () => { }); it('should have a button to load more profileGroups', () => { - component.infiniteScrollDisabled = true; - component.pending = false; + component.infiniteScrollDisabled.set(true); + component.pending.set(false); fixture.detectChanges(false); expect(page.loadMoreButton).toBeTruthy(); }); @@ -257,8 +257,8 @@ describe('GroupListComponent', () => { it('should call loadMore()', () => { const groupService = TestBed.inject(GroupService); - component.infiniteScrollDisabled = true; - component.pending = false; + component.infiniteScrollDisabled.set(true); + component.pending.set(false); fixture.detectChanges(false); page.loadMoreButton.click(); expect(groupService.loadMore).toHaveBeenCalled(); @@ -284,7 +284,7 @@ describe('GroupListComponent', () => { usersCount: 0, units: [], }); - expect(component.dataSource[1].name).toBe('Updated profileGroup'); + expect(component.dataSource()[1].name).toBe('Updated profileGroup'); }); function testRow(index: number) { diff --git a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts index f3ac4689840..9fad2e5b55e 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group-list/group-list.component.ts @@ -122,10 +122,14 @@ export class GroupListComponent extends InfiniteScrollTable implements On this.refreshLevelOptions(); this.updatedGroupSub = this.groupService.updated.subscribe((updatedGroup: Group) => { - const profileGroupIndex = this.dataSource.findIndex((group) => updatedGroup.id === group.id); - if (profileGroupIndex > -1) { - this.dataSource[profileGroupIndex] = updatedGroup; - } + this.dataSource.update((groups) => { + const list = [...(groups ?? [])]; + const profileGroupIndex = list.findIndex((group) => updatedGroup.id === group.id); + if (profileGroupIndex > -1) { + list[profileGroupIndex] = updatedGroup; + } + return list; + }); }); const searchCriteriaChange = merge(this.searchChange, this.filterChange, this.orderChange); diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.html b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.html index 563ae02f4a0..b8f9ecd0b48 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.html +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.html @@ -11,7 +11,7 @@
- @for (profile of dataSource; track profile) { + @for (profile of dataSource(); track profile) {
@@ -33,15 +33,15 @@
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && hierarchyService.canLoadMore && !pending) { + @if (infiniteScrollDisabled && hierarchyService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts index 202f8fe8e34..4cae12be0c5 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy-list/hierarchy-list.component.ts @@ -95,25 +95,29 @@ export class HierarchyListComponent extends InfiniteScrollTable impleme this.hierarchyService = hierarchyService; this.updatedProfileSub = this.hierarchyService.updated.subscribe((updatedProfile: Profile) => { - const profileIndex = this.dataSource.findIndex((profile) => updatedProfile.id === profile.id); - if (profileIndex > -1) { - this.dataSource[profileIndex] = { - id: this.dataSource[profileIndex].id, - enabled: updatedProfile.enabled, - name: updatedProfile.name, - level: updatedProfile.level, - customerId: this.dataSource[profileIndex].customerId, - groupsCount: this.dataSource[profileIndex].groupsCount, - description: updatedProfile.description, - usersCount: this.dataSource[profileIndex].usersCount, - tenantName: this.dataSource[profileIndex].tenantName, - tenantIdentifier: this.dataSource[profileIndex].tenantIdentifier, - applicationName: this.dataSource[profileIndex].applicationName, - roles: this.dataSource[profileIndex].roles, - readonly: this.dataSource[profileIndex].readonly, - externalParamId: this.dataSource[profileIndex].externalParamId, - }; - } + this.dataSource.update((profiles) => { + const list = [...(profiles ?? [])]; + const profileIndex = list.findIndex((profile) => updatedProfile.id === profile.id); + if (profileIndex > -1) { + list[profileIndex] = { + id: list[profileIndex].id, + enabled: updatedProfile.enabled, + name: updatedProfile.name, + level: updatedProfile.level, + customerId: list[profileIndex].customerId, + groupsCount: list[profileIndex].groupsCount, + description: updatedProfile.description, + usersCount: list[profileIndex].usersCount, + tenantName: list[profileIndex].tenantName, + tenantIdentifier: list[profileIndex].tenantIdentifier, + applicationName: list[profileIndex].applicationName, + roles: list[profileIndex].roles, + readonly: list[profileIndex].readonly, + externalParamId: list[profileIndex].externalParamId, + }; + } + return list; + }); }); } diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.html b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.html index 0d348f61789..bdbc74b968c 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.html +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.html @@ -10,7 +10,7 @@
- @for (profile of dataSource; track profile) { + @for (profile of dataSource(); track profile) {
@@ -30,15 +30,15 @@
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && rngProfileService.canLoadMore && !pending) { + @if (infiniteScrollDisabled && rngProfileService.canLoadMore && !pending()) {
A{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts index 42ef4ca95a0..adb561cac32 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile-list/profile-list.component.ts @@ -94,26 +94,30 @@ export class ProfileListComponent extends InfiniteScrollTable implement this.rngProfileService = rngProfileService; this.updatedProfileSub = this.rngProfileService.updated.subscribe((updatedProfile: Profile) => { - const profileIndex = this.dataSource.findIndex((profile) => updatedProfile.id === profile.id); - if (profileIndex > -1) { - this.dataSource[profileIndex] = { - id: this.dataSource[profileIndex].id, - identifier: updatedProfile.identifier, - enabled: updatedProfile.enabled, - name: updatedProfile.name, - level: updatedProfile.level, - customerId: updatedProfile.customerId, - groupsCount: updatedProfile.groupsCount, - description: updatedProfile.description, - usersCount: this.dataSource[profileIndex].usersCount, - tenantIdentifier: this.dataSource[profileIndex].tenantIdentifier, - tenantName: this.dataSource[profileIndex].tenantName, - applicationName: this.dataSource[profileIndex].applicationName, - roles: this.dataSource[profileIndex].roles, - readonly: this.dataSource[profileIndex].readonly, - externalParamId: this.dataSource[profileIndex].externalParamId, - }; - } + this.dataSource.update((profiles) => { + const list = [...(profiles ?? [])]; + const profileIndex = list.findIndex((profile) => updatedProfile.id === profile.id); + if (profileIndex > -1) { + list[profileIndex] = { + id: list[profileIndex].id, + identifier: updatedProfile.identifier, + enabled: updatedProfile.enabled, + name: updatedProfile.name, + level: updatedProfile.level, + customerId: updatedProfile.customerId, + groupsCount: updatedProfile.groupsCount, + description: updatedProfile.description, + usersCount: list[profileIndex].usersCount, + tenantIdentifier: list[profileIndex].tenantIdentifier, + tenantName: list[profileIndex].tenantName, + applicationName: list[profileIndex].applicationName, + roles: list[profileIndex].roles, + readonly: list[profileIndex].readonly, + externalParamId: list[profileIndex].externalParamId, + }; + } + return list; + }); }); } diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.html b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.html index 9194882a61c..36a9d3217c0 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.html +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.html @@ -10,7 +10,7 @@
- @for (subrogableUser of dataSource; track subrogableUser) { + @for (subrogableUser of dataSource(); track subrogableUser) {
@@ -80,15 +80,15 @@
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && subrogationService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && subrogationService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts index 66c01e959e5..9f2d4ea3e24 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user-list/subrogate-user-list.component.ts @@ -115,7 +115,7 @@ export class SubrogateUserListComponent extends InfiniteScrollTable { - const groupIds = new Set(this.dataSource.map((subrogationUser: SubrogationUser) => subrogationUser.groupId)); + const groupIds = new Set((this.dataSource() ?? []).map((subrogationUser: SubrogationUser) => subrogationUser.groupId)); const observables = new Array>(); groupIds.forEach((groupId) => { @@ -132,7 +132,7 @@ export class SubrogateUserListComponent extends InfiniteScrollTable !subrogationUser.criticality) .forEach((subrogationUser: SubrogationUser) => { const subrogateUserGroup = this.getGroup(subrogationUser); @@ -146,11 +146,11 @@ export class SubrogateUserListComponent extends InfiniteScrollTable @if (groups) {
- @for (user of dataSource; track user; let index = $index) { + @for (user of dataSource(); track user; let index = $index) {
@@ -178,7 +178,7 @@ }
- @if (!dataSource || pending || !groups) { + @if (!dataSource() || pending() || !groups) {
diff --git a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts index f05274cf8cc..8468597c1b6 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user-list/user-list.component.ts @@ -190,10 +190,14 @@ export class UserListComponent extends InfiniteScrollTable implements OnDe this.refreshLevelOptions(); this.updatedUserSub = this.userService.userUpdated.subscribe((updatedUser: User) => { - const userIndex = this.dataSource.findIndex((user) => updatedUser.id === user.id); + const userIndex = (this.dataSource() ?? []).findIndex((user) => updatedUser.id === user.id); if (userIndex > -1) { this.userService.get(updatedUser.id).subscribe((user: User) => { - this.dataSource[userIndex] = user; + this.dataSource.update((users) => { + const list = [...(users ?? [])]; + list[userIndex] = user; + return list; + }); }); } }); @@ -211,7 +215,7 @@ export class UserListComponent extends InfiniteScrollTable implements OnDe } updateData(groups: Group[]) { - const groupIds = new Set(this.dataSource.map((user: User) => user.groupId)); + const groupIds = new Set((this.dataSource() ?? []).map((user: User) => user.groupId)); groupIds.forEach((groupId) => { const existingGroup = this.userGroups.find((group) => group.id === groupId); @@ -266,7 +270,7 @@ export class UserListComponent extends InfiniteScrollTable implements OnDe checkInactifUsers() { this.customerService.getMyCustomer().subscribe((customer) => { if (customer.gdprAlert) { - this.dataSource + (this.dataSource() ?? []) .filter((user: User) => user.status === 'DISABLED' && user.disablingDate !== null) .forEach((u: User) => { this.totalMonth = diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.html b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.html index 52a204db425..3ed6a630753 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.html +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.html @@ -25,7 +25,7 @@
{{ 'INGEST_LIST.STATUS' | translate }}
- @for (ingest of dataSource; track ingest; let index = $index) { + @for (ingest of dataSource(); track ingest; let index = $index) {
@@ -93,7 +93,7 @@ }
- @if (!pending && !ingestService.canLoadMore) { + @if (!pending() && !ingestService.canLoadMore) {
{{ 'INGEST_LIST.NORESULTS' | translate }}
} @else {
diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts index 9f9e2156cad..b1b9fa0dc07 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest-list/ingest-list.component.ts @@ -87,11 +87,15 @@ export class IngestListComponent extends InfiniteScrollTable implements OnD @Input() set ingestThatHasChanged(ingest: LogbookOperation) { - if (!this.dataSource) { + if (!this.dataSource()) { return; } - const index = this.dataSource.findIndex((o) => o.id === ingest.id); - this.dataSource[index] = ingest; + const index = this.dataSource().findIndex((o) => o.id === ingest.id); + this.dataSource.update((ingests) => { + const next = [...(ingests ?? [])]; + next[index] = ingest; + return next; + }); } private _filters: IngestFilters; @@ -132,7 +136,7 @@ export class IngestListComponent extends InfiniteScrollTable implements OnD element.rightsStatementIdentifier = JSON.parse(element.rightsStatementIdentifier); } }); - this.dataSource = data; + this.dataSource.set(data); }); const searchCriteriaChange = merge(this.searchChange, this.filterChange, this.orderChange).pipe(debounceTime(FILTER_DEBOUNCE_TIME_MS)); @@ -142,7 +146,7 @@ export class IngestListComponent extends InfiniteScrollTable implements OnD const pageRequest = new PageRequest(0, DEFAULT_PAGE_SIZE, this.orderBy, this.direction, JSON.stringify(query)); this.search(pageRequest); }); - this.updatedData.subscribe(() => this.ingestService.logbookOperationsReloaded.next(this.dataSource)); + this.updatedData.subscribe(() => this.ingestService.logbookOperationsReloaded.next(this.dataSource())); } ngOnDestroy() { diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.html b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.html index f62e7dd3bc6..6ad99016fde 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.html @@ -40,7 +40,7 @@
- @for (accessContract of dataSource; track accessContract) { + @for (accessContract of dataSource(); track accessContract) {
@@ -57,15 +57,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && accessContractService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && accessContractService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts index 43096624d46..4c8df869ef4 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract-list/access-contract-list.component.ts @@ -108,14 +108,14 @@ export class AccessContractListComponent extends InfiniteScrollTable (this.pending = false))) + .pipe(finalize(() => this.pending.set(false))) .subscribe({ next: (data: AccessContract[]) => { - this.dataSource = data; + this.dataSource.set(data); }, error: (e) => console.error(e), }); @@ -146,10 +146,14 @@ export class AccessContractListComponent extends InfiniteScrollTable { - const index = this.dataSource.findIndex((item: AccessContract) => item.id === updatedAccessContract.id); - if (index !== -1) { - this.dataSource[index] = updatedAccessContract; - } + this.dataSource.update((contracts) => { + const list = [...(contracts ?? [])]; + const index = list.findIndex((item: AccessContract) => item.id === updatedAccessContract.id); + if (index !== -1) { + list[index] = updatedAccessContract; + } + return list; + }); }); } diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.html b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.html index cec5c53d46c..998c6dbbe42 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register-list/accession-register-list.component.html @@ -7,7 +7,7 @@ {{ 'ACCESSION_REGISTER.LIST.NB_ENTRIES' | translate: { nb: getTotalElements() } }} }
-
+
@@ -91,7 +91,7 @@ - @for (accessionRegisterDetail of dataSource; track accessionRegisterDetail) { + @for (accessionRegisterDetail of dataSource(); track accessionRegisterDetail) { {{ accessionRegisterDetail.endDate | dateTime: 'dd/MM/yyyy' }} {{ accessionRegisterDetail.obIdIn }} @@ -120,15 +120,15 @@ - @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'ACCESSION_REGISTER.LIST.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && accessionRegistersService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && accessionRegistersService.canLoadMore && !pending()) {
{{ 'ACCESSION_REGISTER.LIST.LOAD_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.html b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.html index d9ba5cf1765..3af210d8af9 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.html @@ -21,7 +21,7 @@
- @for (agency of dataSource; track agency) { + @for (agency of dataSource(); track agency) {
@@ -47,12 +47,12 @@
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
}
diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts index b8e178832dd..b8d69c3af6a 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency-list/agency-list.component.ts @@ -167,10 +167,14 @@ export class AgencyListComponent extends InfiniteScrollTable implements private replaceUpdatedAgency(): void { this.agencyService.updated.pipe(takeUntil(this.destroyer$)).subscribe((updatedAgency: Agency) => { - const index = this.dataSource.findIndex((item: Agency) => item.id === updatedAgency.id); - if (index !== -1) { - this.dataSource[index] = updatedAgency; - } + this.dataSource.update((agencies) => { + const list = [...(agencies ?? [])]; + const index = list.findIndex((item: Agency) => item.id === updatedAgency.id); + if (index !== -1) { + list[index] = updatedAgency; + } + return list; + }); }); } diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.html b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.html index d3c1625f9d6..199dd532692 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.html @@ -61,15 +61,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && filteredDataSource?.length === 0) { + @if (!pending() && filteredDataSource?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && auditService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && auditService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts index dbd2c6228e1..1f8fd508ee2 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts @@ -151,7 +151,7 @@ export class AuditListComponent extends InfiniteScrollTable implements OnDe this.auditService .search(new PageRequest(0, DEFAULT_PAGE_SIZE, this.orderBy, this.direction, JSON.stringify(this.buildCriteriaFromSearch()))) .subscribe((data: any[]) => { - this.dataSource = data; + this.dataSource.set(data); this.startPolling(); }); @@ -207,11 +207,12 @@ export class AuditListComponent extends InfiniteScrollTable implements OnDe public get filteredDataSource(): any[] { const selectedCategories = this._filters?.types || []; - if (!this.dataSource || selectedCategories.length === 0) { - return this.dataSource; + const dataSource = this.dataSource(); + if (!dataSource || selectedCategories.length === 0) { + return dataSource; } - return this.dataSource.filter((item) => { + return dataSource.filter((item) => { const category = AUDIT_CATEGORY_BY_EV_DET_DATA_TYPE[item.parsedData?.['type']] ?? AUDIT_CATEGORY_BY_EV_DET_DATA_TYPE[item.type]; if (category) { @@ -286,24 +287,29 @@ export class AuditListComponent extends InfiniteScrollTable implements OnDe } private updateDataSource(newData: any[]): void { - if (!this.dataSource || this.dataSource.length === 0) { - this.dataSource = newData; + const current = this.dataSource() ?? []; + if (current.length === 0) { + this.dataSource.set(newData); return; } + const list = [...current]; + const changedItems: Event[] = []; newData.forEach((newItem: Event) => { - const existingItemIndex = this.dataSource.findIndex((item) => item.id === newItem.id); + const existingItemIndex = list.findIndex((item) => item.id === newItem.id); if (existingItemIndex !== -1) { - const existingItem = this.dataSource[existingItemIndex]; + const existingItem = list[existingItemIndex]; const newStatus = this.auditMessage(newItem); const oldStatus = this.auditMessage(existingItem); if (newStatus !== oldStatus) { - this.dataSource[existingItemIndex] = { ...existingItem, ...newItem }; - this.auditClick.next(newItem); + list[existingItemIndex] = { ...existingItem, ...newItem }; + changedItems.push(newItem); } } else { - this.dataSource.unshift(newItem); + list.unshift(newItem); } }); + this.dataSource.set(list); + changedItems.forEach((item) => this.auditClick.next(item)); } } diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.html b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.html index 2adb4af4024..5b3c02b8eb4 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.html @@ -40,7 +40,7 @@
- @for (context of dataSource; track context; let index = $index) { + @for (context of dataSource(); track context; let index = $index) {
@@ -57,15 +57,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && contextService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && contextService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts index 84c8d6ba1b0..bc1bc632e96 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context-list/context-list.component.ts @@ -143,7 +143,7 @@ export class ContextListComponent extends InfiniteScrollTable implement ); this.contextService.search(new PageRequest(0, DEFAULT_PAGE_SIZE, this.orderBy, Direction.ASCENDANT)).subscribe((data: Context[]) => { - this.dataSource = data; + this.dataSource.set(data); }); const searchCriteriaChange = merge(tenantChange, this.searchChange, this.filterChange, this.orderChange).pipe( @@ -201,10 +201,14 @@ export class ContextListComponent extends InfiniteScrollTable implement private replaceUpdatedContext(): void { this.contextService.updated.pipe(takeUntil(this.destroy$)).subscribe((updatedContext: Context) => { - const index = this.dataSource.findIndex((item: Context) => item.id === updatedContext.id); - if (index !== -1) { - this.dataSource[index] = updatedContext; - } + this.dataSource.update((contexts) => { + const list = [...(contexts ?? [])]; + const index = list.findIndex((item: Context) => item.id === updatedContext.id); + if (index !== -1) { + list[index] = updatedContext; + } + return list; + }); }); } } diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.html b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.html index 9a8634adfd9..801b8acdac6 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.html @@ -35,7 +35,7 @@
- @for (format of dataSource; track format; let index = $index) { + @for (format of dataSource(); track format; let index = $index) {
@@ -64,15 +64,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && fileFormatService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && fileFormatService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts index 6c124aa8112..a3851e1f5bf 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format-list/file-format-list.component.ts @@ -135,7 +135,7 @@ export class FileFormatListComponent extends InfiniteScrollTable imp this.fileFormatService .search(new PageRequest(0, DEFAULT_PAGE_SIZE, this.orderBy, Direction.ASCENDANT)) .subscribe((data: FileFormat[]) => { - this.dataSource = data; + this.dataSource.set(data); }); const searchCriteriaChange = merge(this.searchChange, this.orderChange).pipe(debounceTime(FILTER_DEBOUNCE_TIME_MS)); @@ -209,10 +209,14 @@ export class FileFormatListComponent extends InfiniteScrollTable imp private replaceUpdatedFileFormat(): void { this.fileFormatService.updated.pipe(takeUntil(this.destroy$)).subscribe((ffUpdated: FileFormat) => { - const index = this.dataSource.findIndex((item: FileFormat) => item.id === ffUpdated.id); - if (index !== -1) { - this.dataSource[index] = ffUpdated; - } + this.dataSource.update((formats) => { + const list = [...(formats ?? [])]; + const index = list.findIndex((item: FileFormat) => item.id === ffUpdated.id); + if (index !== -1) { + list[index] = ffUpdated; + } + return list; + }); }); } } diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.html b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.html index a7f94f455fc..ad795af5afb 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.html @@ -44,7 +44,7 @@
- @for (accessContract of dataSource; track accessContract) { + @for (accessContract of dataSource(); track accessContract) {
@@ -62,15 +62,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && ingestContractService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && ingestContractService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts index 401e93932c9..c96258bded9 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract-list/ingest-contract-list.component.ts @@ -111,15 +111,15 @@ export class IngestContractListComponent extends InfiniteScrollTable { - this.dataSource = data; + this.dataSource.set(data); }, () => {}, - () => (this.pending = false), + () => this.pending.set(false), ); this.searchCriteriaSub = merge(this.searchChange, this.filterChange, this.orderChange) @@ -147,35 +147,39 @@ export class IngestContractListComponent extends InfiniteScrollTable { - const index = this.dataSource.findIndex((ingContract: IngestContract) => ingContract.identifier === ingestContract.identifier); - if (index > -1) { - this.dataSource[index] = { - id: ingestContract.id, - tenant: ingestContract.tenant, - version: ingestContract.version, - name: ingestContract.name, - identifier: ingestContract.identifier, - description: ingestContract.description, - status: ingestContract.status, - creationDate: ingestContract.creationDate, - lastUpdate: ingestContract.lastUpdate, - activationDate: ingestContract.activationDate, - deactivationDate: ingestContract.deactivationDate, - checkParentLink: ingestContract.checkParentLink, - linkParentId: ingestContract.linkParentId, - checkParentId: ingestContract.checkParentId, - masterMandatory: ingestContract.masterMandatory, - everyDataObjectVersion: ingestContract.everyDataObjectVersion, - dataObjectVersion: ingestContract.dataObjectVersion, - formatUnidentifiedAuthorized: ingestContract.formatUnidentifiedAuthorized, - everyFormatType: ingestContract.everyFormatType, - formatType: ingestContract.formatType, - archiveProfiles: ingestContract.archiveProfiles, - managementContractId: ingestContract.managementContractId, - computeInheritedRulesAtIngest: ingestContract.computeInheritedRulesAtIngest, - signaturePolicy: ingestContract.signaturePolicy, - }; - } + this.dataSource.update((contracts) => { + const list = [...(contracts ?? [])]; + const index = list.findIndex((ingContract: IngestContract) => ingContract.identifier === ingestContract.identifier); + if (index > -1) { + list[index] = { + id: ingestContract.id, + tenant: ingestContract.tenant, + version: ingestContract.version, + name: ingestContract.name, + identifier: ingestContract.identifier, + description: ingestContract.description, + status: ingestContract.status, + creationDate: ingestContract.creationDate, + lastUpdate: ingestContract.lastUpdate, + activationDate: ingestContract.activationDate, + deactivationDate: ingestContract.deactivationDate, + checkParentLink: ingestContract.checkParentLink, + linkParentId: ingestContract.linkParentId, + checkParentId: ingestContract.checkParentId, + masterMandatory: ingestContract.masterMandatory, + everyDataObjectVersion: ingestContract.everyDataObjectVersion, + dataObjectVersion: ingestContract.dataObjectVersion, + formatUnidentifiedAuthorized: ingestContract.formatUnidentifiedAuthorized, + everyFormatType: ingestContract.everyFormatType, + formatType: ingestContract.formatType, + archiveProfiles: ingestContract.archiveProfiles, + managementContractId: ingestContract.managementContractId, + computeInheritedRulesAtIngest: ingestContract.computeInheritedRulesAtIngest, + signaturePolicy: ingestContract.signaturePolicy, + }; + } + return list; + }); }); } diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.html b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.html index 8a0721c7d11..95e71a0c684 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.html @@ -30,7 +30,7 @@
- @for (event of dataSource; track event) { + @for (event of dataSource(); track event) {
@@ -60,15 +60,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && logbookSearchService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && logbookSearchService.canLoadMore && !pending()) {
A{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts index d4ea643d17d..71d0c0e2bca 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.spec.ts @@ -73,7 +73,7 @@ describe('LogbookOperationListComponent', () => { beforeEach(() => { fixture = TestBed.createComponent(LogbookOperationListComponent); component = fixture.componentInstance; - component.dataSource = []; + component.dataSource.set([]); fixture.detectChanges(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts index badedb6e9f0..bff638a59b9 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation-list/logbook-operation-list.component.ts @@ -206,18 +206,24 @@ export class LogbookOperationListComponent extends InfiniteScrollTable i } private onDataSourceReloaded() { - if (this.pending) { + if (this.pending()) { return; } - this.logbookDownloadService.logbookOperationsReloaded.next(this.dataSource); + this.logbookDownloadService.logbookOperationsReloaded.next(this.dataSource()); this.finishedLoading.next(); } private updateLogbookOperations(logbookOperationsReloaded: IEvent[]) { - logbookOperationsReloaded.forEach((logbookOperation) => { - const index = this.dataSource.findIndex((o) => o.id === logbookOperation.id); - this.dataSource[index] = logbookOperation; + this.dataSource.update((operations) => { + const list = [...(operations ?? [])]; + logbookOperationsReloaded.forEach((logbookOperation) => { + const index = list.findIndex((o) => o.id === logbookOperation.id); + if (index !== -1) { + list[index] = logbookOperation; + } + }); + return list; }); } diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts index 55b2e1fde55..5602699b9ab 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts @@ -134,7 +134,7 @@ export class LogbookOperationComponent extends SidenavPage implements OnIni } private openOperationDetail(): void { - this.list.eventClick.emit(this.list.dataSource[0]); + this.list.eventClick.emit(this.list.dataSource()[0]); } onFinishedLoading() { diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.html b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.html index b649f8afaa5..6d2909a2420 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.html @@ -71,7 +71,7 @@
- @for (managementContract of dataSource; track managementContract; let index = $index) { + @for (managementContract of dataSource(); track managementContract; let index = $index) {
@@ -103,7 +103,7 @@
- @if (!pending && !managementContractService.canLoadMore) { + @if (!pending() && !managementContractService.canLoadMore) {
{{ 'CONTRACT_MANAGEMENT.CONTRACT_LIST.NO_RESULT_FOUND' | translate }}
} @else {
diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts index a4009f4a5a6..5023d42f01e 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.spec.ts @@ -135,7 +135,7 @@ describe('ManagementContractListComponent', () => { vi.spyOn(searchServiceeMock, 'search'); // When - component.pending = true; + component.pending.set(true); component.searchManagementContractOrdered(); // Then diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts index 18ca9bb5427..a46aeec6f9d 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract-list/management-contract-list.component.ts @@ -108,15 +108,15 @@ export class ManagementContractListComponent extends InfiniteScrollTable { - this.dataSource = data; + this.dataSource.set(data); }, () => {}, - () => (this.pending = false), + () => this.pending.set(false), ); this.searchCriteriaSub = merge(this.searchChange, this.filterChange, this.orderChange) @@ -144,12 +144,14 @@ export class ManagementContractListComponent extends InfiniteScrollTable { - const index = this.dataSource.findIndex( - (mngContract: ManagementContract) => mngContract.identifier === managementContract.identifier, - ); - if (index > -1) { - this.dataSource[index] = { ...managementContract }; - } + this.dataSource.update((contracts) => { + const list = [...(contracts ?? [])]; + const index = list.findIndex((mngContract: ManagementContract) => mngContract.identifier === managementContract.identifier); + if (index > -1) { + list[index] = { ...managementContract }; + } + return list; + }); }); } diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.html b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.html index b4870a54128..5c9b2c4b248 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.html @@ -48,7 +48,7 @@ - @for (ontology of dataSource; track ontology) { + @for (ontology of dataSource(); track ontology) { {{ ontology.shortName }} @@ -74,13 +74,13 @@ } - @if (!dataSource || pending) { + @if (!dataSource() || pending()) { } - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) { } - @if (infiniteScrollDisabled && ontologyService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && ontologyService.canLoadMore && !pending()) { }
diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.ts index 8ee3913d3d3..67e71042448 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology-group/ontology-list/ontology-list.component.ts @@ -102,13 +102,13 @@ export class OntologyListComponent extends InfiniteScrollTable impleme } ngOnInit() { - this.pending = true; + this.pending.set(true); this.ontologyService .search(new PageRequest(0, DEFAULT_PAGE_SIZE, this.shortName, Direction.ASCENDANT)) - .pipe(finalize(() => (this.pending = false))) + .pipe(finalize(() => this.pending.set(false))) .subscribe({ next: (data: Ontology[]) => { - this.dataSource = data; + this.dataSource.set(data); }, error: (e) => console.error(e), }); @@ -170,10 +170,14 @@ export class OntologyListComponent extends InfiniteScrollTable impleme private replaceUpdatedOntology(): void { this.subscriptions.add( this.ontologyService.updated.pipe(takeUntil(this.destroy$)).subscribe((updatedOntology: Ontology) => { - const index = this.dataSource.findIndex((item: Ontology) => item.id === updatedOntology.id); - if (index !== -1) { - this.dataSource[index] = updatedOntology; - } + this.dataSource.update((ontologies) => { + const list = [...(ontologies ?? [])]; + const index = list.findIndex((item: Ontology) => item.id === updatedOntology.id); + if (index !== -1) { + list[index] = updatedOntology; + } + return list; + }); }), ); } diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.html b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.html index 2319c399e1c..93362c4ddfd 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.html @@ -35,7 +35,7 @@
- @for (value of dataSource; track value) { + @for (value of dataSource(); track value) {
@@ -52,15 +52,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && probativeValueService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && probativeValueService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts index 7b75d32ad53..baec12334f9 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value-list/probative-value-list.component.ts @@ -131,7 +131,7 @@ export class ProbativeValueListComponent extends InfiniteScrollTable implem JSON.stringify(this.buildProbativeValueCriteriaFromSearch()), ), ) - .subscribe((data: any[]) => (this.dataSource = data)); + .subscribe((data: any[]) => this.dataSource.set(data)); const searchCriteriaChange = merge(this.searchChange, this.orderChange, this.filterChange).pipe(debounceTime(FILTER_DEBOUNCE_TIME_MS)); diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.html b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.html index aa8afe1f30e..99aba81daf1 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.html @@ -42,7 +42,7 @@
- @for (rule of dataSource; track rule; let index = $index) { + @for (rule of dataSource(); track rule; let index = $index) {
@@ -71,15 +71,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && ruleService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && ruleService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts index 636b008d991..eaab68228d1 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule-list/rule-list.component.ts @@ -147,7 +147,7 @@ export class RuleListComponent extends InfiniteScrollTable implements OnDe ngOnInit() { this.ruleService.search(new PageRequest(0, DEFAULT_PAGE_SIZE, this.orderBy, Direction.ASCENDANT)).subscribe((data: Rule[]) => { - this.dataSource = data; + this.dataSource.set(data); }); const searchCriteriaChange = merge(this.searchChange, this.orderChange, this.filterChange).pipe(debounceTime(FILTER_DEBOUNCE_TIME_MS)); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.html b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.html index 7f40ae43da3..731caa167c0 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.html @@ -29,7 +29,7 @@
- @for (secu of dataSource; track secu) { + @for (secu of dataSource(); track secu) {
@@ -52,15 +52,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && securisationService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && securisationService.canLoadMore && !pending()) {
A{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts index ffe0462bc66..04e5174d9ef 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation-list/securisation-list.component.ts @@ -131,7 +131,7 @@ export class SecurisationListComponent extends InfiniteScrollTable implemen .search( new PageRequest(0, DEFAULT_PAGE_SIZE, this.orderBy, this.direction, JSON.stringify(this.buildSecurisationCriteriaFromSearch())), ) - .subscribe((data: any[]) => (this.dataSource = data)); + .subscribe((data: any[]) => this.dataSource.set(data)); const searchCriteriaChange = merge(this.searchChange, this.filterChange, this.orderChange).pipe(debounceTime(FILTER_DEBOUNCE_TIME_MS)); diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.html b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.html index f75572ef3c1..418fec65a72 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.html +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.html @@ -25,7 +25,7 @@
- @for (profile of dataSource; track profile; let index = $index) { + @for (profile of dataSource(); track profile; let index = $index) {
@@ -36,15 +36,15 @@ }
- @if (!dataSource || pending) { + @if (!dataSource() || pending()) {
} - @if (!pending && dataSource?.length === 0) { + @if (!pending() && dataSource()?.length === 0) {
{{ 'COMMON.NO_RESULT' | translate }}
} - @if (infiniteScrollDisabled && securityProfileService.canLoadMore && !pending) { + @if (infiniteScrollDisabled() && securityProfileService.canLoadMore && !pending()) {
{{ 'COMMON.SHOW_MORE_RESULTS' | translate }}
diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts index e38cdd3ab6b..9b7de4637be 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile-list/security-profile-list.component.ts @@ -113,7 +113,7 @@ export class SecurityProfileListComponent extends InfiniteScrollTable { - this.dataSource = data; + this.dataSource.set(data); }); const searchCriteriaChange = merge(this.searchChange, this.filterChange, this.orderChange).pipe(debounceTime(FILTER_DEBOUNCE_TIME_MS)); diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.ts index f843ca2d9c4..f0a8df8c516 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.ts @@ -34,6 +34,7 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ +import { signal } from '@angular/core'; import { finalize, Subject } from 'rxjs'; import { Direction } from './direction.enum'; import { DEFAULT_PAGE_SIZE, PageRequest } from './page-request.model'; @@ -42,9 +43,9 @@ import { SearchService } from './search.service'; export const INFINITE_SCROLL_MAX_ITEMS = 100; export class InfiniteScrollTable { - infiniteScrollDisabled = false; - pending = false; - dataSource: T[]; + infiniteScrollDisabled = signal(false); + pending = signal(false); + dataSource = signal(undefined); // with this information, the caller can be able to set himself the end of the change overridePendingChange = false; @@ -56,38 +57,38 @@ export class InfiniteScrollTable { loadMore() { // get more elements if there isn't a pending operation - if (!this.pending) { - this.pending = true; + if (!this.pending()) { + this.pending.set(true); this.searchService.loadMore().subscribe( (data: T[]) => { - this.dataSource = data; + this.dataSource.set(data); if (!this.overridePendingChange) { - this.pending = false; + this.pending.set(false); } - if (this.dataSource.length >= INFINITE_SCROLL_MAX_ITEMS) { - this.infiniteScrollDisabled = true; + if (data.length >= INFINITE_SCROLL_MAX_ITEMS) { + this.infiniteScrollDisabled.set(true); } this.updatedData.next(); }, - () => (this.pending = false), + () => this.pending.set(false), ); } } search(pageRequest: PageRequest = new PageRequest(0, DEFAULT_PAGE_SIZE, 'name', Direction.ASCENDANT)) { // launch the search if there isn't a pending operation - if (!this.pending) { - this.pending = true; - this.dataSource = []; + if (!this.pending()) { + this.pending.set(true); + this.dataSource.set([]); this.updatedData.next(); this.searchService .search(pageRequest) - .pipe(finalize(() => (this.pending = false))) + .pipe(finalize(() => this.pending.set(false))) .subscribe({ next: (data: T[]) => { - this.dataSource = data; + this.dataSource.set(data); if (!this.overridePendingChange) { - this.pending = false; + this.pending.set(false); } this.updatedData.next(); }, From 57e478771f2e5a9d605101c7ad01f141ce3243b6 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 16 Sep 2026 11:58:36 +0000 Subject: [PATCH 23/33] Story #16471: Clean code - fix after rebase --- .../archive-preview.component.ts | 4 +++- .../archive-unit-history-tab.component.ts | 23 +++++++++++++++++-- .../lifecycle-event-node.component.ts | 4 +++- .../leaves-tree/leaves-tree.component.ts | 10 +------- .../update-units-metadata.component.ts | 3 ++- .../audit/audit-list/audit-list.component.ts | 2 -- 6 files changed, 30 insertions(+), 16 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts index 199f84ab367..bddbedb3775 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.ts @@ -70,6 +70,7 @@ import { ArchiveUnitRulesDetailsTabComponent } from './archive-unit-rules-detail import { ArchiveUnitObjectsDetailsTabComponent } from './archive-unit-objects-details-tab/archive-unit-objects-details-tab.component'; import { ReactiveFormsModule } from '@angular/forms'; import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; +import { ArchiveUnitHistoryTabComponent } from './archive-unit-history-tab/archive-unit-history-tab.component'; @Component({ selector: 'app-archive-preview', @@ -82,8 +83,9 @@ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner'; MatTabGroup, NgClass, MatTab, - ArchiveUnitInformationTabComponent, ArchiveUnitDescriptionTabComponent, + ArchiveUnitHistoryTabComponent, + ArchiveUnitInformationTabComponent, ClickOutsideDirective, ArchiveUnitRulesDetailsTabComponent, ArchiveUnitObjectsDetailsTabComponent, diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/archive-unit-history-tab.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/archive-unit-history-tab.component.ts index e19a580a6e4..f4942a5c4c6 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/archive-unit-history-tab.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/archive-unit-history-tab.component.ts @@ -39,16 +39,35 @@ import { Component, computed, effect, inject, input, signal } from '@angular/cor import { rxResource, toSignal } from '@angular/core/rxjs-interop'; import { ActivatedRoute } from '@angular/router'; import { catchError, of } from 'rxjs'; -import type { Unit } from 'vitamui-library'; +import { + EventTypeLabelComponent, + TableFilterComponent, + TableFilterDirective, + TableFilterOptionComponent, + TooltipDirective, + Unit, +} from 'vitamui-library'; import { AccessContract, AccessContractService, ApplicationId, ApplicationService, SnackBarService } from 'vitamui-library'; import { ArchiveUnitLifecycleHistoryService } from './archive-unit-lifecycle-history.service'; import { LifecycleOrigin, OperationLifecycleGroup } from './archive-unit-lifecycle-history.model'; +import { MatProgressSpinner } from '@angular/material/progress-spinner'; +import { TranslatePipe } from '@ngx-translate/core'; +import { LifecycleEventNodeComponent } from './lifecycle-event-node/lifecycle-event-node.component'; @Component({ selector: 'app-archive-unit-history-tab', templateUrl: './archive-unit-history-tab.component.html', styleUrls: ['./archive-unit-history-tab.component.scss'], - standalone: false, + imports: [ + MatProgressSpinner, + TableFilterDirective, + EventTypeLabelComponent, + TooltipDirective, + TranslatePipe, + LifecycleEventNodeComponent, + TableFilterComponent, + TableFilterOptionComponent, + ], }) export class ArchiveUnitHistoryTabComponent { private route = inject(ActivatedRoute); diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.ts index 3d7f4ea0250..bf40d6d89ea 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.ts @@ -36,12 +36,14 @@ */ import { Component, computed, input, signal } from '@angular/core'; import type { ConsolidatedLifecycleEvent } from '../archive-unit-lifecycle-history.model'; +import { EventTypeLabelComponent, DateTimePipe } from 'vitamui-library'; +import { TranslatePipe } from '@ngx-translate/core'; @Component({ selector: 'app-lifecycle-event-node', templateUrl: './lifecycle-event-node.component.html', styleUrls: ['./lifecycle-event-node.component.scss'], - standalone: false, + imports: [EventTypeLabelComponent, DateTimePipe, TranslatePipe], }) export class LifecycleEventNodeComponent { event = input(); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts index 9e6f85a037b..9d4da4df5c5 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-criteria/components/filing-holding-scheme/leaves-tree/leaves-tree.component.ts @@ -36,14 +36,7 @@ */ import { NestedTreeControl } from '@angular/cdk/tree'; import { Component, EventEmitter, inject, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core'; -import { - MatNestedTreeNode, - MatTree, - MatTreeNestedDataSource, - MatTreeNode, - MatTreeNodeDef, - MatTreeNodeOutlet, -} from '@angular/material/tree'; +import { MatNestedTreeNode, MatTree, MatTreeNestedDataSource, MatTreeNodeDef, MatTreeNodeOutlet } from '@angular/material/tree'; import { Subscription } from 'rxjs'; import { ConfigurationsApiService, @@ -80,7 +73,6 @@ import { TranslatePipe } from '@ngx-translate/core'; NgClass, VitamuiTreeNodeComponent, MatTreeNodeOutlet, - MatTreeNode, DecimalPipe, TranslatePipe, ], diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts index c5fdf6fdbe9..65849de872a 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/update-units-metadata/update-units-metadata.component.ts @@ -35,7 +35,7 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnDestroy, TemplateRef, ViewChild } from '@angular/core'; -import { FormControl, Validators } from '@angular/forms'; +import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms'; import { MAT_DIALOG_DATA, MatDialog, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog'; import { Subscription, throwError } from 'rxjs'; import { @@ -67,6 +67,7 @@ import { TranslatePipe } from '@ngx-translate/core'; FileSelectorComponent, MatDialogActions, TranslatePipe, + ReactiveFormsModule, ], }) export class UpdateUnitsMetadataComponent implements OnDestroy { diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts index 1f8fd508ee2..3bf6a2bd081 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.ts @@ -42,7 +42,6 @@ import { Direction, EllipsisDirective, Event, - EventTypeLabelComponent, InfiniteScrollDirective, InfiniteScrollTable, OrderByButtonComponent, @@ -95,7 +94,6 @@ export class AuditFilters { TableFilterDirective, OrderByButtonComponent, NgClass, - EventTypeLabelComponent, MatProgressSpinner, TableFilterComponent, TableFilterOptionComponent, From ecb370ab340d1d9071f3a95cf779e87947ba1587 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 16 Sep 2026 19:02:12 +0200 Subject: [PATCH 24/33] Story #16471: Clean code - fix tests --- .../archive-preview.component.spec.ts | 2 +- .../lifecycle-event-node.component.spec.ts | 24 +------ .../archive-search-collect.component.spec.ts | 3 + .../audit-list/audit-list.component.spec.ts | 4 +- .../app/ontology/ontology.component.spec.ts | 2 +- .../modules/account/account.component.spec.ts | 2 +- .../app/modules/account/account.component.ts | 13 +--- .../app/modules/app-root-component.class.ts | 63 ------------------- .../src/app/modules/sidenav-page.class.ts | 12 ++-- .../infinite-scroll-table.spec.ts | 18 +++--- .../vitamui-library/src/public-api.ts | 1 - ui/ui-frontend/test.ts | 3 +- 12 files changed, 28 insertions(+), 119 deletions(-) delete mode 100644 ui/ui-frontend/projects/vitamui-library/src/app/modules/app-root-component.class.ts diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts index 50f3b5c14fa..89408085da8 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-preview.component.spec.ts @@ -81,7 +81,7 @@ describe('ArchivePreviewComponent', () => { const activatedRouteMock = { params: of({ tenantIdentifier: 1 }), data: of({ appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' }), - snapshot: { data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, + snapshot: { params: { tenantIdentifier: 1 }, data: { appId: 'ARCHIVE_SEARCH_MANAGEMENT_APP' } }, }; const archiveServiceMock = { diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.spec.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.spec.ts index 1e52a12d695..8907cf6b88b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.spec.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-preview/archive-unit-history-tab/lifecycle-event-node/lifecycle-event-node.component.spec.ts @@ -34,31 +34,11 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { NO_ERRORS_SCHEMA, Pipe, PipeTransform } from '@angular/core'; +import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { LifecycleEventNodeComponent } from './lifecycle-event-node.component'; import { ConsolidatedLifecycleEvent } from '../archive-unit-lifecycle-history.model'; -@Pipe({ - name: 'dateTime', - standalone: false, -}) -class DateTimeStubPipe implements PipeTransform { - transform(value: string = ''): string { - return value; - } -} - -@Pipe({ - name: 'translate', - standalone: false, -}) -class TranslateStubPipe implements PipeTransform { - transform(value: string = ''): string { - return value; - } -} - function event(partial: Partial): ConsolidatedLifecycleEvent { return { evId: 'ev1', @@ -85,7 +65,7 @@ describe('LifecycleEventNodeComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [LifecycleEventNodeComponent, DateTimeStubPipe, TranslateStubPipe], + imports: [LifecycleEventNodeComponent], schemas: [NO_ERRORS_SCHEMA], }).compileComponents(); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts index f0dd7a060c0..8d38d67f58c 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.spec.ts @@ -121,6 +121,9 @@ describe('ArchiveSearchCollectComponent', () => { queryParamMap: of({ keys: Object.keys(queryParams) }), data: of(), snapshot: { + data: { + appId: 'SomeAppId', + }, queryParamMap: { keys: Object.keys(queryParams), }, diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts index 7bfc1a58608..a66c2f1ff3a 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit-list/audit-list.component.spec.ts @@ -293,7 +293,7 @@ describe('AuditListComponent', () => { // Given const existenceAudit = auditOfType('PROCESS_AUDIT', 'AUDIT_FILE_EXISTING'); const integrityAudit = auditOfType('PROCESS_AUDIT', 'AUDIT_FILE_INTEGRITY'); - component.dataSource = [existenceAudit, integrityAudit]; + component.dataSource.set([existenceAudit, integrityAudit]); // When component['_filters'] = { startDate: null, endDate: null, types: [AuditCategoryFilter.AUDIT_FILE_EXISTING] }; // Then @@ -303,7 +303,7 @@ describe('AuditListComponent', () => { it('All the audits should be listed when no type is selected', () => { // Given const audit = auditOfType('PROCESS_AUDIT', 'AUDIT_FILE_EXISTING'); - component.dataSource = [audit]; + component.dataSource.set([audit]); // When component['_filters'] = { startDate: null, endDate: null, types: [] }; // Then diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts index 0b6d047f742..759ec2b9531 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.spec.ts @@ -38,7 +38,7 @@ import { Component, Input, NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatDialogModule } from '@angular/material/dialog'; import { MatSidenavModule } from '@angular/material/sidenav'; -import { InjectorModule, LoggerModule, SchemaService, SecurityService } from 'vitamui-library'; +import { InjectorModule, LoggerModule, SchemaService, SecurityService, StartupService } from 'vitamui-library'; import { VitamUICommonTestModule } from 'vitamui-library/testing'; import { OntologyComponent } from './ontology.component'; diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts index 3b8e829d4b6..3fc4f993b79 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.spec.ts @@ -84,7 +84,7 @@ describe('AccountComponent', () => { providers: [ { provide: AccountService, useValue: accountServiceSpy }, { provide: BaseUserInfoApiService, useValue: userInfoApiServiceSpy }, - { provide: ActivatedRoute, useValue: { data: EMPTY } }, + { provide: ActivatedRoute, useValue: { data: { appId: 'SomeAppId' }, snapshot: { data: { appId: 'SomeAppId' } } } }, { provide: ENVIRONMENT, useValue: environment }, { provide: WINDOW_LOCATION, useValue: location }, ], diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts index 87b8b3c0f25..f0a8c783612 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/account/account.component.ts @@ -35,11 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; import { toSignal } from '@angular/core/rxjs-interop'; import { map, switchMap } from 'rxjs/operators'; import { BaseUserInfoApiService } from '../api/base-user-info-api.service'; -import { AppRootComponent } from '../app-root-component.class'; import { ApplicationId } from '../application-id.enum'; import { Account } from '../models/account/account.interface'; import { BreadCrumbData } from '../models/breadcrumb/breadcrumb.interface'; @@ -56,10 +54,9 @@ import { TranslatePipe } from '@ngx-translate/core'; styleUrls: ['./account.component.scss'], imports: [VitamuiTitleBreadcrumbComponent, UserPhotoComponent, MatTabGroup, MatTab, AccountInformationTabComponent, TranslatePipe], }) -export class AccountComponent extends AppRootComponent { +export class AccountComponent { private accountService = inject(AccountService); private userInfoApiService = inject(BaseUserInfoApiService); - route: ActivatedRoute; public displayAppTab = false; public dataBreadcrumb: BreadCrumbData[] = [{ identifier: ApplicationId.PORTAL_APP }, { identifier: ApplicationId.ACCOUNTS_APP }]; @@ -70,12 +67,4 @@ export class AccountComponent extends AppRootComponent { .pipe(switchMap((account) => this.userInfoApiService.getMyUserInfo().pipe(map((userInfo) => ({ ...account, userInfo }) as Account)))), { initialValue: null as Account | null }, ); - - constructor() { - const route = inject(ActivatedRoute); - - super(route); - - this.route = route; - } } diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/app-root-component.class.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/app-root-component.class.ts deleted file mode 100644 index 864b22bfc11..00000000000 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/app-root-component.class.ts +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright French Prime minister Office/SGMAP/DINSIC/Vitam Program (2019-2022) - * and the signatories of the "VITAM - Accord du Contributeur" agreement. - * - * contact@programmevitam.fr - * - * This software is a computer program whose purpose is to implement - * implement a digital archiving front-office system for the secure and - * efficient high volumetry VITAM solution. - * - * This software is governed by the CeCILL-C license under French law and - * abiding by the rules of distribution of free software. You can use, - * modify and/ or redistribute the software under the terms of the CeCILL-C - * license as circulated by CEA, CNRS and INRIA at the following URL - * "http://www.cecill.info". - * - * As a counterpart to the access to the source code and rights to copy, - * modify and redistribute granted by the license, users are provided only - * with a limited warranty and the software's author, the holder of the - * economic rights, and the successive licensors have only limited - * liability. - * - * In this respect, the user's attention is drawn to the risks associated - * with loading, using, modifying and/or developing or reproducing the - * software by the user in light of its specific status of free software, - * that may mean that it is complicated to manipulate, and that also - * therefore means that it is reserved for developers and experienced - * professionals having in-depth computer knowledge. Users are therefore - * encouraged to load and test the software's suitability as regards their - * requirements in conditions enabling the security of their systems and/or - * data to be ensured and, more generally, to use and operate it in the - * same conditions as regards security. - * - * The fact that you are presently reading this means that you have had - * knowledge of the CeCILL-C license and that you accept its terms. - */ -import { ActivatedRoute } from '@angular/router'; -import { InjectorHelper } from './helper/injector-helper'; -import { Logger } from './logger/logger'; - -export class AppRootComponent { - private _appId: string; - - public logger: Logger; - - constructor(route: ActivatedRoute) { - if (InjectorHelper.injector === undefined) { - throw new Error('Injector not Found'); - } - this.logger = InjectorHelper.injector.get(Logger); - route.data.subscribe((data) => { - if (!data.hasOwnProperty('appId')) { - this.logger.error(this, 'Error: Missing "appId" property in route data.'); - } else { - this._appId = data['appId']; - } - }); - } - - get appId(): string { - return this._appId; - } -} diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts index 385c78ffed1..8786207f68d 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts @@ -34,17 +34,17 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { AfterViewInit, Directive, OnDestroy, ViewChild, inject } from '@angular/core'; +import { AfterViewInit, Directive, inject, OnDestroy, ViewChild } from '@angular/core'; import { MatSidenav } from '@angular/material/sidenav'; -import { ActivatedRoute } from '@angular/router'; import { merge, Subject } from 'rxjs'; import { takeUntil } from 'rxjs/operators'; -import { AppRootComponent } from './app-root-component.class'; import { GlobalEventService } from './global-event.service'; +import { Logger } from './logger/logger'; + @Directive() -export class SidenavPage extends AppRootComponent implements AfterViewInit, OnDestroy { +export class SidenavPage implements AfterViewInit, OnDestroy { globalEventService: GlobalEventService; openedItem: T; @@ -52,9 +52,9 @@ export class SidenavPage extends AppRootComponent implements AfterViewInit, O @ViewChild('panel') panel: MatSidenav; private destroy = new Subject(); + private logger = inject(Logger); - constructor(route: ActivatedRoute = inject(ActivatedRoute), globalEventService: GlobalEventService = inject(GlobalEventService)) { - super(route); + constructor(globalEventService: GlobalEventService = inject(GlobalEventService)) { this.globalEventService = globalEventService; merge(this.globalEventService.pageEvent, this.globalEventService.customerEvent, this.globalEventService.tenantEvent) diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.spec.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.spec.ts index 99cda910a08..946b1c1855b 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.spec.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/vitamui-table/infinite-scroll-table.spec.ts @@ -69,13 +69,13 @@ describe('InfiniteScrollTable', () => { const serviceMock = new SearchServiceMock(); const infiniteScrollTable = new InfiniteScrollTable(serviceMock); vi.spyOn(serviceMock, 'search').mockReturnValue(timer(10).pipe(map(() => ['value1', 'value2']))); - expect(infiniteScrollTable.pending).toBe(false); + expect(infiniteScrollTable.pending()).toBe(false); infiniteScrollTable.search(); - expect(infiniteScrollTable.pending).toBe(true); + expect(infiniteScrollTable.pending()).toBe(true); expect(serviceMock.search).toHaveBeenCalledTimes(1); await vi.advanceTimersByTimeAsync(10); - expect(infiniteScrollTable.pending).toBe(false); - expect(infiniteScrollTable.dataSource).toEqual(['value1', 'value2']); + expect(infiniteScrollTable.pending()).toBe(false); + expect(infiniteScrollTable.dataSource()).toEqual(['value1', 'value2']); }); }); @@ -88,13 +88,13 @@ describe('InfiniteScrollTable', () => { const serviceMock = new SearchServiceMock(); const infiniteScrollTable = new InfiniteScrollTable(serviceMock); vi.spyOn(serviceMock, 'loadMore').mockReturnValue(timer(10).pipe(map(() => bigList))); - expect(infiniteScrollTable.infiniteScrollDisabled).toBe(false); - expect(infiniteScrollTable.pending).toBe(false); + expect(infiniteScrollTable.infiniteScrollDisabled()).toBe(false); + expect(infiniteScrollTable.pending()).toBe(false); infiniteScrollTable.loadMore(); - expect(infiniteScrollTable.pending).toBe(true); + expect(infiniteScrollTable.pending()).toBe(true); await vi.advanceTimersByTimeAsync(10); - expect(infiniteScrollTable.pending).toBe(false); - expect(infiniteScrollTable.infiniteScrollDisabled).toBe(true); + expect(infiniteScrollTable.pending()).toBe(false); + expect(infiniteScrollTable.infiniteScrollDisabled()).toBe(true); }); }); }); diff --git a/ui/ui-frontend/projects/vitamui-library/src/public-api.ts b/ui/ui-frontend/projects/vitamui-library/src/public-api.ts index 109b6611e5e..d171f3f8534 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/public-api.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/public-api.ts @@ -126,7 +126,6 @@ export * from './app/modules/api/profile-api.service'; export * from './app/modules/api/rule-api.service'; export * from './app/modules/api/subrogation-api.service'; export * from './app/modules/api/user-api.service'; -export * from './app/modules/app-root-component.class'; export * from './app/modules/app.guard'; export * from './app/modules/application-id.enum'; export * from './app/modules/application.service'; diff --git a/ui/ui-frontend/test.ts b/ui/ui-frontend/test.ts index 6c59f0cab37..490cdc3fbcd 100644 --- a/ui/ui-frontend/test.ts +++ b/ui/ui-frontend/test.ts @@ -49,12 +49,13 @@ import { BASE_URL, LoggerModule, SUBROGRATION_REFRESH_RATE_MS, WINDOW_LOCATION } import { provideTranslateService, TranslatePipe } from '@ngx-translate/core'; import { provideHttpClientTesting } from '@angular/common/http/testing'; import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; +import { PipesModule } from './projects/vitamui-library/src/app/modules/pipes/pipes.module'; const configureTestingModule = TestBed.configureTestingModule.bind(TestBed); TestBed.configureTestingModule = ((moduleDef: any) => configureTestingModule({ ...moduleDef, - imports: [...(moduleDef?.imports ?? []), LoggerModule.forRoot(), TranslatePipe], + imports: [...(moduleDef?.imports ?? []), LoggerModule.forRoot(), TranslatePipe, PipesModule], schemas: [...(moduleDef?.schemas ?? []), CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], providers: [ provideTranslateService({ fallbackLang: 'fr' }), From 405a98bdfda40d69196f606878a32856c3a922c6 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 16 Sep 2026 15:09:16 +0000 Subject: [PATCH 25/33] Story #16471: Clean code - WIP fix archive-search --- .../add-management-rules.component.html | 2 +- .../add-management-rules.component.ts | 75 +++++++++++-------- 2 files changed, 45 insertions(+), 32 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.html b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.html index 5dc5062c04b..e956a87cc8b 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.html +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.html @@ -43,7 +43,7 @@
- @if (isLoading) { + @if (isLoading()) {
diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts index 5f5aef30c7d..c548f27df26 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive-search/additional-actions-search/management-rules/archive-unit-rules/add-management-rules/add-management-rules.component.ts @@ -34,13 +34,13 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, TemplateRef, ViewChild } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnDestroy, OnInit, Output, signal, TemplateRef, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms'; import { MatDialog, MatDialogActions, MatDialogClose } from '@angular/material/dialog'; import { TranslatePipe, TranslateService } from '@ngx-translate/core'; import { cloneDeep } from 'lodash-es'; import { merge, Observable, Subscription } from 'rxjs'; -import { debounceTime, filter, map } from 'rxjs/operators'; +import { debounceTime, filter, finalize, map } from 'rxjs/operators'; import { CriteriaDataType, CriteriaOperator, @@ -135,8 +135,8 @@ export class AddManagementRulesComponent implements OnDestroy, OnInit { getRuleSuscription: Subscription; searchArchiveUnitsByCriteriaSubscription: Subscription; - isLoading = false; - isWarningLoading = false; + isLoading = signal(false); + isWarningLoading = signal(false); isDisabled = true; managementRules: ManagementRules[] = []; managementRulesSubscription: Subscription; @@ -216,7 +216,7 @@ export class AddManagementRulesComponent implements OnDestroy, OnInit { } addRuleToQuery() { - this.isLoading = true; + this.isLoading.set(true); this.initDSLQuery(); const onlyManagementRules: SearchCriteriaEltDto = { @@ -241,25 +241,30 @@ export class AddManagementRulesComponent implements OnDestroy, OnInit { if (this.hasExactCount) { this.searchArchiveUnitsByCriteriaSubscription = this.archiveService .getTotalTrackHitsByCriteria(this.criteriaSearchDSLQuery.criteriaList) - .subscribe((resultsNumber) => { - this.itemsWithSameRule = resultsNumber; - this.itemsToUpdate = this.selectedItem - resultsNumber; - this.isLoading = false; + .pipe(finalize(() => this.isLoading.set(false))) + .subscribe({ + next: (resultsNumber) => { + this.itemsWithSameRule = resultsNumber; + this.itemsToUpdate = this.selectedItem - resultsNumber; + }, + error: () => this.isLoading.set(false), }); } else { this.searchArchiveUnitsByCriteriaSubscription = this.archiveService .searchArchiveUnitsByCriteria(this.criteriaSearchDSLQuery) - .subscribe((data) => { - this.itemsWithSameRule = data.totalResults; + .pipe(finalize(() => this.isLoading.set(false))) + .subscribe({ + next: (data) => { + this.itemsWithSameRule = data.totalResults; - this.itemsToUpdate = - data.totalResults === this.vitamConfigurationService.tenantConfig()?.resultThreshold - ? this.resultNumberToShow - : this.selectedItem === this.vitamConfigurationService.tenantConfig()?.resultThreshold + this.itemsToUpdate = + data.totalResults === this.vitamConfigurationService.tenantConfig()?.resultThreshold ? this.resultNumberToShow - : this.selectedItem - data.totalResults; - - this.isLoading = false; + : this.selectedItem === this.vitamConfigurationService.tenantConfig()?.resultThreshold + ? this.resultNumberToShow + : this.selectedItem - data.totalResults; + }, + error: () => this.isLoading.set(false), }); } if (this.ruleDetailsForm.get('startDate').value) { @@ -268,7 +273,7 @@ export class AddManagementRulesComponent implements OnDestroy, OnInit { } addRuleAndStartDateToQuery() { - this.isWarningLoading = true; + this.isWarningLoading.set(true); this.initDSLQuery(); if (this.ruleDetailsForm.get('startDate').value) { const criteriaWithId: SearchCriteriaEltDto = { @@ -302,18 +307,26 @@ export class AddManagementRulesComponent implements OnDestroy, OnInit { this.criteriaSearchDSLQuery.criteriaList.push(onlyManagementRules); if (this.hasExactCount) { - this.archiveService.getTotalTrackHitsByCriteria(this.criteriaSearchDSLQuery.criteriaList).subscribe((resultsNumber) => { - this.itemsWithSameRuleAndDate = resultsNumber; - this.isWarningLoading = false; - }); + this.archiveService + .getTotalTrackHitsByCriteria(this.criteriaSearchDSLQuery.criteriaList) + .pipe(finalize(() => this.isWarningLoading.set(false))) + .subscribe({ + next: (resultsNumber) => (this.itemsWithSameRuleAndDate = resultsNumber), + error: () => this.isWarningLoading.set(false), + }); } else { - this.archiveService.searchArchiveUnitsByCriteria(this.criteriaSearchDSLQuery).subscribe((data) => { - this.itemsWithSameRuleAndDate = - data.totalResults === this.vitamConfigurationService.tenantConfig()?.resultThreshold - ? this.resultNumberToShow - : data.totalResults; - }); - this.isWarningLoading = false; + this.archiveService + .searchArchiveUnitsByCriteria(this.criteriaSearchDSLQuery) + .pipe(finalize(() => this.isWarningLoading.set(false))) + .subscribe({ + next: (data) => { + this.itemsWithSameRuleAndDate = + data.totalResults === this.vitamConfigurationService.tenantConfig()?.resultThreshold + ? this.resultNumberToShow + : data.totalResults; + }, + error: () => this.isWarningLoading.set(false), + }); } } } @@ -381,7 +394,7 @@ export class AddManagementRulesComponent implements OnDestroy, OnInit { submit() { this.isDisabled = true; this.showText = true; - this.isLoading = !this.isLoading; + this.isLoading.set(true); const rule: RuleAction = { rule: this.ruleDetailsForm.get('rule').value, startDate: this.ruleDetailsForm.get('startDate').value, From 5228e5c44adb8c6473be61c5d62ca9c1d2858f84 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 16 Sep 2026 17:11:49 +0000 Subject: [PATCH 26/33] Story #16471: Clean code - import material tokens --- ui/ui-frontend/projects/archive-search/src/main.ts | 3 ++- ui/ui-frontend/projects/collect/src/main.ts | 3 ++- ui/ui-frontend/projects/identity/src/main.ts | 3 ++- ui/ui-frontend/projects/ingest/src/main.ts | 3 ++- ui/ui-frontend/projects/pastis/src/main.ts | 2 ++ ui/ui-frontend/projects/referential/src/main.ts | 2 ++ 6 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/main.ts b/ui/ui-frontend/projects/archive-search/src/main.ts index c5b486a8ed9..7468930d0a2 100644 --- a/ui/ui-frontend/projects/archive-search/src/main.ts +++ b/ui/ui-frontend/projects/archive-search/src/main.ts @@ -38,7 +38,7 @@ import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, VitamUILibraryModule, WINDOW_LOCATION } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/core/core.module'; @@ -66,6 +66,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideI18n(), provideNativeDateAdapter(), diff --git a/ui/ui-frontend/projects/collect/src/main.ts b/ui/ui-frontend/projects/collect/src/main.ts index 09b2920db98..a906660b060 100644 --- a/ui/ui-frontend/projects/collect/src/main.ts +++ b/ui/ui-frontend/projects/collect/src/main.ts @@ -38,7 +38,7 @@ import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, VitamUILibraryModule, WINDOW_LOCATION } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/collect/core/core.module'; @@ -66,6 +66,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideI18n(), provideNativeDateAdapter(), diff --git a/ui/ui-frontend/projects/identity/src/main.ts b/ui/ui-frontend/projects/identity/src/main.ts index 59dd3994c1f..82316e98aa3 100644 --- a/ui/ui-frontend/projects/identity/src/main.ts +++ b/ui/ui-frontend/projects/identity/src/main.ts @@ -38,7 +38,7 @@ import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { AuthenticationModule, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthenticationModule, provideI18n, VitamUICommonModule, VitamUILibraryModule, WINDOW_LOCATION } from 'vitamui-library'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/core/core.module'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; @@ -65,6 +65,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideI18n(), Title, diff --git a/ui/ui-frontend/projects/ingest/src/main.ts b/ui/ui-frontend/projects/ingest/src/main.ts index a6d1823d849..bbf8ccfa738 100644 --- a/ui/ui-frontend/projects/ingest/src/main.ts +++ b/ui/ui-frontend/projects/ingest/src/main.ts @@ -38,7 +38,7 @@ import { enableProdMode, importProvidersFrom, LOCALE_ID } from '@angular/core'; import { bootstrapApplication, BrowserModule, Title } from '@angular/platform-browser'; import { environment } from './environments/environment'; -import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, WINDOW_LOCATION } from 'vitamui-library'; +import { AuthenticationModule, BytesPipe, provideI18n, VitamUICommonModule, VitamUILibraryModule, WINDOW_LOCATION } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; import { DatePipe } from '@angular/common'; import { CoreModule } from './app/core/core.module'; @@ -70,6 +70,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideI18n(), provideNativeDateAdapter(), diff --git a/ui/ui-frontend/projects/pastis/src/main.ts b/ui/ui-frontend/projects/pastis/src/main.ts index 909a576fe1f..6c1dde9d275 100644 --- a/ui/ui-frontend/projects/pastis/src/main.ts +++ b/ui/ui-frontend/projects/pastis/src/main.ts @@ -49,6 +49,7 @@ import { StartupService, ThemeService, VitamUICommonModule, + VitamUILibraryModule, WINDOW_LOCATION, } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; @@ -92,6 +93,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideI18n(), provideNativeDateAdapter(), diff --git a/ui/ui-frontend/projects/referential/src/main.ts b/ui/ui-frontend/projects/referential/src/main.ts index e84b813dfe3..9ccaae45807 100644 --- a/ui/ui-frontend/projects/referential/src/main.ts +++ b/ui/ui-frontend/projects/referential/src/main.ts @@ -46,6 +46,7 @@ import { InjectorModule, provideI18n, VitamUICommonModule, + VitamUILibraryModule, WINDOW_LOCATION, } from 'vitamui-library'; import { provideNativeDateAdapter } from '@angular/material/core'; @@ -76,6 +77,7 @@ bootstrapApplication(AppComponent, { // or after 30 seconds (whichever comes first). registrationStrategy: 'registerWhenStable:30000', }), + VitamUILibraryModule, // For Material tokens ), provideI18n(), provideNativeDateAdapter(), From 1d64a39c2c225204efa4138155a01513875c58ba Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 23 Sep 2026 17:20:33 +0200 Subject: [PATCH 27/33] Story #16471: Clean code - fix build --- .../src/app/archive/archive.component.ts | 9 ++------ .../archive-search-collect.component.ts | 8 ++----- .../collect/projects/projects.component.ts | 3 ++- .../transactions/transactions.component.ts | 18 +-------------- .../src/app/customer/customer.component.ts | 23 +------------------ .../external-param-profile.component.ts | 21 ++--------------- .../identity/src/app/group/group.component.ts | 22 +----------------- .../src/app/hierarchy/hierarchy.component.ts | 15 ++---------- .../src/app/profile/profile.component.ts | 15 +----------- .../subrogate-user.component.ts | 13 ++--------- .../identity/src/app/user/user.component.ts | 14 ----------- .../holding-filling-scheme.component.ts | 13 ++--------- .../ingest/src/app/ingest/ingest.component.ts | 7 ------ .../list-profile/list-profile.component.ts | 10 ++------ .../access-contract.component.ts | 14 +---------- .../accession-register.component.ts | 4 +--- .../src/app/admin-dsl/admin-dsl.component.ts | 10 ++------ .../src/app/agency/agency.component.ts | 14 +---------- .../src/app/audit/audit.component.ts | 13 +++-------- .../src/app/context/context.component.ts | 20 ++-------------- .../app/file-format/file-format.component.ts | 12 +--------- .../ingest-contract.component.ts | 11 +++------ .../logbook-operation.component.ts | 19 ++------------- .../management-contract.component.ts | 11 +++------ .../src/app/ontology/ontology.component.ts | 12 +--------- .../probative-value.component.ts | 9 ++------ .../src/app/rule/rule.component.ts | 11 +++------ .../securisation/securisation.component.ts | 11 +-------- .../security-profile.component.ts | 17 +------------- .../src/app/modules/sidenav-page.class.ts | 2 +- 30 files changed, 48 insertions(+), 333 deletions(-) diff --git a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts index a2e452b8d63..8f65fdf4492 100644 --- a/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts +++ b/ui/ui-frontend/projects/archive-search/src/app/archive/archive.component.ts @@ -42,7 +42,6 @@ import { Collection, ExternalParameters, ExternalParametersService, - GlobalEventService, ResizeSidebarDirective, SchemaService, SidenavPage, @@ -81,7 +80,7 @@ import { TranslatePipe } from '@ngx-translate/core'; ], }) export class ArchiveComponent extends SidenavPage implements OnInit { - private route: ActivatedRoute; + private route = inject(ActivatedRoute); private router = inject(Router); dialog = inject(MatDialog); private archiveSharedDataService = inject(ArchiveSharedDataService); @@ -102,11 +101,7 @@ export class ArchiveComponent extends SidenavPage implements OnInit { hasUpdateDescriptiveUnitMetadataRole = false; constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - this.route = route; + super(); this.schemaService.getSchema(Collection.ARCHIVE_UNIT); } diff --git a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts index abcd79b6a2a..f0722fe863e 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/archive-search-collect/archive-search-collect.component.ts @@ -68,7 +68,6 @@ import { ExternalParameters, ExternalParametersService, FilingHoldingSchemeNode, - GlobalEventService, InfiniteScrollDirective, MANAGEMENT_RULE_SHARED_DATA_SERVICE, ManagementRuleSearchComponent, @@ -216,7 +215,7 @@ const FILTER_DEBOUNCE_TIME_MS = 400; ], }) export class ArchiveSearchCollectComponent extends SidenavPage implements OnInit, OnDestroy, AfterViewInit { - private route: ActivatedRoute; + private route = inject(ActivatedRoute); private externalParameterService = inject(ExternalParametersService); private translateService = inject(TranslateService); private archiveUnitCollectService = inject(ArchiveCollectService); @@ -333,11 +332,8 @@ export class ArchiveSearchCollectComponent extends SidenavPage implements O discussionEntities: DiscussionEntity[]; constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); + super(); - super(route, globalEventService); - this.route = route; const archiveSharedDataService = this.archiveSharedDataService; this.subscriptions.add( diff --git a/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts index 159908156d9..b1101476082 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/projects/projects.component.ts @@ -84,7 +84,8 @@ export class ProjectsComponent extends SidenavPage implements OnDestroy { const projectsService = inject(ProjectsService); const route = inject(ActivatedRoute); - super(route, projectsService); + super(projectsService); + route.params.subscribe((params) => { this.tenantIdentifier = params['tenantIdentifier']; }); diff --git a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts index 362cdf781a7..e6496956d91 100644 --- a/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts +++ b/ui/ui-frontend/projects/collect/src/app/collect/transactions/transactions.component.ts @@ -35,18 +35,9 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; -import { - ApplicationId, - BreadCrumbData, - GlobalEventService, - Project, - SidenavPage, - Transaction, - VitamuiTitleBreadcrumbComponent, -} from 'vitamui-library'; +import { ApplicationId, BreadCrumbData, Project, SidenavPage, Transaction, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { TransactionsService } from './transactions.service'; import { MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; import { TransactionListComponent } from './transaction-list/transaction-list.component'; @@ -67,13 +58,6 @@ export class TransactionsComponent extends SidenavPage implements OnInit { transactions$: Observable; dataBreadcrumb: BreadCrumbData[]; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - } - ngOnInit(): void { const TRANSACTION_MONITORING = 'TRANSACTIONS_MONITORING'; this.projectName$ = this.transactionsService.getProject$().pipe(map((project: Project) => project.messageIdentifier)); diff --git a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts index 6bf3152f208..6f23090cd52 100644 --- a/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/customer/customer.component.ts @@ -36,17 +36,8 @@ */ import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute } from '@angular/router'; -import { - Customer, - GlobalEventService, - Owner, - SidenavPage, - Tenant, - VitamuiBannerComponent, - VitamuiTitleBreadcrumbComponent, -} from 'vitamui-library'; +import { Customer, Owner, SidenavPage, Tenant, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { CustomerService } from '../core/customer.service'; import { CustomerCreateComponent } from './customer-create/customer-create.component'; import { CustomerListComponent } from './customer-list/customer-list.component'; @@ -73,8 +64,6 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class CustomerComponent extends SidenavPage implements OnInit { private dialog = inject(MatDialog); - route: ActivatedRoute; - override globalEventService: GlobalEventService; customerService = inject(CustomerService); public customers: Customer[]; @@ -84,16 +73,6 @@ export class CustomerComponent extends SidenavPage im @ViewChild(CustomerListComponent, { static: true }) customerListComponent: CustomerListComponent; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - this.globalEventService = globalEventService; - } - ngOnInit() { this.customerService.getGdprReadOnlySettingStatus().subscribe((settingStatus) => { this.gdprReadOnlySettingStatus = settingStatus; diff --git a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts index b877290c8d2..6cf8d1b60f0 100644 --- a/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/external-param-profile/external-param-profile.component.ts @@ -37,13 +37,7 @@ import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { - ExternalParamProfile, - GlobalEventService, - SidenavPage, - VitamuiBannerComponent, - VitamuiTitleBreadcrumbComponent, -} from 'vitamui-library'; +import { ExternalParamProfile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { ExternalParamProfileCreateComponent } from './external-param-profile-create/external-param-profile-create.component'; import { ExternalParamProfileListComponent } from './external-param-profile-list/external-param-profile-list.component'; import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; @@ -67,24 +61,13 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class ExternalParamProfileComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); - route: ActivatedRoute; - override globalEventService: GlobalEventService; + private route = inject(ActivatedRoute); dto: ExternalParamProfile; tenantIdentifier: string; public search: string; @ViewChild(ExternalParamProfileListComponent, { static: true }) externalParamProfileListComponent: ExternalParamProfileListComponent; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - this.globalEventService = globalEventService; - } - ngOnInit(): void { this.route.params.subscribe((params) => { this.tenantIdentifier = params['tenantIdentifier']; diff --git a/ui/ui-frontend/projects/identity/src/app/group/group.component.ts b/ui/ui-frontend/projects/identity/src/app/group/group.component.ts index 435f6c4d699..d5690ab6762 100644 --- a/ui/ui-frontend/projects/identity/src/app/group/group.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/group/group.component.ts @@ -73,16 +73,8 @@ import { GroupService } from './group.service'; */ import { Component, inject, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute } from '@angular/router'; -import { - GlobalEventService, - Group, - SidenavPage, - SnackBarService, - VitamuiBannerComponent, - VitamuiTitleBreadcrumbComponent, -} from 'vitamui-library'; +import { Group, SidenavPage, SnackBarService, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { GroupCreateComponent } from './group-create/group-create.component'; import { GroupListComponent } from './group-list/group-list.component'; import { DownloadSnackBarService } from 'projects/referential/src/app/core/service/download-snack-bar.service'; @@ -107,8 +99,6 @@ import { TranslatePipe } from '@ngx-translate/core'; ], }) export class GroupComponent extends SidenavPage { - route: ActivatedRoute; - override globalEventService: GlobalEventService; private dialog = inject(MatDialog); private downloadSnackBarService = inject(DownloadSnackBarService); private snackBarService = inject(SnackBarService); @@ -120,16 +110,6 @@ export class GroupComponent extends SidenavPage { @ViewChild(GroupListComponent, { static: true }) groupListComponent: GroupListComponent; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - this.globalEventService = globalEventService; - } - openCreateGroupDialog(): void { const dialogRef = this.dialog.open(GroupCreateComponent, { disableClose: true }); dialogRef.afterClosed().subscribe((result) => { diff --git a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts index 73f68554202..b038546c2a3 100644 --- a/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/hierarchy/hierarchy.component.ts @@ -37,7 +37,7 @@ import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { GlobalEventService, Profile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; +import { Profile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { HierarchyCreateComponent } from './hierarchy-create/hierarchy-create.component'; import { HierarchyListComponent } from './hierarchy-list/hierarchy-list.component'; import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; @@ -61,8 +61,7 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class HierarchyComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); - route: ActivatedRoute; - override globalEventService: GlobalEventService; + private route = inject(ActivatedRoute); public profiles: Profile[]; public search: string; @@ -70,16 +69,6 @@ export class HierarchyComponent extends SidenavPage implements OnInit { @ViewChild(HierarchyListComponent, { static: true }) hierarchyListComponent: HierarchyListComponent; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - this.globalEventService = globalEventService; - } - ngOnInit() { this.route.paramMap.subscribe((paramMap) => { this.tenantIdentifier = +paramMap.get('tenantIdentifier'); diff --git a/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts b/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts index 0ef33006f10..a9e774706e2 100644 --- a/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/profile/profile.component.ts @@ -34,11 +34,10 @@ * The fact that you are presently reading this means that you have had * knowledge of the CeCILL-C license and that you accept its terms. */ -import { GlobalEventService, Profile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; +import { Profile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { Component, inject, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute } from '@angular/router'; import { ProfileCreateComponent } from './profile-create/profile-create.component'; import { ProfileListComponent } from './profile-list/profile-list.component'; @@ -63,23 +62,11 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class ProfileComponent extends SidenavPage { dialog = inject(MatDialog); - route: ActivatedRoute; - override globalEventService: GlobalEventService; public search: string; @ViewChild(ProfileListComponent, { static: true }) profileListComponent: ProfileListComponent; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - this.globalEventService = globalEventService; - } - openProfilAdminCreateDialog() { const dialogRef = this.dialog.open(ProfileCreateComponent, { disableClose: true }); dialogRef.afterClosed().subscribe((result) => { diff --git a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts index 8ecc57b5223..2fea78bba64 100644 --- a/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/subrogation/subrogate-user/subrogate-user.component.ts @@ -40,7 +40,6 @@ import { ActivatedRoute, Router } from '@angular/router'; import { Subject } from 'rxjs'; import { switchMap, takeUntil } from 'rxjs/operators'; import { - AppRootComponent, Customer, CustomerSelectionService, GlobalEventService, @@ -67,11 +66,11 @@ import { TranslatePipe } from '@ngx-translate/core'; TranslatePipe, ], }) -export class SubrogateUserComponent extends AppRootComponent implements OnInit, OnDestroy { +export class SubrogateUserComponent implements OnInit, OnDestroy { dialog = inject(MatDialog); globalEventService = inject(GlobalEventService); private router = inject(Router); - private route: ActivatedRoute; + private route = inject(ActivatedRoute); private subrogationModalService = inject(SubrogationModalService); private customerSelectService = inject(CustomerSelectService); private customerSelectionService = inject(CustomerSelectionService); @@ -82,14 +81,6 @@ export class SubrogateUserComponent extends AppRootComponent implements OnInit, private destroyer$ = new Subject(); - constructor() { - const route = inject(ActivatedRoute); - - super(route); - - this.route = route; - } - ngOnInit() { this.customerSelectService .getAll(true) diff --git a/ui/ui-frontend/projects/identity/src/app/user/user.component.ts b/ui/ui-frontend/projects/identity/src/app/user/user.component.ts index 0c63db19316..fdd413f7f7a 100644 --- a/ui/ui-frontend/projects/identity/src/app/user/user.component.ts +++ b/ui/ui-frontend/projects/identity/src/app/user/user.component.ts @@ -36,7 +36,6 @@ */ import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute } from '@angular/router'; import { DownloadSnackBarService } from 'projects/referential/src/app/core/service/download-snack-bar.service'; import { Subscription } from 'rxjs'; import { finalize } from 'rxjs/operators'; @@ -46,7 +45,6 @@ import { Customer, DEFAULT_PAGE_SIZE, Direction, - GlobalEventService, Group, PageRequest, SidenavPage, @@ -82,9 +80,7 @@ import { TranslatePipe } from '@ngx-translate/core'; export class UserComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); userService = inject(UserService); - route: ActivatedRoute; customerService = inject(CustomerService); - override globalEventService: GlobalEventService; groupService = inject(GroupService); private authService = inject(AuthService); private downloadSnackBarService = inject(DownloadSnackBarService); @@ -99,16 +95,6 @@ export class UserComponent extends SidenavPage implements OnInit { @ViewChild(UserListComponent, { static: true }) userListComponent: UserListComponent; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - this.globalEventService = globalEventService; - } - ngOnInit() { this.customerService.getMyCustomer().subscribe((customer) => (this.customer = customer)); this.groupService.getAll(true).subscribe((data: Group[]) => (this.groups = data)); diff --git a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts index 832f364a7a5..161fb6c0551 100644 --- a/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/holding-filling-scheme/holding-filling-scheme.component.ts @@ -37,7 +37,7 @@ import { Component, inject, OnInit } from '@angular/core'; import { MatDialog, MatDialogConfig } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; -import { GlobalEventService, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; +import { SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { IngestType } from '../core/common/ingest-type.enum'; import { UploadComponent } from '../core/common/upload.component'; import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; @@ -60,22 +60,13 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class HoldingFillingSchemeComponent extends SidenavPage implements OnInit { private router = inject(Router); - private route: ActivatedRoute; + private route = inject(ActivatedRoute); dialog = inject(MatDialog); IngestType = IngestType; tenantIdentifier: string; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - } - ngOnInit() { this.route.params.subscribe((params) => { this.tenantIdentifier = params['tenantIdentifier']; diff --git a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts index 34ebbdee681..b404949210f 100644 --- a/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts +++ b/ui/ui-frontend/projects/ingest/src/app/ingest/ingest.component.ts @@ -42,7 +42,6 @@ import { AdminUserProfile, DatepickerComponent, Direction, - GlobalEventService, SearchBarComponent, SidenavPage, TooltipDirective, @@ -105,12 +104,6 @@ export class IngestComponent extends SidenavPage implements On ingestList: IngestList = new IngestList(); ingestThatHasChanged: LogbookOperation | null = null; - constructor() { - const globalEventService = inject(GlobalEventService); - const route = inject(ActivatedRoute); - super(route, globalEventService); - } - ngOnInit(): void { this.initTenantFromRoute(); this.initDateRangeForm(); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts index dded6dcdefa..795221389f8 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/profile/list-profile/list-profile.component.ts @@ -44,7 +44,6 @@ a web application to create, edit, import and export archive profiles based on the french SEDA standard (https://redirect.francearchives.fr/seda/). - This software is governed by the CeCILL-C license under French law and abiding by the rules of distribution of free software. You can use, modify and/ or redistribute the software under the terms of the CeCILL-C @@ -80,7 +79,6 @@ import { filter, of, Subscription, switchMap } from 'rxjs'; import { CommonConfirmDialogComponent, Direction, - GlobalEventService, InfiniteScrollDirective, OrderByButtonComponent, PipesModule, @@ -154,7 +152,7 @@ export class ListProfileComponent extends SidenavPage implem private dialog = inject(MatDialog); private startupService = inject(StartupService); private pastisConfig = inject(PastisConfiguration); - route: ActivatedRoute; + private route = inject(ActivatedRoute); private dataGeneriquePopupService = inject(DataGeneriquePopupService); private translateService = inject(TranslateService); private toggleService = inject(ToggleSidenavService); @@ -218,11 +216,7 @@ export class ListProfileComponent extends SidenavPage implem profilesChargees = false; constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - this.route = route; + super(); this.pendingSub = this.toggleService.isPending.subscribe((status) => { this.pending = status; diff --git a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts index d9d09707706..9d621d375aa 100644 --- a/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/access-contract/access-contract.component.ts @@ -45,7 +45,6 @@ import { ApplicationService, DownloadUtils, FileTypes, - GlobalEventService, SidenavPage, SnackBarService, VitamuiBannerComponent, @@ -84,9 +83,8 @@ const IMPORT_FILE_MODEL_NAME = 'Import_access_contrat_template.csv'; ], }) export class AccessContractComponent extends SidenavPage implements OnInit, OnDestroy { - override globalEventService: GlobalEventService; private dialog = inject(MatDialog); - route: ActivatedRoute; + private route = inject(ActivatedRoute); private readonly accessContractService = inject(AccessContractService); private applicationService = inject(ApplicationService); private translateService = inject(TranslateService); @@ -100,16 +98,6 @@ export class AccessContractComponent extends SidenavPage impleme #isSlaveMode$ = this.applicationService.isApplicationExternalIdentifierEnabled('ACCESS_CONTRACT').pipe(shareReplay(1)); - constructor() { - const globalEventService = inject(GlobalEventService); - const route = inject(ActivatedRoute); - - super(route, globalEventService); - - this.globalEventService = globalEventService; - this.route = route; - } - ngOnInit() { this.route.params.subscribe((params) => (this.tenantIdentifier = params['tenantIdentifier'])); this.globalEventService.tenantEvent.subscribe(() => this.refreshList()); diff --git a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts index 81dd67612e3..9675e749e42 100644 --- a/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/accession-register/accession-register.component.ts @@ -35,7 +35,6 @@ * knowledge of the CeCILL-C license and that you accept its terms. */ import { Component, inject, OnDestroy, OnInit } from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { @@ -85,9 +84,8 @@ export class AccessionRegisterComponent extends SidenavPage { if (params['tenantIdentifier']) { this.tenantId = params['tenantIdentifier']; diff --git a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts index c398eefdae8..f24e427863f 100644 --- a/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/agency/agency.component.ts @@ -43,7 +43,6 @@ import { AgencyService, ApplicationId, FileTypes, - GlobalEventService, QueryParamsService, Role, SecurityService, @@ -79,8 +78,7 @@ import { map } from 'rxjs/operators'; }) export class AgencyComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); - override globalEventService: GlobalEventService; - route: ActivatedRoute; + private route = inject(ActivatedRoute); private securityService = inject(SecurityService); private agencyService = inject(AgencyService); private translateService = inject(TranslateService); @@ -96,16 +94,6 @@ export class AgencyComponent extends SidenavPage implements OnInit { hasExportRole = false; hasUpdateRole = false; - constructor() { - const globalEventService = inject(GlobalEventService); - const route = inject(ActivatedRoute); - - super(route, globalEventService); - - this.globalEventService = globalEventService; - this.route = route; - } - ngOnInit(): void { this.route.params.subscribe((params) => { this.tenantIdentifier = +params['tenantIdentifier']; diff --git a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts index 35d4a13db36..af4d26d3699 100644 --- a/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/audit/audit.component.ts @@ -41,7 +41,6 @@ import { ActivatedRoute } from '@angular/router'; import { DatepickerComponent, Event, - GlobalEventService, SearchBarComponent, SidenavPage, VitamuiBannerComponent, @@ -76,8 +75,7 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class AuditComponent extends SidenavPage { dialog = inject(MatDialog); - route: ActivatedRoute; - override globalEventService: GlobalEventService; + private route = inject(ActivatedRoute); private formBuilder = inject(FormBuilder); public dateRangeFilterForm: FormGroup; @@ -89,14 +87,9 @@ export class AuditComponent extends SidenavPage { @ViewChild(AuditListComponent, { static: true }) auditListComponent: AuditListComponent; constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); + super(); - super(route, globalEventService); - this.route = route; - this.globalEventService = globalEventService; - - route.params.subscribe((params) => { + this.route.params.subscribe((params) => { this.tenantIdentifier = params['tenantIdentifier']; }); diff --git a/ui/ui-frontend/projects/referential/src/app/context/context.component.ts b/ui/ui-frontend/projects/referential/src/app/context/context.component.ts index 7eb0fff2c80..78b3187dad2 100644 --- a/ui/ui-frontend/projects/referential/src/app/context/context.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/context/context.component.ts @@ -38,14 +38,7 @@ import { Component, inject, OnInit, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { - ApplicationService, - Context, - GlobalEventService, - SidenavPage, - VitamuiBannerComponent, - VitamuiTitleBreadcrumbComponent, -} from 'vitamui-library'; +import { ApplicationService, Context, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { ContextCreateComponent } from './context-create/context-create.component'; import { ContextListComponent } from './context-list/context-list.component'; @@ -72,7 +65,7 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class ContextComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); - route: ActivatedRoute; + private route = inject(ActivatedRoute); private applicationService = inject(ApplicationService); search = ''; @@ -82,15 +75,6 @@ export class ContextComponent extends SidenavPage implements OnInit { #isSlaveMode$ = this.applicationService.isApplicationExternalIdentifierEnabled('CONTEXT').pipe(shareReplay(1)); - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - } - async openCreateContextDialog() { const isSlaveMode = await firstValueFrom(this.#isSlaveMode$); this.dialog.closeAll(); // Prevent opening multiple dialogs diff --git a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts index 55ee1b8899d..f3d89b8edd3 100644 --- a/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/file-format/file-format.component.ts @@ -44,7 +44,6 @@ import { ApplicationId, FileFormat, FileTypes, - GlobalEventService, Role, SecurityService, SidenavPage, @@ -77,7 +76,7 @@ import { AsyncPipe } from '@angular/common'; }) export class FileFormatComponent extends SidenavPage implements OnInit, OnDestroy { dialog = inject(MatDialog); - route: ActivatedRoute; + private route = inject(ActivatedRoute); private translateService = inject(TranslateService); private securityService = inject(SecurityService); @@ -89,15 +88,6 @@ export class FileFormatComponent extends SidenavPage implements OnIn @ViewChild(FileFormatListComponent, { static: true }) fileFormatListComponentListComponent: FileFormatListComponent; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - } - openCreateFileFormatDialog() { const dialogRef = this.dialog.open(FileFormatCreateComponent, { disableClose: true }); dialogRef.afterClosed().subscribe((result) => { diff --git a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts index 4791f0f9307..ba9dc2256b6 100644 --- a/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ingest-contract/ingest-contract.component.ts @@ -41,7 +41,6 @@ import { ApplicationService, DownloadUtils, FileTypes, - GlobalEventService, IngestContract, Role, SecurityService, @@ -88,7 +87,7 @@ const IMPORT_FILE_MODEL_NAME = 'Import_ingest_contract_template.csv'; }) export class IngestContractComponent extends SidenavPage implements OnInit { dialog = inject(MatDialog); - private route: ActivatedRoute; + private route = inject(ActivatedRoute); private applicationService = inject(ApplicationService); private securityService = inject(SecurityService); private translateService = inject(TranslateService); @@ -108,13 +107,9 @@ export class IngestContractComponent extends SidenavPage impleme #isSlaveMode$ = this.applicationService.isApplicationExternalIdentifierEnabled('INGEST_CONTRACT').pipe(shareReplay(1)); constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); + super(); - super(route, globalEventService); - this.route = route; - - globalEventService.tenantEvent.subscribe(() => { + this.globalEventService.tenantEvent.subscribe(() => { this.refreshList(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts index 5602699b9ab..ba47315813a 100644 --- a/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/logbook-operation/logbook-operation.component.ts @@ -38,13 +38,7 @@ import { AfterViewInit, Component, inject, OnInit, ViewChild } from '@angular/co import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute } from '@angular/router'; -import { - DatepickerComponent, - GlobalEventService, - SidenavPage, - VitamuiBannerComponent, - VitamuiTitleBreadcrumbComponent, -} from 'vitamui-library'; +import { DatepickerComponent, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { EventFilter } from './event-filter.interface'; import { LogbookOperationListComponent } from './logbook-operation-list/logbook-operation-list.component'; import { MatSidenav, MatSidenavContainer, MatSidenavContent } from '@angular/material/sidenav'; @@ -69,7 +63,7 @@ import { TranslatePipe } from '@ngx-translate/core'; ], }) export class LogbookOperationComponent extends SidenavPage implements OnInit, AfterViewInit { - route: ActivatedRoute; + private route = inject(ActivatedRoute); dialog = inject(MatDialog); private formBuilder = inject(FormBuilder); @@ -82,15 +76,6 @@ export class LogbookOperationComponent extends SidenavPage implements OnIni public filters: Readonly = {}; private openOperationDetailAfterLoading: boolean; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - } - ngOnInit() { this.route.paramMap.subscribe((paramMap) => (this.tenantIdentifier = +paramMap.get('tenantIdentifier'))); diff --git a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts index 15d229a3aeb..069c3fa39a5 100644 --- a/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/management-contract/management-contract.component.ts @@ -40,7 +40,6 @@ import { ActivatedRoute } from '@angular/router'; import { firstValueFrom } from 'rxjs'; import { ApplicationService, - GlobalEventService, ManagementContract, SidenavPage, TooltipDirective, @@ -72,7 +71,7 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class ManagementContractComponent extends SidenavPage { dialog = inject(MatDialog); - private route: ActivatedRoute; + private route = inject(ActivatedRoute); private applicationService = inject(ApplicationService); @ViewChild(ManagementContractListComponent, { static: true }) managementContractListComponent: ManagementContractListComponent; @@ -84,13 +83,9 @@ export class ManagementContractComponent extends SidenavPage #isSlaveMode$ = this.applicationService.isApplicationExternalIdentifierEnabled('MANAGEMENT_CONTRACT').pipe(shareReplay(1)); constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); + super(); - super(route, globalEventService); - this.route = route; - - globalEventService.tenantEvent.subscribe(() => { + this.globalEventService.tenantEvent.subscribe(() => { this.refreshList(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts index 1edf8fd407f..7b316358596 100644 --- a/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/ontology/ontology.component.ts @@ -43,7 +43,6 @@ import { ApplicationId, ClickOutsideDirective, FileTypes, - GlobalEventService, Ontology, Role, SchemaElement, @@ -86,7 +85,7 @@ import { OntologyGroupComponent } from './ontology-group/ontology-group.componen }) export class OntologyComponent extends SidenavPage implements OnInit, OnDestroy { dialog = inject(MatDialog); - route: ActivatedRoute; + private route = inject(ActivatedRoute); private translateService = inject(TranslateService); private securityService = inject(SecurityService); private ontologyService = inject(OntologyService); @@ -104,15 +103,6 @@ export class OntologyComponent extends SidenavPage imp canImportSchema: boolean; canCreateVocabulary: boolean; - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - - this.route = route; - } - ngOnInit(): void { this.vitamAdminTenant = +this.startupService.getConfigStringValue('VITAM_ADMIN_TENANT'); this.initializeTenantId(); diff --git a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts index d2c0428202e..8e50dedc116 100644 --- a/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/probative-value/probative-value.component.ts @@ -41,7 +41,6 @@ import { ActivatedRoute, Router } from '@angular/router'; import { DatepickerComponent, Event, - GlobalEventService, SearchBarComponent, SidenavPage, VitamuiBannerComponent, @@ -74,7 +73,7 @@ import { TranslatePipe } from '@ngx-translate/core'; export class ProbativeValueComponent extends SidenavPage implements OnDestroy { dialog = inject(MatDialog); private router = inject(Router); - private route: ActivatedRoute; + private route = inject(ActivatedRoute); private formBuilder = inject(FormBuilder); search: string; @@ -87,11 +86,7 @@ export class ProbativeValueComponent extends SidenavPage implements OnDes @ViewChild(ProbativeValueListComponent, { static: true }) probativeValueListComponent: ProbativeValueListComponent; constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - this.route = route; + super(); this.dateRangeFilterForm = this.formBuilder.group({ startDate: null, diff --git a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts index aa0d3e2af86..b6f7cedd0f6 100644 --- a/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/rule/rule.component.ts @@ -42,7 +42,6 @@ import { Observable } from 'rxjs'; import { ApplicationId, FileTypes, - GlobalEventService, Role, Rule, RuleService, @@ -82,7 +81,7 @@ import { AsyncPipe } from '@angular/common'; export class RuleComponent extends SidenavPage implements OnInit { ruleService = inject(RuleService); dialog = inject(MatDialog); - private route: ActivatedRoute; + private route = inject(ActivatedRoute); private router = inject(Router); private translateService = inject(TranslateService); private securityService = inject(SecurityService); @@ -99,13 +98,9 @@ export class RuleComponent extends SidenavPage implements OnInit { checkExportRole = new Observable(); constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); + super(); - super(route, globalEventService); - this.route = route; - - globalEventService.tenantEvent.subscribe(() => { + this.globalEventService.tenantEvent.subscribe(() => { this.refreshList(); }); diff --git a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts index 75051a57935..66e42710153 100644 --- a/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/securisation/securisation.component.ts @@ -37,11 +37,9 @@ import { Component, inject, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, ReactiveFormsModule } from '@angular/forms'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute } from '@angular/router'; import { DatepickerComponent, Event, - GlobalEventService, SearchBarComponent, SidenavPage, VitamuiBannerComponent, @@ -72,8 +70,6 @@ import { TranslatePipe } from '@ngx-translate/core'; }) export class SecurisationComponent extends SidenavPage { dialog = inject(MatDialog); - route: ActivatedRoute; - override globalEventService: GlobalEventService; private formBuilder = inject(FormBuilder); search: string; @@ -84,12 +80,7 @@ export class SecurisationComponent extends SidenavPage { @ViewChild(SecurisationListComponent, { static: true }) securisationListComponent: SecurisationListComponent; constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - this.route = route; - this.globalEventService = globalEventService; + super(); this.dateRangeFilterForm = this.formBuilder.group({ startDate: null, diff --git a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts index ff370246fe7..6cad2412108 100644 --- a/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts +++ b/ui/ui-frontend/projects/referential/src/app/security-profile/security-profile.component.ts @@ -36,15 +36,7 @@ */ import { Component, inject, ViewChild } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; -import { ActivatedRoute } from '@angular/router'; -import { - ApplicationService, - GlobalEventService, - SecurityProfile, - SidenavPage, - VitamuiBannerComponent, - VitamuiTitleBreadcrumbComponent, -} from 'vitamui-library'; +import { ApplicationService, SecurityProfile, SidenavPage, VitamuiBannerComponent, VitamuiTitleBreadcrumbComponent } from 'vitamui-library'; import { SecurityProfileCreateComponent } from './security-profile-create/security-profile-create.component'; import { SecurityProfileListComponent } from './security-profile-list/security-profile-list.component'; import { shareReplay } from 'rxjs/operators'; @@ -78,13 +70,6 @@ export class SecurityProfileComponent extends SidenavPage { #isSlaveMode$ = this.applicationService.isApplicationExternalIdentifierEnabled('SECURITY_PROFILE').pipe(shareReplay(1)); - constructor() { - const route = inject(ActivatedRoute); - const globalEventService = inject(GlobalEventService); - - super(route, globalEventService); - } - async openCreateSecurityProfileDialog() { const isSlaveMode = await firstValueFrom(this.#isSlaveMode$); this.dialog.closeAll(); // Prevent opening multiple dialogs diff --git a/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts b/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts index 8786207f68d..eee4cb47f40 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/app/modules/sidenav-page.class.ts @@ -52,7 +52,7 @@ export class SidenavPage implements AfterViewInit, OnDestroy { @ViewChild('panel') panel: MatSidenav; private destroy = new Subject(); - private logger = inject(Logger); + protected logger = inject(Logger); constructor(globalEventService: GlobalEventService = inject(GlobalEventService)) { this.globalEventService = globalEventService; From 745c08bc8b11e0b9e30dc968fa2a4eb4d0abb2b9 Mon Sep 17 00:00:00 2001 From: Maxime Robert Date: Wed, 23 Sep 2026 18:08:34 +0200 Subject: [PATCH 28/33] Story #16471: Clean code - fix pastis --- .../src/app/core/services/file.service.ts | 6 +- .../pastis/src/app/main/main.component.html | 9 +- .../pastis/src/app/main/main.component.ts | 26 +- .../edit-profile/edit-profile.component.html | 8 +- .../edit-profile/edit-profile.component.ts | 5 + .../file-tree-metadata.component.html | 40 +-- .../file-tree-metadata.component.ts | 238 +++++++++--------- .../file-tree/file-tree.component.html | 2 +- .../file-tree/file-tree.component.ts | 33 +-- .../list-profile/list-profile.component.html | 47 ++-- .../list-profile/list-profile.component.ts | 54 ++-- .../profile-information-tab.component.html | 2 +- .../profile-information-tab.component.ts | 20 +- .../save-profile-popup.component.html | 2 +- .../save-profile-popup.component.spec.ts | 2 +- .../save-profile-popup.component.ts | 8 +- 16 files changed, 244 insertions(+), 258 deletions(-) diff --git a/ui/ui-frontend/projects/pastis/src/app/core/services/file.service.ts b/ui/ui-frontend/projects/pastis/src/app/core/services/file.service.ts index d43df9aaa78..1268a6b197c 100644 --- a/ui/ui-frontend/projects/pastis/src/app/core/services/file.service.ts +++ b/ui/ui-frontend/projects/pastis/src/app/core/services/file.service.ts @@ -71,7 +71,7 @@ same conditions as regards security. The fact that you are presently reading this means that you have had knowledge of the CeCILL-C license and that you accept its terms. */ -import { Injectable, OnDestroy, inject } from '@angular/core'; +import { Injectable, OnDestroy, inject, signal } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { BehaviorSubject, finalize, mergeMap, Observable, Subscription } from 'rxjs'; import { FileNode, TypeConstants } from '../../models/file-node'; @@ -102,7 +102,7 @@ export class FileService implements OnDestroy { nodeChange = new BehaviorSubject(null); filteredNode = new BehaviorSubject(null); - currentTreeLoaded = false; + currentTreeLoaded = signal(false); parentNodeMap = new Map(); private _profileServiceGetProfileSubscription: Subscription; @@ -120,7 +120,7 @@ export class FileService implements OnDestroy { this.profileService.profileId = profileResponse.id; this.currentTree.next([profileResponse.profile]); - this.currentTreeLoaded = true; + this.currentTreeLoaded.set(true); if (profileResponse.notice) { this.notice.next(profileResponse.notice); this.setNotice(false); diff --git a/ui/ui-frontend/projects/pastis/src/app/main/main.component.html b/ui/ui-frontend/projects/pastis/src/app/main/main.component.html index 029f66b8c47..3d77048f89a 100644 --- a/ui/ui-frontend/projects/pastis/src/app/main/main.component.html +++ b/ui/ui-frontend/projects/pastis/src/app/main/main.component.html @@ -1,10 +1,10 @@ -@if (pending) { +@if (pending()) {
} -@if (!opened) { +@if (!opened()) { @@ -15,11 +15,12 @@ #sidenav (closed)="events.push('close!')" (opened)="events.push('open!')" - [(opened)]="opened" + [opened]="opened()" + (openedChange)="openedChanged($event)" class="pastis-side-nav" mode="side" > - @if (fileService.currentTreeLoaded) { + @if (fileService.currentTreeLoaded()) { } diff --git a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts index e7fe49ab588..45332aedb1e 100644 --- a/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts +++ b/ui/ui-frontend/projects/pastis/src/app/main/main.component.ts @@ -73,6 +73,7 @@ knowledge of the CeCILL-C license and that you accept its terms. */ import { CdkTextareaAutosize } from '@angular/cdk/text-field'; import { Component, inject, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { toSignal } from '@angular/core/rxjs-interop'; import { ActivatedRoute, Router } from '@angular/router'; import { finalize, map, Subscription, switchMap } from 'rxjs'; import { FileService } from '../core/services/file.service'; @@ -121,9 +122,8 @@ export class MainComponent implements OnInit, OnDestroy { @ViewChild(EditProfileComponent) editProfileComponent: EditProfileComponent; - opened: boolean; - pending: boolean; - pendingSub: Subscription; + opened = toSignal(this.sideNavService.isOpened, { initialValue: true }); + pending = toSignal(this.sideNavService.isPending, { initialValue: false }); events: string[] = []; uploadedProfileResponse: ProfileResponse; @@ -133,18 +133,12 @@ export class MainComponent implements OnInit, OnDestroy { private _profileLoadingSubscription: Subscription; constructor() { - this.sideNavService.isOpened.subscribe((status) => { - this.opened = status; - }); - this.pendingSub = this.sideNavService.isPending.subscribe((status) => { - this.pending = status; - }); const navigation = this.router.getCurrentNavigation(); this.uploadedProfileByFile = navigation?.extras.state?.['payload']; } ngOnInit() { - this.fileService.currentTreeLoaded = false; + this.fileService.currentTreeLoaded.set(false); this._routeParamsSubscription = this.route.params.subscribe((params) => { const profileId = params['id']; @@ -167,14 +161,21 @@ export class MainComponent implements OnInit, OnDestroy { }); } }); - this.opened = true; + this.sideNavService.show(); } openSideNav() { - this.opened = true; this.sideNavService.show(); } + openedChanged(opened: boolean) { + if (opened) { + this.sideNavService.show(); + } else { + this.sideNavService.hide(); + } + } + insertionItem($event: FileNodeInsertParams) { const names: string[] = $event.elementsToAdd.map((e) => e.name); this.editProfileComponent.fileTreeComponent.insertItem($event.node, names); @@ -205,7 +206,6 @@ export class MainComponent implements OnInit, OnDestroy { if (this._profileLoadingSubscription != null) { this._profileLoadingSubscription.unsubscribe(); } - if (this.pendingSub) this.pendingSub.unsubscribe(); } private loadProfileById(profileId: string) { diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html index a6d8ab3d287..7e652e8d089 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/edit-profile.component.html @@ -24,7 +24,7 @@
- @if (fileService.currentTreeLoaded) { + @if (fileService.currentTreeLoaded()) {
- @if (fileService.currentTreeLoaded) { + @if (fileService.currentTreeLoaded()) {
- @if (fileService.currentTreeLoaded) { + @if (fileService.currentTreeLoaded()) {
- @if (fileService.currentTreeLoaded) { + @if (fileService.currentTreeLoaded()) { nodes?.length > 0 && nodes.every((node) => Boolean(node)))) .subscribe((data) => { + // Refresh profile-dependent fields set asynchronously by FileService.updateTreeWithProfile. + // The currentTreeLoaded signal change triggers the zoneless change detection that renders them. + this.sedaVersionLabel = this.profileService.getSedaVersionLabel(); + this.isAUP = this.profileService.isMode(ProfileType.PUA); + this.selectedIndex = this.profileService.isMode(ProfileType.PA) ? 0 : 2; const [tree] = data; const nodeName = this.profileService.isMode(ProfileType.PA) ? this.rootTabMetadataName : tree.name; const node = this.fileService.getTree(nodeName); diff --git a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html index 9c119ec9635..40b0e5f9941 100644 --- a/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html +++ b/ui/ui-frontend/projects/pastis/src/app/profile/edit-profile/file-tree-metadata/file-tree-metadata.component.html @@ -16,9 +16,9 @@
- @if (breadcrumbDataMetadata) { + @if (breadcrumbDataMetadata()) { }
@@ -56,9 +56,9 @@
[searchbarPlaceholder]="'PROFILE.EDIT_PROFILE.FILE_TREE_METADATA.SEARCH_PLACEHOLDER' | translate" > - @if (checkElementType() && resolveButtonLabel(clickedNode) !== null) { + @if (checkElementType() && resolveButtonLabel(clickedNode()) !== null) { } @@ -67,7 +67,7 @@
@if (shouldLoadMetadataTable()) { - +
@@ -76,8 +76,8 @@